Skip to content

Commit 11cf96b

Browse files
Add MALI buildnml support for a TF-coupling parameters file
When OCN/GLC coupling is active, MALI requires a separate input file with parameters for the ice-shelf basal melt parameterization. These parameters are specific to each MALI mesh. This commit adds MALI buildnml support for this additional input file if TF coupling is active AND the params file has been set up for a given MALI mesh. For MALI meshes that do not have a param file set up, ice-shelf basal melting will be zero. Note that in the future, these parameters may also be a function of OCN mesh and compset. The needed level of complexity is not yet known, so this logic will be adjusted to accommodate that when the time comes.
1 parent cfd0a1e commit 11cf96b

File tree

1 file changed

+35
-5
lines changed
  • components/mpas-albany-landice/cime_config

1 file changed

+35
-5
lines changed

components/mpas-albany-landice/cime_config/buildnml

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def buildnml(case, caseroot, compname):
6161
decomp_prefix = ''
6262
datamode_date = ''
6363
region_mask_date = ''
64+
tf_params_date = ''
6465

6566
if glc_grid == 'mpas.aisgis20km':
6667
grid_date += '20190326'
@@ -79,12 +80,14 @@ def buildnml(case, caseroot, compname):
7980
decomp_date += '240507'
8081
decomp_prefix += 'mpasli.graph.info.'
8182
region_mask_date += '20231222'
83+
tf_params_date += '20250724'
8284
elif glc_grid == 'mpas.ais4to20km':
8385
grid_date += '20250625'
8486
grid_prefix += 'ais_4to20km'
8587
decomp_date += '240507'
8688
decomp_prefix += 'mpasli.graph.info.'
8789
region_mask_date += '20230105'
90+
tf_params_date += '20250724'
8891
elif glc_grid == 'mpas.gis20km':
8992
grid_date += '20210824'
9093
grid_prefix += 'gis_20km_r01'
@@ -129,6 +132,20 @@ def buildnml(case, caseroot, compname):
129132
if region_mask_date != '':
130133
region_mask_file = f"{din_loc_root}/glc/mpasli/{glc_grid}/{grid_prefix}_region_mask.{region_mask_date}.nc"
131134

135+
#------------------------
136+
# Set TF param file if needed
137+
# It is only activated if TF-based ocean coupling is on AND
138+
# a param. file has been set up for MALI mesh being used.
139+
# Note: in the future, we will likely need to make the params file
140+
# a function of also the OCN mesh and compset being used, as they will
141+
# require different deltaT bias-correction fields.
142+
# It is unclear at this point what level of complexity is required,
143+
# so nothing is implemented yet.
144+
#------------------------
145+
tf_params_file = ''
146+
if ocn_glc_ismf_coupling == 'tf' and tf_params_date != '':
147+
tf_params_file = f"{din_loc_root}/glc/mpasli/{glc_grid}/{grid_prefix}_tf_params.{tf_params_date}.nc"
148+
132149
#------------------------
133150
# Set the datamode file if needed
134151
#------------------------
@@ -145,6 +162,9 @@ def buildnml(case, caseroot, compname):
145162
if region_mask_date != '':
146163
input_list.write(f"region_mask = {region_mask_file}\n")
147164

165+
if tf_params_file != '':
166+
input_list.write(f"tf_params = {tf_params_file}\n")
167+
148168
if mali_prognostic_mode == 'DATA':
149169
input_list.write(f"datamode = {datamode_file}\n")
150170

@@ -246,11 +266,16 @@ def buildnml(case, caseroot, compname):
246266
lines.append(' input_interval="initial_only"')
247267
lines.append(' output_interval="00-00-00_00:00:01"/>')
248268
lines.append('')
249-
lines.append(' <!--')
250-
lines.append(' output is the main history output stream. You can add auxiliary streams to')
251-
lines.append(' this stream to include more fields.')
252-
lines.append(' -->')
253-
lines.append('')
269+
if tf_params_file != '':
270+
lines.append(' <stream name="tfParamsInput"')
271+
lines.append(' type="input"')
272+
lines.append(' filename_template="{}"'.format(tf_params_file))
273+
lines.append(' input_interval="initial_only">')
274+
lines.append(' <var name="ismip6shelfMelt_basin"/>')
275+
lines.append(' <var name="ismip6shelfMelt_gamma0"/>')
276+
lines.append(' <var name="ismip6shelfMelt_deltaT"/>')
277+
lines.append(' </stream>')
278+
lines.append('')
254279
if region_mask_date != '':
255280
lines.append(' <stream name="regionsInput"')
256281
lines.append(' type="input"')
@@ -259,6 +284,11 @@ def buildnml(case, caseroot, compname):
259284
lines.append(' <var name="regionCellMasks"/>')
260285
lines.append(' </stream>')
261286
lines.append('')
287+
lines.append(' <!--')
288+
lines.append(' output is the main history output stream. You can add auxiliary streams to')
289+
lines.append(' this stream to include more fields.')
290+
lines.append(' -->')
291+
lines.append('')
262292
lines.append(' <stream name="output"')
263293
lines.append(' type="output"')
264294
lines.append(' filename_template="{}.mali.hist.$Y-$M-$D_$S.nc"'.format(casename))

0 commit comments

Comments
 (0)