Skip to content

Commit 6c56046

Browse files
committed
Changes to fix merge inconsistancies after rebase.
1 parent 80a4b39 commit 6c56046

File tree

6 files changed

+107
-21
lines changed

6 files changed

+107
-21
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,25 @@ P75R
4343
P75S
4444
Stnd
4545
mismip+Ice0
46+
47+
#Ignore compiled topography files
48+
bin_to_cube/bin_to_cube
49+
bin_to_cube/bin_to_cube.o
50+
bin_to_cube/shr_kind_mod.mod
51+
bin_to_cube/shr_kind_mod.o
52+
cube_to_target/cube_to_target
53+
cube_to_target/cube_to_target.o
54+
cube_to_target/reconstruct.mod
55+
cube_to_target/reconstruct.o
56+
cube_to_target/remap.mod
57+
cube_to_target/remap.o
58+
cube_to_target/ridge_ana.mod
59+
cube_to_target/ridge_ana.o
60+
cube_to_target/rot.o
61+
cube_to_target/rotation.mod
62+
cube_to_target/shared_vars.mod
63+
cube_to_target/shared_vars.o
64+
cube_to_target/shr_kind_mod.mod
65+
cube_to_target/shr_kind_mod.o
66+
cube_to_target/smooth_topo_cube.o
67+
cube_to_target/smooth_topo_cube_sph.mod

libglide/glide_setup.F90

+50-14
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ subroutine handle_options(section, model)
764764
call GetValue(section,'forcewrite_final', model%options%forcewrite_final)
765765
call GetValue(section,'restart',model%options%is_restart)
766766
call GetValue(section,'restart_extend_velo',model%options%restart_extend_velo)
767+
call GetValue(section,'forcewrite_restart',model%options%forcewrite_restart)
767768

768769
end subroutine handle_options
769770

@@ -1666,6 +1667,17 @@ subroutine print_options(model)
16661667
endif
16671668
end if
16681669

1670+
if (model%options%forcewrite_restart) then
1671+
call write_log('Will write to output files on restart')
1672+
endif
1673+
1674+
!! This option is not currently supported
1675+
!! if (model%options%which_bproc < 0 .or. model%options%which_bproc >= size(which_bproc)) then
1676+
!! call write_log('Error, basal_proc out of range',GM_FATAL)
1677+
!! end if
1678+
!! write(message,*) 'basal_proc : ',model%options%which_bproc,which_bproc(model%options%which_bproc)
1679+
!! call write_log(message)
1680+
16691681
!HO options
16701682

16711683
if (model%options%whichdycore /= DYCORE_GLIDE) then ! glissade higher-order
@@ -2640,10 +2652,6 @@ subroutine print_parameters(model)
26402652
elseif (model%options%which_ho_babc == HO_BABC_POWERLAW) then
26412653
write(message,*) 'Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_const
26422654
call write_log(message)
2643-
write(message,*) 'Max Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_max
2644-
call write_log(message)
2645-
write(message,*) 'Min Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_min
2646-
call write_log(message)
26472655
write(message,*) 'm exponent for power law : ', model%basal_physics%powerlaw_m
26482656
call write_log(message)
26492657
elseif (model%options%which_ho_babc == HO_BABC_COULOMB_FRICTION) then
@@ -2660,10 +2668,6 @@ subroutine print_parameters(model)
26602668
call write_log(message)
26612669
write(message,*) 'Cp for Schoof power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_const
26622670
call write_log(message)
2663-
write(message,*) 'Max Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_max
2664-
call write_log(message)
2665-
write(message,*) 'Min Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_min
2666-
call write_log(message)
26672671
write(message,*) 'm exponent for Schoof power law : ', model%basal_physics%powerlaw_m
26682672
call write_log(message)
26692673
elseif (model%options%which_ho_babc == HO_BABC_COULOMB_POWERLAW_TSAI) then
@@ -2673,10 +2677,6 @@ subroutine print_parameters(model)
26732677
call write_log(message)
26742678
write(message,*) 'Cp for Tsai power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_const
26752679
call write_log(message)
2676-
write(message,*) 'Max Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_max
2677-
call write_log(message)
2678-
write(message,*) 'Min Cp for power law, Pa (m/yr)^(-1/3) : ', model%basal_physics%powerlaw_c_min
2679-
call write_log(message)
26802680
write(message,*) 'm exponent for Tsai power law : ', model%basal_physics%powerlaw_m
26812681
call write_log(message)
26822682
elseif (model%options%which_ho_babc == HO_BABC_POWERLAW_EFFECPRESS) then
@@ -3399,6 +3399,7 @@ subroutine define_glide_restart_variables(model, model_id)
33993399
! Subroutine arguments
34003400
!------------------------------------------------------------------------------------
34013401
type(glide_global_type), intent (in) :: model !> Derived type holding all model info
3402+
34023403
integer, intent(in) :: model_id !> identifier of this ice sheet instance (1 - N, where N is the total number of ice sheet models in this run)
34033404

34043405
!------------------------------------------------------------------------------------
@@ -3458,7 +3459,7 @@ subroutine define_glide_restart_variables(model, model_id)
34583459
call glide_add_to_restart_variable_list('smb_gradz', model_id)
34593460
end select
34603461

3461-
call glide_add_to_restart_variable_list('smb_reference_usrf', model_id)
3462+
call glide_add_to_restart_variable_list('usrf_ref', model_id)
34623463

34633464
case(SMB_INPUT_FUNCTION_XYZ)
34643465

@@ -3484,7 +3485,7 @@ subroutine define_glide_restart_variables(model, model_id)
34843485
if (options%smb_input_function == SMB_INPUT_FUNCTION_XY_GRADZ) then
34853486
! usrf_ref was added to restart above; nothing to do here
34863487
else
3487-
call glide_add_to_restart_variable_list('smb_reference_usrf', model_id)
3488+
call glide_add_to_restart_variable_list('usrf_ref', model_id)
34883489
endif
34893490

34903491
case(ARTM_INPUT_FUNCTION_XYZ)
@@ -3811,6 +3812,36 @@ subroutine define_glide_restart_variables(model, model_id)
38113812
call glide_add_to_restart_variable_list('f_effecpress_ocean_p', model_id)
38123813
endif
38133814

3815+
! fields needed for inversion options that try to match local thickness or upper surface elevation
3816+
! Note: If usrf_obs is supplied, thck_obs will be computed at initialization
3817+
if (options%which_ho_powerlaw_c == HO_POWERLAW_C_INVERSION .or. &
3818+
options%which_ho_coulomb_c == HO_COULOMB_C_INVERSION .or. &
3819+
options%which_ho_deltaT_ocn == HO_DELTAT_OCN_INVERSION) then
3820+
call glide_add_to_restart_variable_list('usrf_obs', model_id)
3821+
!WHL - velo_sfc_obs is not strictly needed unless inverting for surface velo,
3822+
! but is handy for diagnostics
3823+
call glide_add_to_restart_variable_list('velo_sfc_obs', model_id)
3824+
endif
3825+
3826+
! fields needed for inversion options that try to match local dthck_dt
3827+
! Note: This is not strictly needed for all options, but still is a useful diagnostic.
3828+
if (options%which_ho_deltaT_ocn /= HO_DELTAT_OCN_NONE) then
3829+
call glide_add_to_restart_variable_list('dthck_dt_obs', model_id)
3830+
call glide_add_to_restart_variable_list('dthck_dt_obs_basin', model_id)
3831+
endif
3832+
3833+
! effective pressure options
3834+
! f_effecpress_bwat represents the reduction of overburden pressure from bwatflx
3835+
if (options%which_ho_effecpress == HO_EFFECPRESS_BWATFLX) then
3836+
call glide_add_to_restart_variable_list('f_effecpress_bwat', model_id)
3837+
endif
3838+
3839+
! f_effecpress_ocean_p represents the reduction of overburden pressure when ocean_p > 0
3840+
! Needs to be saved in case this fraction is relaxed over time toward (1 - Hf/H)^p
3841+
if (model%basal_physics%p_ocean_penetration > 0.0d0) then
3842+
call glide_add_to_restart_variable_list('f_effecpress_ocean_p', model_id)
3843+
endif
3844+
38143845
! geothermal heat flux option
38153846
select case (options%gthf)
38163847
case(GTHF_COMPUTE)
@@ -3876,6 +3907,11 @@ subroutine define_glide_restart_variables(model, model_id)
38763907
call glide_add_to_restart_variable_list('glacier_area_init', model_id)
38773908
endif
38783909

3910+
! basal processes module - requires tauf for a restart
3911+
!! if (options%which_bproc /= BAS_PROC_DISABLED ) then
3912+
!! call glide_add_to_restart_variable_list('tauf', model_id)
3913+
!! endif
3914+
38793915
! TODO bmlt was set as a restart variable, but I'm not sure when or if it is needed.
38803916

38813917
! TODO age should be a restart variable if it is an input variable.

libglide/glide_types.F90

+3
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,9 @@ module glide_types
774774
!> (required if restart velocities are nonzero on global boundaries)
775775
!> \end{description}
776776

777+
logical :: forcewrite_restart = .false.
778+
!> flag that indicates whether to force writing of output on restart
779+
777780
! This is a Glimmer serial option
778781
! The parallel code enforces periodic EW and NS boundary conditions by default
779782
logical :: periodic_ew = .false.

libglissade/glissade.F90

+29-7
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,31 @@ subroutine glissade_initialise(model, evolve_ice)
398398
call check_fill_values(model%geometry%dthck_dt_obs)
399399
endif
400400

401+
! Some input fields may have a netCDF fill value, typically a very large positive number.
402+
! If present, convert these values to zero (or optionally, another suitable value).
403+
! Note: Optionally, can pass a user-specified fill value and replacement value,
404+
! and return a mask of grid cells where values are replaced.
405+
! Depending on the input dataset, might have fill values in other fields (e.g., artm, topg)
406+
407+
if (model%options%smb_input == SMB_INPUT_MMYR_WE) then
408+
call check_fill_values(model%climate%smb)
409+
else
410+
call check_fill_values(model%climate%acab)
411+
endif
412+
413+
if (model%options%gthf == GTHF_PRESCRIBED_2D) then
414+
call check_fill_values(model%temper%bheatflx)
415+
endif
416+
417+
if (associated(model%ocean_data%thermal_forcing)) then
418+
call check_fill_values(model%ocean_data%thermal_forcing)
419+
endif
420+
421+
if (model%options%which_ho_deltaT_ocn == HO_DELTAT_OCN_DTHCK_DT .or. &
422+
model%options%enable_acab_dthck_dt_correction) then
423+
call check_fill_values(model%geometry%dthck_dt_obs)
424+
endif
425+
401426
! Allocate mask arrays in case they are needed below
402427
allocate(ice_mask(model%general%ewn, model%general%nsn))
403428
allocate(floating_mask(model%general%ewn, model%general%nsn))
@@ -936,6 +961,7 @@ subroutine glissade_initialise(model, evolve_ice)
936961
! Initialize the effective pressure calculation
937962

938963
if (model%options%is_restart == NO_RESTART) then
964+
939965
call glissade_init_effective_pressure(model%options%which_ho_effecpress, &
940966
model%basal_physics)
941967
endif
@@ -2516,7 +2542,7 @@ subroutine glissade_thickness_tracer_solve(model)
25162542
! a suite of automated stability tests, e.g. with the stabilitySlab.py script.
25172543
if (advective_cfl > 1.0d0) then
25182544
if (main_task) print*, 'advective CFL violation; call glide_finalise and exit cleanly'
2519-
call glide_finalise(model)
2545+
call glide_finalise(model, forcewrite_arg=.true.)
25202546
stop
25212547
else
25222548
nsubcyc = model%numerics%subcyc
@@ -4099,11 +4125,7 @@ subroutine glissade_diagnostic_variable_solve(model)
40994125
f_ground_cell_obs, & ! f_ground_cell as a function of thck_obs (instead of current thck)
41004126
f_ground_obs, & ! f_ground as a function of thck_obs (instead of current thck)
41014127
f_flotation_obs, & ! f_flotation_obs as a function of thck_obs (instead of current thck)
4102-
thck_calving_front, & ! effective thickness of ice at the calving front
4103-
powerlaw_c_icegrid ! powerlaw_c on the unstaggered ice grid
4104-
4105-
real(dp), dimension(model%general%ewn, model%general%nsn) :: &
4106-
flow_enhancement_factor_float ! flow enhancement factor for floating ice
4128+
thck_calving_front ! effective thickness of ice at the calving front
41074129

41084130
real(dp) :: &
41094131
dsigma, & ! layer thickness in sigma coordinates
@@ -4327,6 +4349,7 @@ subroutine glissade_diagnostic_variable_solve(model)
43274349

43284350
! Compute the thickness tendency dH/dt from one step to the next (m/s)
43294351
! This tendency is used for coulomb_c and powerlaw_c inversion.
4352+
43304353
if ( (model%options%is_restart == STANDARD_RESTART .or. model%options%is_restart == HYBRID_RESTART) &
43314354
.and. (model%numerics%time == model%numerics%tstart) ) then
43324355
! first call after a restart; do not compute dthck_dt
@@ -4528,7 +4551,6 @@ subroutine glissade_diagnostic_variable_solve(model)
45284551

45294552
endif ! which_ho_flow_enhancement_factor
45304553

4531-
45324554
! If glaciers are enabled, then do various updates:
45334555
! (1) If inverting for mu_star, alpha_snow, or powerlaw_c, then
45344556
! (a) Accumulate the fields needed for the inversion.

libglissade/glissade_basal_traction.F90

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ subroutine calcbeta (whichbabc, &
145145

146146
! variables for Coulomb friction law
147147
real(dp) :: coulomb_c ! Coulomb law friction coefficient (unitless)
148+
real(dp) :: powerlaw_c_const ! power law friction coefficient (Pa m^{-1/3} yr^{1/3})
148149
real(dp) :: lambda_max ! wavelength of bedrock bumps at subgrid scale (m)
149150
real(dp) :: m_max ! maximum bed obstacle slope (unitless)
150151
real(dp) :: m ! exponent m in power law
@@ -210,6 +211,7 @@ subroutine calcbeta (whichbabc, &
210211
basal_physics%coulomb_c_bedmin, &
211212
basal_physics%coulomb_c_bedmax, &
212213
basal_physics%coulomb_c)
214+
213215
endif
214216

215217
! Compute beta based on whichbabc

libglissade/glissade_velo_higher.F90

+1
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ subroutine glissade_velo_higher_solve(model, &
764764
integer :: &
765765
whichbabc, & ! option for basal boundary condition
766766
whichbeta_limit, & ! option to limit beta for grounded ice
767+
which_powerlaw_c, & ! option for powerlaw friction parameter Cp
767768
which_coulomb_c, & ! option for coulomb friction parameter Cc
768769
whichefvs, & ! option for effective viscosity calculation
769770
! (calculate it or make it uniform)

0 commit comments

Comments
 (0)