Skip to content

Commit

Permalink
Merge pull request #76 from mvertens/feature/major_refactor
Browse files Browse the repository at this point in the history
major mosart refactor including addition of new halo capability
  • Loading branch information
slevis-lmwg authored Jun 6, 2024
2 parents 1c22a8c + 2695f36 commit 5acf6b2
Show file tree
Hide file tree
Showing 34 changed files with 8,616 additions and 8,527 deletions.
20 changes: 10 additions & 10 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
#----------------------------------------------------

run_type = case.get_value("RUN_TYPE")
finidat_rtm = str(nmlgen.get_value("finidat_rtm"))
finidat = str(nmlgen.get_value("finidat"))
if run_type == 'branch' or run_type == 'hybrid':
run_refcase = case.get_value("RUN_REFCASE")
run_refdate = case.get_value("RUN_REFDATE")
Expand All @@ -90,17 +90,17 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
filename = "%s.mosart.r.%s-%s.nc" %(run_refcase, run_refdate, run_tod)

if run_type == "hybrid":
nmlgen.add_default("finidat_rtm", value=filename, ignore_abs_path=True)
nmlgen.add_default("finidat", value=filename, ignore_abs_path=True)
else:

nmlgen.add_default("nrevsn_rtm", value=filename)
elif finidat_rtm.strip() == '':
nmlgen.set_value('finidat_rtm', value=' ')
nmlgen.add_default("nrevsn", value=filename)
elif finidat.strip() == '':
nmlgen.set_value('finidat', value=' ')
else:
if nmlgen.get_default('finidat_rtm') == 'UNSET':
nmlgen.add_default('finidat_rtm', value=' ', ignore_abs_path=True)
if nmlgen.get_default('finidat') == 'UNSET':
nmlgen.add_default('finidat', value=' ', ignore_abs_path=True)
else:
nmlgen.add_default("finidat_rtm")
nmlgen.add_default("finidat")

ncpl_base_period = case.get_value('NCPL_BASE_PERIOD')
if ncpl_base_period == 'hour':
Expand Down Expand Up @@ -131,8 +131,8 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path
coupling_period = basedt // mosart_ncpl
nmlgen.set_value("coupling_period", value=coupling_period)

if ( nmlgen.get_value("frivinp_rtm") == "UNSET" and config["mosart_mode"] != "NULL" ):
raise SystemExit("ERROR: Direction file is NOT set and is required when MOSART is active: frivinp_rtm")
if ( nmlgen.get_value("frivinp") == "UNSET" and config["mosart_mode"] != "NULL" ):
raise SystemExit("ERROR: Direction file is NOT set and is required when MOSART is active: frivinp")

bypass_routing_option = nmlgen.get_value("bypass_routing_option")
qgwl_runoff_option = nmlgen.get_value("qgwl_runoff_option")
Expand Down
96 changes: 68 additions & 28 deletions cime_config/namelist_definition_mosart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,6 @@
<!-- MOSART Namelist -->
<!-- ======================================================================================== -->

<entry id="do_rtmflood" modify_via_xml="MOSART_FLOOD_MODE">
<type>logical</type>
<category>mosart</category>
<group>mosart_inparm</group>
<values>
<value mosart_flood_mode="ACTIVE">.true.</value>
<value mosart_flood_mode="NULL">.false.</value>
</values>
<desc>
If .true., turn on mosart flooding back to clm
Note that mosart flood is not supported in CESM1.1
</desc>
</entry>

<entry id="ice_runoff">
<type>logical</type>
<category>mosart</category>
Expand Down Expand Up @@ -74,6 +60,20 @@
</desc>
</entry>

<entry id="use_halo_option">
<type>logical</type>
<category>mosart</category>
<group>mosart_inparm</group>
<values>
<value>.false.</value>
</values>
<desc>
If true, add capability to have halo option for mosart fields.
In particular these can be used to create derivatives using halo values
from neighboring cells.
</desc>
</entry>

<entry id="bypass_routing_option">
<type>char</type>
<category>mosart</category>
Expand Down Expand Up @@ -101,7 +101,7 @@
</desc>
</entry>

<entry id="finidat_rtm" skip_default_entry="true">
<entry id="finidat" skip_default_entry="true">
<type>char</type>
<category>mosart</category>
<group>mosart_inparm</group>
Expand All @@ -110,11 +110,12 @@
<value>UNSET</value>
</values>
<desc>
Full pathname of initial rtm file
Full pathname of initial conditions file. If blank or UNSET Mosart will startup from
cold start initial conditions.
</desc>
</entry>

<entry id="nrevsn_rtm" skip_default_entry="true">
<entry id="nrevsn" skip_default_entry="true">
<type>char</type>
<category>mosart</category>
<group>mosart_inparm</group>
Expand All @@ -126,7 +127,7 @@
</desc>
</entry>

<entry id="frivinp_rtm">
<entry id="frivinp">
<type>char</type>
<category>mosart</category>
<input_pathname>abs</input_pathname>
Expand All @@ -138,11 +139,11 @@
<value rof_grid="0.125nldas2">$DIN_LOC_ROOT/rof/mosart/MOSART_routing_0.125nldas2_cdf5_c200727.nc</value>
</values>
<desc>
Full pathname of input datafile for RTM.
Full pathname of input mosart datafile
</desc>
</entry>

<entry id="rtmhist_fexcl1">
<entry id="fexcl1">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -154,7 +155,7 @@
</desc>
</entry>

<entry id="rtmhist_fexcl2">
<entry id="fexcl2">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -166,7 +167,7 @@
</desc>
</entry>

<entry id="rtmhist_fexcl3">
<entry id="fexcl3">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -178,7 +179,7 @@
</desc>
</entry>

<entry id="rtmhist_fincl1">
<entry id="fincl1">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -190,7 +191,7 @@
</desc>
</entry>

<entry id="rtmhist_fincl2">
<entry id="fincl2">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -202,7 +203,7 @@
</desc>
</entry>

<entry id="rtmhist_fincl3">
<entry id="fincl3">
<type>char(1000)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -214,7 +215,7 @@
</desc>
</entry>

<entry id="rtmhist_mfilt">
<entry id="mfilt">
<type>integer(6)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -226,7 +227,7 @@
</desc>
</entry>

<entry id="rtmhist_ndens">
<entry id="ndens">
<type>integer(6)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -240,7 +241,7 @@
</desc>
</entry>

<entry id="rtmhist_nhtfrq">
<entry id="nhtfrq">
<type>integer(6)</type>
<category>history</category>
<group>mosart_inparm</group>
Expand All @@ -254,4 +255,43 @@
</desc>
</entry>

<entry id="mosart_tracers">
<type>char</type>
<category>mosart</category>
<group>mosart_inparm</group>
<values>
<value>LIQ:ICE</value>
</values>
<desc>
Colon delimited string of mosart tracers.
</desc>
</entry>

<entry id="mosart_euler_calc">
<type>char</type>
<category>mosart</category>
<group>mosart_inparm</group>
<values>
<value>T:F</value>
</values>
<desc>
Colon delimited string of toggle to turn on Euler algorithm for
tracer name in mosart_tracers.
</desc>
</entry>

<entry id="budget_frq">
<type>integer(6)</type>
<category>mosart</category>
<group>mosart_inparm</group>
<values>
<value>-24</value>
</values>
<desc>
Frequency to perform budget check. Similar to nhtfrq,
positive means in time steps, 0=monthly, negative means hours
(i.e. 24 means every 24 time-steps and -24 means every day
</desc>
</entry>

</entry_id>
24 changes: 12 additions & 12 deletions cime_config/testdefs/testlist_mosart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<test name="PFS" grid="f10_f10_mg37" compset="I1850Clm50Sp" testmods="mosart/default">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -14,7 +14,7 @@
<test name="ERS_Ld5" grid="f10_f10_mg37" compset="I2000Clm50BgcCru" testmods="mosart/default">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -24,7 +24,7 @@
<test name="ERS_Ld5" grid="f10_f10_mg37" compset="I2000Clm50BgcCru" testmods="mosart/iceOff">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -33,7 +33,7 @@
<test name="SMS_Ld5" grid="f10_f10_mg37" compset="I2000Clm50BgcCrop" testmods="mosart/mosartCold">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -43,7 +43,7 @@
<test name="SMS_Lh3" grid="f10_f10_mg37" compset="I2000Clm50BgcCru" testmods="mosart/mosartOff">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -53,7 +53,7 @@
<test name="SMS_Lh3" grid="f10_f10_mg37" compset="I2000Clm51Sp" testmods="mosart/clmAccelSpinupIgnoreWarn">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -62,7 +62,7 @@
</test>
<test name="SMS_D_Ld5" grid="f10_f10_mg37" compset="I1850Clm50Bgc" testmods="mosart/default">
<machines>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
<machine name="izumi" compiler="nag" category="mosart"></machine>
</machines>
<options>
Expand All @@ -73,7 +73,7 @@
<test name="SMS_D" grid="f10_f10_mg37" compset="I1850Clm50Bgc" testmods="mosart/decompOpts">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -83,7 +83,7 @@
<test name="SMS_D" grid="f10_f10_mg37" compset="I1850Clm50Bgc" testmods="mosart/passChannelDepths">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -93,7 +93,7 @@
<test name="ERP_D" grid="f10_f10_mg37" compset="I1850Clm50Bgc" testmods="mosart/qgrwlOpts">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -102,7 +102,7 @@
<test name="PEM_D" grid="f10_f10_mg37" compset="I1850Clm50Sp" testmods="mosart/inplacethreshold">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand All @@ -112,7 +112,7 @@
<test name="SMS" grid="f10_f10_mg37" compset="I1850Clm50Sp" testmods="mosart/nobypass">
<machines>
<machine name="derecho" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart"></machine>
<machine name="betzy" compiler="intel" category="mosart_noresm"></machine>
</machines>
<options>
<option name="wallclock">00:20:00</option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
! ice_runoff = .true.
rtmhist_ndens = 1,1,1
rtmhist_nhtfrq =-24,-8
rtmhist_mfilt = 1,1
ndens = 1,1,1
nhtfrq =-24,-8
mfilt = 1,1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
finidat_rtm = ' '
finidat = ' '
2 changes: 1 addition & 1 deletion cime_config/user_nl_mosart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
!----------------------------------------------------------------------------------
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
! NOTE: namelist variable rtm_tstep CAN ONLY be changed by modifying the value
! NOTE: namelist variable delt_mosart (the time-step) CAN ONLY be changed by modifying the value
! of the xml variable ROF_NCPL in env_run.xml
!----------------------------------------------------------------------------------

Expand Down
Loading

0 comments on commit 5acf6b2

Please sign in to comment.