Skip to content
Merged
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
10 changes: 10 additions & 0 deletions components/mpas-albany-landice/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ OPTIONS
-ocn_glc_ismf_coupling methods for ocn/glc ice-shelf melt flux coupling
['none' | 'data_mpaso' | 'data_mali' | 'internal_mpaso' |
'tf' | 'coupler']
-glc_two_way_coupling whether GLC is coupled to LND: FALSE, TRUE

NOTE: The precedence for setting the values of namelist variables is (highest to lowest):
1. namelist values set by specific command-line options, i.e. (none right now)
Expand Down Expand Up @@ -106,6 +107,7 @@ my %opts = ( help => 0,
mali_prognostic_mode => undef,
glc_nzoc => 0,
ocn_glc_ismf_coupling => undef,
glc_two_way_coupling => undef,
);

GetOptions(
Expand All @@ -127,6 +129,7 @@ GetOptions(
"mali_prognostic_mode=s" => \$opts{'mali_prognostic_mode'},
"glc_nzoc=i" => \$opts{'glc_nzoc'},
"ocn_glc_ismf_coupling=s" => \$opts{'ocn_glc_ismf_coupling'},
"glc_two_way_coupling=s" => \$opts{'glc_two_way_coupling'},

) or usage();

Expand Down Expand Up @@ -164,6 +167,7 @@ my $NTASKS_GLC = $opts{'ntasks_glc'};
my $MALI_PROGNOSTIC_MODE = uc($opts{'mali_prognostic_mode'});
my $GLC_NZOC = $opts{'glc_nzoc'};
my $OCN_GLC_ISMF_COUPLING = $opts{'ocn_glc_ismf_coupling'};
my $GLC_TWO_WAY_COUPLING = $opts{'glc_two_way_coupling'};

my $CIMEROOT;
if ( defined $opts{'cimeroot'} ) {
Expand Down Expand Up @@ -425,6 +429,7 @@ print "MALI build-namelist: MALI_PROGNOSTIC_MODE is $MALI_PROGNOSTIC_MODE \n";
print "MALI build-namelist: MALI_USE_ALBANY is $MALI_USE_ALBANY \n";
print "MALI build-namelist: GLC_NZOC is $GLC_NZOC \n";
print "MALI build-namelist: OCN_GLC_ISMF_COUPLING is $OCN_GLC_ISMF_COUPLING \n";
print "MALI build-namelist: GLC_TWO_WAY_COUPLING is $GLC_TWO_WAY_COUPLING \n";

(-d $DIN_LOC_ROOT) or mkdir $DIN_LOC_ROOT;
if ($print>=2) { print "CESM inputdata root directory: $DIN_LOC_ROOT$eol"; }
Expand Down Expand Up @@ -469,6 +474,11 @@ if ($MALI_PROGNOSTIC_MODE eq 'PROGNOSTIC') {
add_default($nl, 'config_horiz_tracer_adv_order');
add_default($nl, 'config_advection_coef_3rd_order');
add_default($nl, 'config_restore_thickness_after_advection');
if ($GLC_TWO_WAY_COUPLING eq 'True') {
add_default($nl, 'config_smb_source');
} else {
add_default($nl, 'config_smb_source', 'val'=>"file");
}
add_default($nl, 'config_zero_sfcMassBalApplied_over_bare_land');

##############################
Expand Down
1 change: 1 addition & 0 deletions components/mpas-albany-landice/bld/build-namelist-section
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ add_default($nl, 'config_tracer_advection');
add_default($nl, 'config_horiz_tracer_adv_order');
add_default($nl, 'config_advection_coef_3rd_order');
add_default($nl, 'config_restore_thickness_after_advection');
add_default($nl, 'config_smb_source');
add_default($nl, 'config_zero_sfcMassBalApplied_over_bare_land');

##############################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<config_horiz_tracer_adv_order>3</config_horiz_tracer_adv_order>
<config_advection_coef_3rd_order>0.25</config_advection_coef_3rd_order>
<config_restore_thickness_after_advection>.false.</config_restore_thickness_after_advection>
<config_smb_source>'coupler'</config_smb_source>
<config_zero_sfcMassBalApplied_over_bare_land>.true.</config_zero_sfcMassBalApplied_over_bare_land>

<!-- solidearth -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ Valid values: .true. or .false.
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_smb_source" type="char*1024"
category="advection" group="advection">
Source of surface mass balance used by sfcMassBal variable. 'file' uses whatever value has been read into the sfcMassBal field from an input or forcing file. 'coupler' uses a value passed from the E3SM coupler. The option 'coupler' behaves the same as 'file' when MALI is run in standalone mode.

Valid values: 'file' or 'coupler'
Default: Defined in namelist_defaults.xml
</entry>

<entry id="config_zero_sfcMassBalApplied_over_bare_land" type="logical"
category="advection" group="advection">
Mask to zero out sfcMassBalApplied in regions where there is no ice at the timestep.
Expand Down
34 changes: 7 additions & 27 deletions components/mpas-albany-landice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def buildnml(case, caseroot, compname):
mali_prognostic_mode = case.get_value("MALI_PROGNOSTIC_MODE")
glc_nzoc = case.get_value("GLC_NZOC")
ocn_glc_ismf_coupling = case.get_value("OCN_GLC_ISMF_COUPLING")
glc_two_way_coupling = case.get_value("GLC_TWO_WAY_COUPLING")
stream_name = 'streams.landice'
albany_input_name = 'albany_input.yaml'

Expand Down Expand Up @@ -71,13 +72,13 @@ def buildnml(case, caseroot, compname):
decomp_date += '150910'
decomp_prefix += 'mpasli.graph.info.'
elif glc_grid == 'mpas.ais8to30km':
grid_date += '20250411'
grid_date += '20250625'
grid_prefix += 'ais_8to30km'
datamode_date += '20250121'
decomp_date += '240507'
decomp_prefix += 'mpasli.graph.info.'
elif glc_grid == 'mpas.ais4to20km':
grid_date += '20250411'
grid_date += '20250625'
grid_prefix += 'ais_4to20km'
decomp_date += '240507'
decomp_prefix += 'mpasli.graph.info.'
Expand Down Expand Up @@ -180,6 +181,7 @@ def buildnml(case, caseroot, compname):
sysmod += " -mali_prognostic_mode '{}'".format(mali_prognostic_mode)
sysmod += " -glc_nzoc '{}'".format(glc_nzoc)
sysmod += " -ocn_glc_ismf_coupling '{}'".format(ocn_glc_ismf_coupling)
sysmod += " -glc_two_way_coupling '{}'".format(glc_two_way_coupling)

run_cmd_no_fail(sysmod, from_dir=maliconf_dir)

Expand Down Expand Up @@ -240,53 +242,31 @@ def buildnml(case, caseroot, compname):
lines.append(' filename_interval="0001-00-00_00:00:00"')
lines.append(' clobber_mode="truncate"')
lines.append(' output_interval="0000-00-01_00:00:00">')
# Note: if output_interval is less than dt, then multiples of that interval will be checked.
# There is some performance hit for making this too small. For now making it 1 day.
lines.append('')
lines.append(' <stream name="basicmesh"/>')
lines.append(' <var name="xtime"/>')
lines.append(' <var name="layerCenterSigma"/>')
lines.append(' <var name="layerInterfaceSigma"/>')
lines.append(' <var name="thickness"/>')
lines.append(' <var name="bedTopography"/>')
lines.append(' <var name="lowerSurface"/>')
lines.append(' <var name="upperSurface"/>')
lines.append(' <var name="cellMask"/>')
lines.append(' <var name="edgeMask"/>')
lines.append(' <var name="uReconstructX"/>')
lines.append(' <var name="uReconstructY"/>')
lines.append(' <var name="surfaceSpeed"/>')
lines.append(' <var name="basalSpeed"/>')
lines.append(' <var name="sfcMassBal"/>')
lines.append(' <var name="sfcMassBalApplied"/>')
lines.append(' <var name="basalMassBalApplied"/>')
lines.append(' <var name="bareIceAblationApplied"/>')
lines.append(' <var name="avgBareIceAblation"/>')
lines.append(' <var name="avgBareIceAblationApplied"/>')
lines.append(' <var name="floatingBasalMassBal"/>')
lines.append(' <var name="floatingBasalMassBalApplied"/>')
lines.append(' <var name="avgFloatingBMBFlux"/>')
lines.append(' <var name="groundedBasalMassBalApplied"/>')
lines.append(' <var name="calvingThickness"/>')
lines.append(' <var name="avgCalvingFlux"/>')
lines.append(' <var name="avgFaceMeltFlux"/>')
lines.append(' <var name="restoreThickness"/>')
lines.append(' <var name="dHdt"/>')
lines.append(' <var name="ismip6_2dThermalForcing"/>')
lines.append(' <var name="ismip6shelfMelt_3dThermalForcing"/>')
lines.append(' <var name="orig3dOceanMask"/>')
lines.append(' <var name="ismip6shelfMelt_TFdraft"/>')
lines.append(' <var name="ismip6shelfMelt_zOcean"/>')
lines.append(' <var name="ismip6shelfMelt_zBndsOcean"/>')
lines.append(' <var name="faceMeltSpeed"/>')
lines.append(' <var name="faceMeltingThickness"/>')
lines.append(' <var name="ismip6_2dThermalForcing"/>')
lines.append(' <var name="deltat"/>')
lines.append(' <var name="daysSinceStart"/>')
lines.append(' <var name="simulationStartTime"/>')
lines.append(' <var name="allowableDtACFL"/>')
lines.append(' <var name="allowableDtDCFL"/>')
lines.append(' <var name="temperature"/>')
lines.append(' <var name="basalTemperature"/>')
lines.append(' <var name="surfaceTemperature"/>')
lines.append(' <var name="surfaceAirTemperature"/>')
lines.append('')
lines.append('</stream>')
lines.append('')
Expand Down
11 changes: 10 additions & 1 deletion components/mpas-albany-landice/driver/glc_comp_mct.F
Original file line number Diff line number Diff line change
Expand Up @@ -1409,11 +1409,13 @@ subroutine glc_import_mct(x2g_g, errorCode)
real (kind=RKIND), dimension(:,:), pointer :: ismip6shelfMelt_3dThermalForcing
integer, dimension(:,:), pointer :: orig3dOceanMask
real(kind=RKIND), pointer :: config_invalid_value_TF
character(len=StrKIND), pointer :: config_smb_source
real(kind=RKIND) :: fractionalMaskVal

errorCode = 0

call mpas_pool_get_config(domain % configs, 'config_invalid_value_TF', config_invalid_value_TF)
call mpas_pool_get_config(domain % configs, 'config_smb_source', config_smb_source)

n = 0
block => domain % blocklist
Expand Down Expand Up @@ -1443,7 +1445,14 @@ subroutine glc_import_mct(x2g_g, errorCode)
endif
do i = 1, nCellsSolve
n = n + 1
sfcMassBal(i) = x2g_g % rAttr(index_x2g_Flgl_qice, n)
if (trim(config_smb_source) == 'coupler') then
sfcMassBal(i) = x2g_g % rAttr(index_x2g_Flgl_qice, n)
elseif (trim(config_smb_source) == 'file') then
! do nothing, use data read-in from file
else
call mpas_log_write("Unknown value for 'config_smb_source'", MPAS_LOG_ERR)
errorCode = ior(errorCode, 1)
endif
floatingBasalMassBal(i) = x2g_g % rAttr(index_x2g_Fogx_qiceli, n)
if (nISMIP6OceanLayers > 0) then
do iLev = 1, nISMIP6OceanLayers
Expand Down
4 changes: 4 additions & 0 deletions components/mpas-albany-landice/src/Registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
description="If true, reset thickness to values at previous timestep after advection occurs. This is used for spinning up tracer fields such as damage. When this is true, geometry changes from surface and basal mass balance (grounded or floating) and facemelting are not retained, but changes from calving are."
possible_values=".true. or .false."
/>
<nml_option name="config_smb_source" type="character" default_value="file" units="unitless"
description="Source of surface mass balance used by sfcMassBal variable. 'file' uses whatever value has been read into the sfcMassBal field from an input or forcing file. 'coupler' uses a value passed from the E3SM coupler. The option 'coupler' behaves the same as 'file' when MALI is run in standalone mode."
possible_values="'file' or 'coupler'"
/>
<nml_option name="config_zero_sfcMassBalApplied_over_bare_land" type="logical" default_value=".true." units="unitless"
description="Mask to zero out sfcMassBalApplied in regions where there is no ice at the timestep."
possible_values=".true. or .false."
Expand Down