Repository navigation
Write the reorganized CISM config file (R1) - #162
Open
whlipscomb wants to merge 12 commits into
Open
whlipscomb wants to merge 12 commits into
whlipscomb wants to merge 12 commits into
Conversation
CISM now reads its calving options and parameters from a [calving] section of the config file (ESCOMP/CISM lipscomb/config_reorg_r1). Move the 18 calving variables to a new namelist group, calving, which buildnml writes as the [calving] section. Two variables are renamed to match CISM: marine_margin -> calving_law which_ho_calving_front -> subgrid_calving_front Default values are unchanged. Users with these variables in user_nl_cism need the new names; the CISM script utils/config_reorg/convert_cism_config.py converts user_nl_cism files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads remove_ice_caps and force_retreat from a new [removal] section of the config file (CISM commit 065597d6). Move both namelist variables to a new namelist group, removal (category cism_config_removal), and have buildnml write the [removal] section after [calving]. This also fixes a bug: force_retreat was written to the [options] section, but CISM read it from [ho_options], so a user setting never reached CISM. The default is 0 in both CISM and the wrapper, so answers do not change. Also replace the force_retreat description, which described a different option (masking SMB outside the present-day grid). Testing: subset_stage2_alpha11e.txt (6 tests) vs alpha11e_stage1, with source_cism at CISM 065597d6: 5 tests BFB (the fractional ERS_Ly5 test is deferred to the full aux_glc at the end of R1); NLCOMP differs as expected (config sections); [removal] is in each CaseDocs cism config; no unused-key warnings for the removal keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads its surface climate options and parameters from a new [climate] section of the config file (CISM commit 5e163286). Move the 16 corresponding namelist variables to a new namelist group, climate (category cism_config_climate), and have buildnml write the [climate] section before [calving]: smb_input, smb_input_function, artm_input_function, enable_smb_anomaly, enable_artm_anomaly, enable_snow_anomaly, enable_precip_anomaly, enable_acab_dthck_dt_correction, block_inception, t_lapse, degree_factor, smb_factor, smb_anomaly_tstart, smb_anomaly_timescale, artm_anomaly_tstart, artm_anomaly_timescale This also fixes a bug: degree_factor, smb_factor, smb_anomaly_tstart, smb_anomaly_timescale, artm_anomaly_tstart and artm_anomaly_timescale were written to [options], but CISM read them from [parameters], so user settings never reached CISM. The wrapper defaults equal the CISM defaults, so answers do not change. tmlt, snow_threshold_min and snow_threshold_max are left for now: the wrapper versions are the glacier parameters, which will be renamed with a glacier_ prefix later in R1. Testing: tested at the end of this batch (see the grounding_line and basal_hydro commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads its sliding-law options and basal friction parameters from a new [basal_physics] section of the config file (CISM commit e1e3abb7), with seven of the wrapper's keys renamed: which_ho_babc -> sliding_law which_ho_beta_limit -> beta_limit_method which_ho_powerlaw_c -> powerlaw_c_method which_ho_coulomb_c -> coulomb_c_method which_ho_effecpress -> effecpress_method basal_tract_const -> btrc_const ho_beta_const -> beta_const Move these and 22 other namelist variables (elevation_based_coulomb_c, beta_grounded_min, the powerlaw_c_*, coulomb_c_*, schoof_* and pseudo_plastic_q/u0 parameters, powerlaw_m, beta_powerlaw_umax, zoet_iverson_ut, zoet_iverson_nmax, p_ocean_penetration) to a new namelist group, basal_physics (category cism_config_basal_physics), and have buildnml write the [basal_physics] section before [climate]. The renamed keys are also updated in the descriptions of other variables, in the gris_powerlaw testmod (user_nl_cism and README) and in a testlist comment. Users must rename these keys in user_nl_cism; CISM's utils/config_reorg/convert_cism_config.py --user-nl does this. This also fixes a bug: CISM read zoet_iversion_ut and zoet_iversion_nmax (misspelled), so the wrapper's zoet_iverson_ut and zoet_iverson_nmax never reached CISM. The wrapper defaults equal the CISM defaults, so answers do not change. Testing: tested at the end of this batch (see the grounding_line and basal_hydro commit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads its grounding-line options from a new [grounding_line] section and its basal water switch from [basal_hydro] (CISM commit f3c02a9d), with new names: which_ho_ground -> grounding_line_param which_ho_ground_bmlt -> grounding_line_bmlt which_ho_flotation_function -> flotation_function which_ho_bwat -> bwat_method ho_flux_routing_scheme -> flux_routing_method Move the first three to a new namelist group, grounding_line (category cism_config_grounding_line), and bwat_method to the basal_hydro group. Give all basal_hydro entries the category cism_config_basal_hydro (it was cism_config_ho_options), and have buildnml write the [basal_hydro] and [grounding_line] sections after [basal_physics]. The gris_powerlaw testmod and the descriptions of other variables use the new names. This also fixes a bug: the basal_hydro group was never written to the config file (it was missing from _CISM_CONFIG_GROUPS), so its ten namelist variables never reached CISM. The wrapper defaults equal the CISM defaults, so answers do not change. One of them, btemp_scale, is not a CISM key (CISM has btemp_flow_scale and btemp_freeze_scale), so CISM now warns that it is unused; to be resolved separately. Testing: subset_r1_batch.txt (5 tests) vs alpha11e_stage1, with this commit and the climate and basal_physics commits: all BFB; NLCOMP differs as expected (config sections); [climate], [basal_physics], [grounding_line] and [basal_hydro] are in each CaseDocs cism config, with no unused-key warnings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads its basal melt options and parameters from a new
[basal_melt] section and its ocean data from a new [ocean_data] section
of the config file (CISM commit 9c3cf0b3), with two keys renamed:
bmlt_float -> bmlt_float_method
which_ho_deltaT_ocn -> deltaT_ocn_method
Move the 19 corresponding namelist variables to two new namelist groups
(categories cism_config_basal_melt and cism_config_ocean_data), and have
buildnml write the two sections after [grounding_line]:
basal_melt: bmlt_float_method, bmlt_float_thermal_forcing_param,
bmlt_float_init, deltaT_ocn_method, enable_bmlt_anomaly,
basal_mass_balance, bmlt_cavity_h0, bmlt_float_h0, and the seven
bmlt_float_depth_* parameters
ocean_data: ocean_data_domain, ocean_data_extrapolate, gamma0,
thermal_forcing_basin_min
The descriptions of the bmlt_float_depth_* parameters now name the
renamed option.
Also remove two namelist variables that CISM never reads:
bmlt_float_ismip6_magnitude and enable_thermal_forcing_anomaly. Setting
them in user_nl_cism had no effect; now it is an error. Answers do not
change.
Testing: tested at the end of R1 (see the commit that writes the isostasy,
lateral melt and glacier sections) and with the full aux_glc suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…groups
CISM now reads its velocity options from a new [velocity] section and
its velocity-solver options from a new [velocity_solver] section of the
config file (CISM commit bc05eedb), with thirteen keys renamed. Move the
17 corresponding namelist variables to two new namelist groups
(categories cism_config_velocity and cism_config_velocity_solver), and
have buildnml write the two sections before [basal_physics]:
velocity:
which_ho_approx -> stokes_approx
which_ho_efvs -> efvs_method
which_ho_gradient -> surface_gradient_method
which_ho_gradient_margin -> surface_gradient_margin_method
diva_slope_correction, effstrain_min, max_slope (names unchanged)
velocity_solver:
which_ho_nonlinear -> nonlinear_method
which_ho_resid -> nonlinear_residual
glissade_maxiter -> nonlinear_maxiters
which_ho_sparse -> linear_solver
which_ho_precond -> preconditioner
which_ho_assemble_beta -> assemble_beta
which_ho_assemble_taud -> assemble_taud
which_ho_assemble_bfric -> assemble_bfric
which_ho_assemble_lateral -> assemble_lateral
linear_solve_ncheck (name unchanged)
The gris_powerlaw testmod sets nonlinear_maxiters instead of
glissade_maxiter. Answers do not change.
Testing: tested at the end of R1 (see the commit that writes the isostasy,
lateral melt and glacier sections) and with the full aux_glc suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to new groups
CISM now reads its advection, flow-law and temperature options from new
[advection], [flow_law] and [temperature] sections of the config file
(CISM commit 479c34ae), with four of the wrapper's keys renamed. Move the
11 corresponding namelist variables to three new namelist groups
(categories cism_config_advection, cism_config_flow_law and
cism_config_temperature), and have buildnml write the three sections
after [velocity_solver]:
advection: evolution -> advection_method
flow_law: flow_law, n_glen, flow_factor_ground, flow_factor_float,
default_flwa (names unchanged)
temperature: temperature -> temperature_method,
which_ho_disp -> dissipation_method,
which_ho_thermal_timestep -> thermal_timestep,
temp_init, pmp_offset (names unchanged)
The default_flwa description names temperature_method. Answers do not
change.
Testing: subset_r1_batch.txt at the end of this batch: SMS_D_Ly1 (intel
and gnu) BFB vs alpha11e_stage1; the other three tests were rerun at the
end of R1 (see the commit that writes the isostasy, lateral melt and
glacier sections) and with the full aux_glc suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM now reads its inversion parameters from a new [inversion] section
and its geothermal heat flux settings from a new [geothermal] section of
the config file (CISM commit a7bfb02b). Move the corresponding namelist
variables to two new namelist groups (categories cism_config_inversion
and cism_config_geothermal), and have buildnml write the two sections
after [removal]:
inversion: the 15 inversion parameters
geothermal: gthf -> geothermal_method, geothermal -> geothermal_flux
This fixes a bug: four inversion parameters were written under names
that CISM never read, so CESM runs used the CISM defaults instead of the
wrapper values. They now have the CISM names, and their defaults are set
to the CISM defaults, so answers do not change:
deltaT_basin_relax -> inversion_deltaT_basin_relax (0.0)
inversion_bmlt_basin_flotation_threshold
-> inversion_basin_flotation_threshold
(default 500.0 -> 200.0)
inversion_bmlt_basin_mass_correction
-> inversion_basin_mass_correction
(default 1000.0 -> 0.0)
inversion_bmlt_basin_number_mass_correction
-> inversion_basin_number_mass_correction
(default 9 -> 0)
These values matter only for the basin-scale deltaT_ocn inversion
(deltaT_ocn_method = 3).
Also remove the gthf namelist group (num_dim, nlayer, surft, rock_base,
numt, rho, shc, con) and the conditional [GTHF] section that buildnml
wrote when gthf = 2. These settings belong to the lithosphere heat model
that CISM keeps in Glide but removed from Glissade, which allows only
geothermal_method = 0 or 1; the valid values of geothermal_method are now
0,1.
Testing: tested at the end of R1 (see the commit that writes the isostasy,
lateral melt and glacier sections) and with the full aux_glc suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CISM no longer reads a [parameters] section (CISM commit aa7370e6). Move
the corresponding namelist variables to groups for the new or existing
sections of the config file, and have buildnml write [numerics],
[initialization] and [diagnostics] after [time], and no [parameters]
section:
numerics: compute_blocks, reproducible_sums, ice_limit,
thck_gradient_ramp, periodic_offset_ew,
periodic_offset_ns
initialization: adjust_input_thickness
diagnostics: dm_dt_diag, diag_minthck
grid: read_lat_lon, sigma -> sigma_method
options: log_level
The conditional [sigma] section is now controlled by sigma_method.
Also remove the namelist variables rhoi, rhoo, grav, shci, lhci and trpt.
CISM ignores them in CESM builds, which use the CESM shared constants, so
setting them in user_nl_cism had no effect; now it is an error. Answers
do not change.
Testing: tested at the end of R1 (see the commit that writes the isostasy,
lateral melt and glacier sections) and with the full aux_glc suite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ches
CISM now reads the switches for isostasy, lateral melt and glaciers from
the sections of those features, and has renamed keys in them (CISM
commit d7d4d92f). Move and rename the namelist variables to match:
isostasy: isostasy (from options), which_relaxed -> input_topg_method,
lithosphere -> lithosphere_method,
asthenosphere -> asthenosphere_method
lateral_melt: which_lateral_melt (from ho_options) -> lateral_melt_method
glaciers: enable_glaciers (from options),
snow_threshold_min (from options) -> glacier_snow_threshold_min,
set_mu_star -> mu_star_method,
set_alpha_snow -> alpha_snow_method,
set_powerlaw_c -> glacier_powerlaw_c_method,
snow_calc -> snow_method, tmlt -> glacier_tmlt,
snow_threshold_max -> glacier_snow_threshold_max
A new buildnml function, _add_feature_section_to_cism_config, writes each
of the three sections, with its switch, only when the feature is on
(isostasy = 1, lateral_melt_method > 0, enable_glaciers = .true.). When
the feature is off, the section is left out, so that CISM uses its
default (off), and setting another variable of the group is an error.
The ho_options group is now empty and is no longer written.
This fixes several bugs. buildnml never wrote [glaciers] or
[lateral_melt], which_lateral_melt was written to [ho_options] and
enable_glaciers and the glacier snow_threshold_min to [options], where
CISM did not read them; so glaciers and lateral melt could not be turned
on in CESM. For the glacier options and parameters whose wrapper defaults
differed from CISM's, the wrapper now uses the CISM defaults:
mu_star_method, alpha_snow_method and glacier_powerlaw_c_method 0 (was
1), glacier_snow_threshold_max 2.0 (was 0.0). All three features are off
by default, so answers do not change.
Testing: subset_r1_batch.txt (5 tests) vs alpha11e_stage1, with this
commit and CISM d7d4d92f: all BFB; NLCOMP differs as expected (config
sections); the CISM logs have no unused-key warnings. Full aux_glc suite
(37 tests; NCK_Ly3, a known failure, skipped) vs alpha11e_stage1: all
tests run; all restart, branch and hybrid comparisons pass; all BFB except
ERI_Ly10, whose baseline is incomplete. preview_namelists with isostasy,
lateral melt and glaciers turned on writes each section with its switch;
setting a glacier key with glaciers off is an error.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e_scale The wrapper wrote btemp_scale to [basal_hydro], but CISM has no such key; the flux-routing basal water scheme (bwat_method = 3) has two temperature scales instead: btemp_flow_scale, to route water away from cells with a frozen bed, and btemp_freeze_scale, to refreeze water beneath them. Setting btemp_scale in user_nl_cism had no effect. Remove btemp_scale and add btemp_flow_scale and btemp_freeze_scale to the basal_hydro group, each with the CISM default 0.0. Answers do not change. Testing: preview_namelists in an ERS_Ly3 gris4 case: the CISM config differs only in btemp_scale = 0.0 being replaced by btemp_flow_scale = 0.0 and btemp_freeze_scale = 0.0 in [basal_hydro]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch:
lipscomb/config_reorg_r1Base:
lipscomb/split_glide_glissade_2(#161). Stacked; the base will be changed tomasterafter the earlier PRs are merged.Matching CISM PR: ESCOMP/CISM#105 (R1, branch
lipscomb/config_reorg_r1).source_cismshould point to the CISM tag that includes it.Summary
CISM now reads its options from short sections by physics instead of
[options],[ho_options]and[parameters], and 57 keys are renamed (see the CISM PR for the full list). This PR moves the CISM namelist variables into matching namelist groups, renames them like the CISM keys, and hasbuildnmlwrite the new sections. Each commit mirrors one CISM commit.For CESM users,
user_nl_cismfiles that set renamed keys must be updated; the CISM script does it ($CISMROOTis the CISM source directory, e.g.components/cism/source_cismin a CESM checkout):Along the way, several wrapper bugs were fixed, all bit-for-bit for current runs:
degree_factor,smb_factor,smb_anomaly_*andartm_anomaly_*(written to[options], read from[parameters]);which_lateral_melt(written to[ho_options]),enable_glaciersand the glaciersnow_threshold_min(written to[options]).zoet_iversion_*(CISM:zoet_iverson_*);btemp_scale, replaced by CISM's two flux-routing temperature scalesbtemp_flow_scaleandbtemp_freeze_scale(default 0.0, as in CISM); and four basin-inversion parameters (deltaT_basin_relax,inversion_bmlt_basin_*). They now have the CISM names, and their defaults are the CISM defaults that CESM runs were actually using.basal_hydro,glaciers,lateral_melt.[isostasy],[lateral_melt]and[glaciers]are now written, with their switch, only when the feature is on (new function_add_feature_section_to_cism_config); setting a variable of the group while the feature is off is an error. Glaciers and lateral melt can now be turned on in CESM. The glacier options use the CISM defaults.bmlt_float_ismip6_magnitude,enable_thermal_forcing_anomaly, thegthfgroup (the lithosphere heat model, which is Glide-only) and the physical constantsrhoi,rhoo,grav,shci,lhci,trpt(CESM uses its shared constants). Setting them inuser_nl_cismhad no effect; now it is an error.Commits
nonlinear_maxiters)btemp_scalereplaced bybtemp_flow_scaleandbtemp_freeze_scaleAnswer changes
None.
Testing
All on derecho, with
source_cismat the matching CISM commit.preview_namelistsafter each commit: every moved variable keeps its value; the config differs only by section and by the renamed and removed keys. For the last commit, also with isostasy, lateral melt and glaciers turned on (each section is written with its switch) and with a glacier key set while glaciers are off (error).aux_glcsuite at the tip (37 tests;NCK_Ly3skipped), against thealpha11e_stage1baseline (cismwrap_3_00_003): all tests run, all restart/branch/hybrid comparisons pass, all bit-for-bit exceptERI_Ly10, whose baseline is incomplete. NLCOMP differs as expected. The CISM logs have no unused-key warnings.🤖 Generated with Claude Code