Skip to content

Commit

Permalink
Add datamode input file to list of MALI inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhoffman committed Jan 22, 2025
1 parent 2a21fd9 commit 2989c61
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/mpas-albany-landice/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -110,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 @@ -294,7 +302,7 @@ def buildnml(case, caseroot, compname):
# 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="{din_loc_root}/glc/mpasli/{glc_grid}/{grid_prefix}_datamode.{datamode_date}.nc"')
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('')
Expand Down

0 comments on commit 2989c61

Please sign in to comment.