Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MALI data mode #6945

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@
"ERS_Ld5.T62_oQU240wLI.GMPAS-DIB-IAF-DISMF",
"PEM_Ln5.T62_oQU240wLI.GMPAS-DIB-IAF-DISMF",
"PET_Ln5.T62_oQU240wLI.GMPAS-DIB-IAF-DISMF",
"ERS_Ld5.TL319_oQU240wLI_ais8to30.GMPAS-JRA1p5-DIB-PISMF-DIS.mpaso-ocn_glcshelf",
"ERS_Ld5.TL319_oQU240wLI_ais8to30.GMPAS-JRA1p5-DIB-PISMF-SIS.mpaso-ocn_glcshelf",
)
},

Expand Down Expand Up @@ -189,7 +191,7 @@
"ERS.ne4pg2_oQU480.F2010.eam-p3"
)
},

"e3sm_orodrag_developer" : {
"tests" : (
"ERP.ne4pg2_oQU480.F2010.eam-orodrag_ne4pg2",
Expand Down
66 changes: 46 additions & 20 deletions components/mpas-albany-landice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OPTIONS
-inst_string inst_string variable
-ntasks_glc NTASKS_GLC for this case
-ninst_glc NINST_GLC for this case
-mali_dynamic turns on dynamic ice sheet mode
-mali_prognostic_mode whether MALI should be prognostic, static, or data
Options are: FALSE, TRUE

NOTE: The precedence for setting the values of namelist variables is (highest to lowest):
Expand Down Expand Up @@ -99,7 +99,7 @@ my %opts = ( help => 0,
cfg_dir => $cfgdir,
ntasks_glc => 0,
ninst_glc => 0,
mali_dynamic => undef,
mali_prognostic_mode => undef,
);

GetOptions(
Expand All @@ -118,7 +118,7 @@ GetOptions(
"preview" => \$opts{'preview'},
"ntasks_glc=i" => \$opts{'ntasks_glc'},
"ninst_glc=i" => \$opts{'ninst_glc'},
"mali_dynamic=s" => \$opts{'mali_dynamic'},
"mali_prognostic_mode=s" => \$opts{'mali_prognostic_mode'},

) or usage();

Expand Down Expand Up @@ -153,7 +153,7 @@ my $decomp_date_stamp = $opts{'decomp_date_stamp'};
$cfgdir = $opts{'cfg_dir'};
my $NINST_GLC = $opts{'ninst_glc'};
my $NTASKS_GLC = $opts{'ntasks_glc'};
my $MALI_DYNAMIC = uc($opts{'mali_dynamic'});
my $MALI_PROGNOSTIC_MODE = uc($opts{'mali_prognostic_mode'});

my $CIMEROOT;
if ( defined $opts{'cimeroot'} ) {
Expand Down Expand Up @@ -410,7 +410,7 @@ my $LID = $ENV{'LID'};
my $ntasks = $NTASKS_GLC / $NINST_GLC;

print "MALI build-namelist: glc_grid is $GLC_GRID \n";
print "MALI build-namelist: MALI_DYNAMIC is $MALI_DYNAMIC \n";
print "MALI build-namelist: MALI_PROGNOSTIC_MODE is $MALI_PROGNOSTIC_MODE \n";
print "MALI build-namelist: MALI_USE_ALBANY is $MALI_USE_ALBANY \n";

(-d $DIN_LOC_ROOT) or mkdir $DIN_LOC_ROOT;
Expand All @@ -427,7 +427,7 @@ if ($MALI_USE_ALBANY eq 'TRUE') {
# Namelist group: velocity_solver #
###################################

if ($MALI_DYNAMIC eq 'TRUE') {
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_velocity_solver', 'mali_use_albany'=>"$MALI_USE_ALBANY");
} else {
add_default($nl, 'config_velocity_solver', 'val'=>"none");
Expand All @@ -446,14 +446,11 @@ add_default($nl, 'config_effective_pressure_max');
# Namelist group: advection #
#############################

if ($MALI_DYNAMIC eq 'TRUE') {
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_thickness_advection');
} else {
add_default($nl, 'config_thickness_advection', 'val'=>"none");
}
if ($MALI_DYNAMIC eq 'TRUE') {
add_default($nl, 'config_tracer_advection');
} else {
add_default($nl, 'config_thickness_advection', 'val'=>"none");
add_default($nl, 'config_tracer_advection', 'val'=>"none");
}
add_default($nl, 'config_horiz_tracer_adv_order');
Expand All @@ -474,7 +471,7 @@ add_default($nl, 'config_SLM_to_MALI_weights_file');
# Namelist group: calving #
###########################

if ($MALI_DYNAMIC eq 'TRUE') {
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_calving');
} else {
add_default($nl, 'config_calving', 'val'=>"none");
Expand All @@ -491,8 +488,13 @@ add_default($nl, 'config_data_calving');
add_default($nl, 'config_calving_timescale');
add_default($nl, 'config_restore_calving_front');
add_default($nl, 'config_restore_calving_front_prevent_retreat');
add_default($nl, 'config_remove_icebergs');
add_default($nl, 'config_remove_small_islands');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_remove_icebergs');
add_default($nl, 'config_remove_small_islands');
} else {
add_default($nl, 'config_remove_icebergs', 'val'=>".false.");
add_default($nl, 'config_remove_small_islands', 'val'=>".false.");
}
add_default($nl, 'config_calving_speed_limit');
add_default($nl, 'config_grounded_von_Mises_threshold_stress');
add_default($nl, 'config_floating_von_Mises_threshold_stress');
Expand All @@ -517,7 +519,11 @@ add_default($nl, 'config_update_velocity_before_calving');
# Namelist group: thermal_solver #
##################################

add_default($nl, 'config_thermal_solver');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_thermal_solver');
} else {
add_default($nl, 'config_thermal_solver', 'val'=>"none");
}
add_default($nl, 'config_thermal_calculate_bmb');
add_default($nl, 'config_temperature_init');
add_default($nl, 'config_thermal_thickness');
Expand All @@ -533,7 +539,11 @@ add_default($nl, 'config_max_water_fraction');
# Namelist group: iceshelf_melt #
#################################

add_default($nl, 'config_basal_mass_bal_float');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_basal_mass_bal_float');
} else {
add_default($nl, 'config_basal_mass_bal_float', 'val'=>"none");
}
add_default($nl, 'config_bmlt_float_flux');
add_default($nl, 'config_bmlt_float_xlimit');
add_default($nl, 'config_basal_mass_bal_seroussi_amplitude');
Expand All @@ -551,7 +561,11 @@ add_default($nl, 'config_temperature_profile_variability_amplitude');
add_default($nl, 'config_temperature_profile_variability_period');
add_default($nl, 'config_temperature_profile_variability_phase');
add_default($nl, 'config_temperature_profile_GL_depth_fraction');
add_default($nl, 'config_front_mass_bal_grounded');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_front_mass_bal_grounded');
} else {
add_default($nl, 'config_front_mass_bal_grounded', 'val'=>"none");
}
add_default($nl, 'config_use_3d_thermal_forcing_for_face_melt');
add_default($nl, 'config_beta_ocean_thermal_forcing');
add_default($nl, 'config_add_ocean_thermal_forcing');
Expand Down Expand Up @@ -579,11 +593,19 @@ add_default($nl, 'config_dynamic_thickness');
# Namelist group: time_integration #
####################################

add_default($nl, 'config_dt');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_dt');
} else {
add_default($nl, 'config_dt', 'val'=>"0000-00-01_00:00:00");
}
add_default($nl, 'config_time_integration');
add_default($nl, 'config_rk_order');
add_default($nl, 'config_rk3_stages');
add_default($nl, 'config_adaptive_timestep');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_adaptive_timestep');
} else {
add_default($nl, 'config_adaptive_timestep', 'val'=>".false.");
}
add_default($nl, 'config_min_adaptive_timestep');
add_default($nl, 'config_max_adaptive_timestep');
add_default($nl, 'config_adaptive_timestep_CFL_fraction');
Expand Down Expand Up @@ -651,7 +673,11 @@ add_default($nl, 'config_check_tracer_monotonicity');
# Namelist group: subglacial_hydro #
####################################

add_default($nl, 'config_SGH');
if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_SGH');
} else {
add_default($nl, 'config_SGH', 'val'=>".false.");
}
add_default($nl, 'config_ocean_connection_N');
add_default($nl, 'config_SGH_adaptive_timestep_fraction');
add_default($nl, 'config_SGH_max_adaptive_timestep');
Expand Down
26 changes: 24 additions & 2 deletions components/mpas-albany-landice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def buildnml(case, caseroot, compname):
run_refdate = case.get_value("RUN_REFDATE")
run_reftod = case.get_value("RUN_REFTOD")
mali_use_albany = case.get_value("MALI_USE_ALBANY")
mali_dynamic = case.get_value("MALI_DYNAMIC")
mali_prognostic_mode = case.get_value("MALI_PROGNOSTIC_MODE")
stream_name = 'streams.landice'
albany_input_name = 'albany_input.yaml'

Expand All @@ -56,6 +56,7 @@ def buildnml(case, caseroot, compname):
grid_prefix = ''
decomp_date = ''
decomp_prefix = ''
datamode_date = ''

if glc_grid == 'mpas.aisgis20km':
grid_date += '20190326'
Expand All @@ -70,6 +71,7 @@ def buildnml(case, caseroot, compname):
elif glc_grid == 'mpas.ais8to30km':
grid_date += '20221027'
grid_prefix += 'ais_8to30km'
datamode_date += '20250121'
decomp_date += '240507'
decomp_prefix += 'mpasli.graph.info.'
elif glc_grid == 'mpas.ais4to20km':
Expand Down Expand Up @@ -108,12 +110,20 @@ def buildnml(case, caseroot, compname):
if not os.path.exists(restart_file):
safe_copy(input_file, restart_file)

#------------------------
# Set the datamode file if needed
#------------------------
if mali_prognostic_mode == 'DATA':
datamode_file = f"{din_loc_root}/glc/mpasli/{glc_grid}/{grid_prefix}_datamode.{datamode_date}.nc"

#--------------------------------------------------------------------
# Generate input data file with stream-specified files
#--------------------------------------------------------------------

with open(os.path.join(casebuild, "mali.input_data_list"), "w") as input_list:
input_list.write("mesh = {}/glc/mpasli/{}/{}.{}.nc\n".format(din_loc_root, glc_grid, grid_prefix, grid_date))
if mali_prognostic_mode == 'DATA':
input_list.write(f"datamode = {datamode_file}\n")

#--------------------------------------------------------------------
# Invoke mpas build-namelist - output will go in $CASEBUILD/maliconf
Expand Down Expand Up @@ -160,7 +170,7 @@ def buildnml(case, caseroot, compname):
sysmod += " -glc_grid '{}'".format(glc_grid)
sysmod += " -ntasks_glc '{}'".format(ntasks_glc)
sysmod += " -ninst_glc '{}'".format(ninst_glc_real)
sysmod += " -mali_dynamic '{}'".format(mali_dynamic)
sysmod += " -mali_prognostic_mode '{}'".format(mali_prognostic_mode)

run_cmd_no_fail(sysmod, from_dir=maliconf_dir)

Expand Down Expand Up @@ -288,6 +298,18 @@ def buildnml(case, caseroot, compname):

lines.append('</stream>')
lines.append('')
if mali_prognostic_mode == 'DATA':
# in MALI data mode, read an input stream with ice thickness monthly
lines.append(' <stream name="data-mode-input"')
lines.append(' type="input"')
lines.append(f' filename_template="{datamode_file}"')
lines.append(' reference_time="2000-01-01_00:00:00"')
lines.append(' input_interval="0000-01-00_00:00:00">')
lines.append('')
lines.append(' <var name="thickness"/>')
lines.append('')
lines.append('</stream>')
lines.append('')
lines.append('<!--')
lines.append('All streams below this line are auxiliary streams. They are provided as')
lines.append('groupings of fields that one might be interested in. You can either enable the')
Expand Down
15 changes: 9 additions & 6 deletions components/mpas-albany-landice/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,19 @@
Albany.</desc>
</entry>

<entry id="MALI_DYNAMIC">
<type>logical</type>
<valid_values>TRUE,FALSE</valid_values>
<default_value>TRUE</default_value>
<entry id="MALI_PROGNOSTIC_MODE">
<type>char</type>
<valid_values>PROGNOSTIC,STATIC,DATA</valid_values>
<default_value>PROGNOSTIC</default_value>
<values>
<value compset="_MALI%.*STATIC">FALSE</value>
<value compset="_MALI%.*STATIC">STATIC</value>
<value compset="_MALI%.*DATA">DATA</value>
</values>
<group>case_comp</group>
<file>env_case.xml</file>
<desc>FALSE implies MALI will be run in a static mode </desc>
<desc>PROGNOSTIC runs the prognostic MALI model.
STATIC maintains the initial MALI state over time.
DATA updates ice thickness from an input file at a specified frequency.</desc>
</entry>

<entry id="GLC_SMB">
Expand Down
20 changes: 10 additions & 10 deletions components/mpas-ocean/cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@
<lname>2000_DATM%JRA-1p4-2018_SLND_MPASSI%DIB_MPASO%IBDISMFDATMFORCED_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
</compset>

<compset>
<alias>GMPAS-JRA1p5-DIB-PISMF-DIS</alias>
xylar marked this conversation as resolved.
Show resolved Hide resolved
<lname>2000_DATM%JRA-1p5_SLND_MPASSI%DIB_MPASO%IBPISMFDATMFORCED_DROF%JRA-1p5_MALI%DATA_SWAV</lname>
</compset>

<compset>
<alias>GMPAS-JRA1p5-DIB-PISMF-SIS</alias>
<lname>2000_DATM%JRA-1p5_SLND_MPASSI%DIB_MPASO%IBPISMFDATMFORCED_DROF%JRA-1p5_MALI%SIASTATIC_SWAV</lname>
Comment on lines +156 to +157
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewhoffman, are you good with the SIS name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xylar , yes, I like the SIS name in the compset, and I agree the GLC component should use the %SIASTATIC variant.

</compset>

<compset>
<alias>GMPAS-IAF-PISMF</alias>
<lname>2000_DATM%IAF_SLND_MPASSI_MPASO%PISMFDATMFORCED_DROF%IAF_SGLC_SWAV</lname>
Expand Down Expand Up @@ -187,16 +197,6 @@
<lname>2000_DATM%IAF_SLND_MPASSI%DIB_MPASO%IBDISMFDATMFORCED_DROF%IAF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>GMPAS-MALI-DIB-IAF-DISMF</alias>
<lname>2000_DATM%IAF_SLND_MPASSI%DIB_MPASO%IBDISMFCOREFORCED_DROF%IAF_MALI%SIASTATIC_SWAV</lname>
</compset>

<compset>
<alias>GMPAS-MALI-DIB-IAF-DISMF</alias>
<lname>2000_DATM%IAF_SLND_MPASSI%DIB_MPASO%IBDISMFCOREFORCED_DROF%IAF_MALI%SIASTATIC_SWAV</lname>
</compset>

<compset>
<alias>GMPAS-OECO-IAF</alias>
<lname>2000_DATM%IAF_SLND_MPASSI_MPASO%OECO_DROF%IAF_SGLC_SWAV</lname>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
./xmlchange DATM_CLMNCEP_YR_START=1958
./xmlchange DATM_CLMNCEP_YR_END=1958
./xmlchange DROF_STRM_YR_START=1958
./xmlchange DROF_STRM_YR_END=1958
./xmlchange DATM_CLMNCEP_YR_ALIGN=2000
./xmlchange DROF_STRM_YR_ALIGN=2000
./xmlchange RUN_STARTDATE="2000-01-01"
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
config_land_ice_flux_mode = 'coupled'
config_check_ssh_consistency = .false.
Loading