Skip to content

Commit

Permalink
Merge pull request #384 from matsbn/feature-kdm_hyb_config
Browse files Browse the repository at this point in the history
Modified setting of vertical coordinate and vertical dimension
  • Loading branch information
matsbn authored Nov 28, 2024
2 parents d64b7c5 + d621ca0 commit 9f854b4
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 62 deletions.
14 changes: 4 additions & 10 deletions cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,14 @@ def create_dimmod(case):
comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN")
ocn_grid = case.get_value("OCN_GRID")
blom_vcoord = case.get_value("BLOM_VCOORD")
blom_kdm = case.get_value("BLOM_KDM")
ntasks_ocn = case.get_value("NTASKS_OCN")
objroot = case.get_value("OBJROOT")

gridconf_dir = os.path.join(comp_root_dir_ocn, "bld", ocn_grid)
kdm_file = os.path.join(gridconf_dir, "kdm." + blom_vcoord)
blom_dimensions_script = os.path.join(comp_root_dir_ocn, "bld", "blom_dimensions")

try:
with open(kdm_file, "r") as kdm_file_obj:
kdm = kdm_file_obj.read().strip()
except:
expect(False, "Failed to read kdm from file {}".format(kdm_file))

cmd = "{} -n {} -k {} -d {}".format(blom_dimensions_script, ntasks_ocn, kdm, gridconf_dir)
cmd = "{} -n {} -k {} -d {}".format(blom_dimensions_script, ntasks_ocn, blom_kdm, gridconf_dir)
rc, out, err = run_cmd(cmd, from_dir=blomconf_dir)
expect(rc == 0, "Command %s failed rc=%d\nout=%s\nerr=%s" % (cmd, rc, out, err))

Expand Down Expand Up @@ -95,10 +89,10 @@ def buildcpp(case):
if ocn_grid in ["gx1v5", "gx1v6", "tnx1v1", "tnx1v3", "tnx1v4", "tnx0.5v1", "tnx0.25v1", "tnx0.25v3", "tnx0.25v4", "tnx0.125v4"]:
blom_cppdefs = blom_cppdefs + " -DLEVITUS2X"

if turbclo or tracers:
if turbclo != "null" or tracers:
blom_cppdefs = blom_cppdefs + " -DTRC"

if turbclo:
if turbclo != "null":
twoeq = False
oneeq = False
for option in turbclo.split():
Expand Down
4 changes: 2 additions & 2 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def buildnml(case, caseroot, compname):

blom_vcoord = case.get_value("BLOM_VCOORD")
turbclo = case.get_value("BLOM_TURBULENT_CLOSURE")
expect(blom_vcoord != "cntiso_hybrid" or not turbclo,
expect(blom_vcoord == "isopyc_bulkml" or turbclo == "null",
f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turbclo} is not a valid combination")

#--------------------------
Expand Down Expand Up @@ -281,7 +281,7 @@ def buildnml(case, caseroot, compname):

groups.append('cwmod')

if case.get_value("BLOM_VCOORD") == "cntiso_hybrid":
if case.get_value("BLOM_VCOORD") != "isopyc_bulkml":
groups.append('vcoord')
groups.append('ale_regrid_remap')

Expand Down
65 changes: 43 additions & 22 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<valid_values>iage,iage ecosys</valid_values>
<default_value>iage</default_value>
<values>
<value compset="_BLOM%ECO">iage ecosys</value>
<value compset="_BLOM.*%ECO">iage ecosys</value>
</values>
<group>build_component_blom</group>
<file>env_build.xml</file>
Expand All @@ -38,6 +38,10 @@
<type>char</type>
<valid_values></valid_values>
<default_value>oneeq advection</default_value>
<values>
<value compset="_BLOM%HYB">null</value>
<value compset="_BLOM%LVL">null</value>
</values>
<group>build_component_blom</group>
<file>env_build.xml</file>
<desc>Optional turbulent closure. Valid values one of: twoeq oneeq. Additional values: advection isodif</desc>
Expand All @@ -57,11 +61,11 @@
<valid_values>constant,prognostic,diagnostic</valid_values>
<default_value>constant</default_value>
<values>
<value compset="_BLOM%ECO" >constant</value>
<value compset="_BLOM%ECO.*_BGC%BPRP">prognostic</value>
<value compset="_BLOM%ECO.*_BGC%BDRD">diagnostic</value>
<value compset="_DATM%CPLHIST.*_BLOM%ECO">diagnostic</value>
<value compset="20TR_DATM%IAF.*_BLOM%ECO">diagnostic</value>
<value compset="_BLOM.*%ECO" >constant</value>
<value compset="_BLOM.*%ECO.*_BGC%BPRP">prognostic</value>
<value compset="_BLOM.*%ECO.*_BGC%BDRD">diagnostic</value>
<value compset="_DATM%CPLHIST.*_BLOM.*%ECO">diagnostic</value>
<value compset="20TR_DATM%IAF.*_BLOM.*%ECO">diagnostic</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
Expand All @@ -72,13 +76,30 @@

<entry id="BLOM_VCOORD">
<type>char</type>
<valid_values>isopyc_bulkml,cntiso_hybrid</valid_values>
<valid_values>isopyc_bulkml,cntiso_hybrid,plevel</valid_values>
<default_value>isopyc_bulkml</default_value>
<values>
<value compset="_BLOM%HYB">cntiso_hybrid</value>
<value compset="_BLOM%LVL">plevel</value>
</values>
<group>build_component_blom</group>
<file>env_build.xml</file>
<desc>Vertical coordinate type of BLOM</desc>
</entry>

<entry id="BLOM_KDM">
<type>integer</type>
<valid_values/>
<default_value>53</default_value>
<values>
<value compset="_BLOM%HYB">56</value>
<value compset="_BLOM%LVL">56</value>
</values>
<group>build_component_blom</group>
<file>env_build.xml</file>
<desc>Vertical dimension of BLOM</desc>
</entry>

<entry id="BLOM_COUPLING">
<type>char</type>
<valid_values>full,partial</valid_values>
Expand Down Expand Up @@ -121,19 +142,19 @@
<valid_values>UNSET,1850,2000,hist,ssp119,ssp126,ssp245,ssp370,ssp434,ssp460,ssp534os,ssp585</valid_values>
<default_value>1850</default_value>
<values>
<value compset="1850_.*_BLOM%ECO" >1850</value>
<value compset="2000_.*_BLOM%ECO" >2000</value>
<value compset="HIST_.*_BLOM%ECO" >hist</value>
<value compset="20TR_.*_BLOM%ECO" >hist</value>
<value compset="SSP119_.*_BLOM%ECO" >ssp119</value>
<value compset="SSP126_.*_BLOM%ECO" >ssp126</value>
<value compset="SSP245_.*_BLOM%ECO" >ssp245</value>
<value compset="SSP370_.*_BLOM%ECO" >ssp370</value>
<value compset="SSP434_.*_BLOM%ECO" >ssp434</value>
<value compset="SSP460_.*_BLOM%ECO" >ssp460</value>
<value compset="SSP534_.*_BLOM%ECO" >ssp534os</value>
<value compset="SSP585_.*_BLOM%ECO" >ssp585</value>
<value compset="SSP370.*_BLOM%ECO" >ssp370</value>
<value compset="1850_.*_BLOM.*%ECO" >1850</value>
<value compset="2000_.*_BLOM.*%ECO" >2000</value>
<value compset="HIST_.*_BLOM.*%ECO" >hist</value>
<value compset="20TR_.*_BLOM.*%ECO" >hist</value>
<value compset="SSP119_.*_BLOM.*%ECO" >ssp119</value>
<value compset="SSP126_.*_BLOM.*%ECO" >ssp126</value>
<value compset="SSP245_.*_BLOM.*%ECO" >ssp245</value>
<value compset="SSP370_.*_BLOM.*%ECO" >ssp370</value>
<value compset="SSP434_.*_BLOM.*%ECO" >ssp434</value>
<value compset="SSP460_.*_BLOM.*%ECO" >ssp460</value>
<value compset="SSP534_.*_BLOM.*%ECO" >ssp534os</value>
<value compset="SSP585_.*_BLOM.*%ECO" >ssp585</value>
<value compset="SSP370.*_BLOM.*%ECO" >ssp370</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -266,8 +287,8 @@
</entry>

<description>
<desc compset="_BLOM" >BLOM default:</desc>
<desc compset="_BLOM%ECO">BLOM/Ecosystem:</desc>
<desc compset="_BLOM" >BLOM default:</desc>
<desc compset="_BLOM.*%ECO">BLOM/Ecosystem:</desc>
</description>

<help>
Expand Down
30 changes: 15 additions & 15 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,29 @@

<compset>
<alias>NOINY_WW3</alias>
<lname>2000_DATM%NYF_SLND_CICE_BLOM_DROF%NYF_SGLC_WW3</lname>
<lname>2000_DATM%NYF_SLND_CICE_BLOM%HYB_DROF%NYF_SGLC_WW3</lname>
</compset>

<compset>
<alias>NOINYOC_WW3</alias>
<lname>2000_DATM%NYF_SLND_CICE_BLOM%ECO_DROF%NYF_SGLC_WW3</lname>
<lname>2000_DATM%NYF_SLND_CICE_BLOM%HYB%ECO_DROF%NYF_SGLC_WW3</lname>
</compset>

<!-- Normal year forcing - no prognostic wave -->

<compset>
<alias>NOINY</alias>
<lname>2000_DATM%NYF_SLND_CICE_BLOM_DROF%NYF_SGLC_SWAV</lname>
<lname>2000_DATM%NYF_SLND_CICE_BLOM%HYB_DROF%NYF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NOINYOC</alias>
<lname>1850_DATM%NYF_SLND_CICE_BLOM%ECO_DROF%NYF_SGLC_SWAV</lname>
<lname>1850_DATM%NYF_SLND_CICE_BLOM%HYB%ECO_DROF%NYF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>NOIIA</alias>
<lname>2000_DATM%IAF_SLND_CICE_BLOM_DROF%IAF_SGLC_SWAV</lname>
<lname>2000_DATM%IAF_SLND_CICE_BLOM%HYB_DROF%IAF_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -56,7 +56,7 @@

<compset>
<alias>NOIIAOC</alias>
<lname>2000_DATM%IAF_SLND_CICE_BLOM%ECO_DROF%IAF_SGLC_SWAV</lname>
<lname>2000_DATM%IAF_SLND_CICE_BLOM%HYB%ECO_DROF%IAF_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -66,7 +66,7 @@

<compset>
<alias>NOIIAOC20TR</alias>
<lname>20TR_DATM%IAF_SLND_CICE_BLOM%ECO_DROF%IAF_SGLC_SWAV</lname>
<lname>20TR_DATM%IAF_SLND_CICE_BLOM%HYB%ECO_DROF%IAF_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -78,7 +78,7 @@

<compset>
<alias>NOIIAJRA</alias>
<lname>2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
<lname>2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -88,7 +88,7 @@

<compset>
<alias>NOIIAJRAOC</alias>
<lname>2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
<lname>2000_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -98,7 +98,7 @@

<compset>
<alias>NOIIAJRAOC1850</alias>
<lname>1850_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
<lname>1850_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -108,7 +108,7 @@

<compset>
<alias>NOIIAJRAOC20TR</alias>
<lname>20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
<lname>20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -121,7 +121,7 @@

<compset>
<alias>NOINYJRARYF1961OC</alias>
<lname>1850_DATM%JRARYF1961_SLND_CICE_BLOM%ECO_DROF%JRARYF1961_SGLC_SWAV</lname>
<lname>1850_DATM%JRARYF1961_SLND_CICE_BLOM%HYB%ECO_DROF%JRARYF1961_SGLC_SWAV</lname>
</compset>
<compset>
<!-- not valid for noresm2.5 -->
Expand All @@ -134,16 +134,16 @@

<compset>
<alias>NOICPLHISTOC</alias>
<lname>1850_DATM%CPLHIST_SLND_CICE_BLOM%ECO_DROF%CPLHIST_SGLC_SWAV</lname>
<lname>1850_DATM%CPLHIST_SLND_CICE_BLOM%HYB%ECO_DROF%CPLHIST_SGLC_SWAV</lname>
</compset>

<entries>
<entry id="RUN_STARTDATE">
<values match="last">
<value compset="20TR_DATM%IAF_SLND_CICE%NORESM-CMIP6_BLOM%ECO_DROF%IAF_SGLC_SWAV">1700-01-01</value>
<value compset="20TR_DATM%JRA_SLND_CICE%NORESM-CMIP6_BLOM%ECO_DROF%JRA_SGLC_SWAV">1653-01-01</value>
<value compset="20TR_DATM%IAF_SLND_CICE_BLOM%ECO_DROF%IAF_SGLC_SWAV">1700-01-01</value>
<value compset="20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%ECO_DROF%JRA-1p4-2018_SGLC_SWAV">1653-01-01</value>
<value compset="20TR_DATM%IAF_SLND_CICE_BLOM%HYB%ECO_DROF%IAF_SGLC_SWAV">1700-01-01</value>
<value compset="20TR_DATM%JRA-1p4-2018_SLND_CICE_BLOM%HYB%ECO_DROF%JRA-1p4-2018_SGLC_SWAV">1653-01-01</value>
</values>
</entry>
</entries>
Expand Down
18 changes: 9 additions & 9 deletions cime_config/config_pes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<!-- GRID: T62_tn14 : start !-->
<grid name="a%T62.+oi%tnx1v4">
<mach name="any">
<pes pesize="XS" compset="_DATM.*_BLOM%ECO">
<pes pesize="XS" compset="_DATM.*_BLOM.*%ECO">
<comment>Very small pe-layout on 128 pes in total</comment>
<ntasks>
<ntasks_atm>4</ntasks_atm>
Expand Down Expand Up @@ -164,7 +164,7 @@

<grid name="a%T62.+oi%tnx1v4">
<mach name="any">
<pes pesize="M" compset="_DATM.*_BLOM%ECO">
<pes pesize="M" compset="_DATM.*_BLOM.*%ECO">
<comment>none</comment>
<ntasks>
<ntasks_atm>1</ntasks_atm>
Expand Down Expand Up @@ -204,7 +204,7 @@
<!-- GRID: TL319_tn14 : start !-->
<grid name="a%TL319.+oi%tnx1v4">
<mach name="any">
<pes pesize="XS" compset="_DATM.*_BLOM%ECO">
<pes pesize="XS" compset="_DATM.*_BLOM.*%ECO">
<comment>Very small pe-layout on 128 pes in total</comment>
<ntasks>
<ntasks_atm>4</ntasks_atm>
Expand Down Expand Up @@ -399,7 +399,7 @@

<grid name="a%TL319.+oi%tnx0.5v1">
<mach name="any">
<pes pesize="M" compset="_DATM.*_BLOM%ECO">
<pes pesize="M" compset="_DATM.*_BLOM.*%ECO">
<comment>none</comment>
<ntasks>
<ntasks_atm>256</ntasks_atm>
Expand Down Expand Up @@ -553,7 +553,7 @@

<grid name="a%T62.+oi%tnx0.25v4">
<mach name="any">
<pes pesize="any" compset="_DATM.*_BLOM%ECO">
<pes pesize="any" compset="_DATM.*_BLOM.*%ECO">
<comment>none</comment>
<ntasks>
<ntasks_atm>16</ntasks_atm>
Expand Down Expand Up @@ -636,7 +636,7 @@
<!-- GRID: T62_tn21 !-->
<grid name="a%T62.+oi%tnx2v1">
<mach name="any">
<pes pesize="XS" compset="_DATM.*_BLOM%ECO">
<pes pesize="XS" compset="_DATM.*_BLOM.*%ECO">
<comment>Very small and efficent pe-layout on 128 pes in total</comment>
<ntasks>
<ntasks_atm>1</ntasks_atm>
Expand Down Expand Up @@ -674,7 +674,7 @@

<grid name="a%T62.+oi%tnx2v1">
<mach name="any">
<pes pesize="S" compset="_DATM.*_BLOM%ECO">
<pes pesize="S" compset="_DATM.*_BLOM.*%ECO">
<comment>Small pe-layout with 219 pes in total</comment>
<ntasks>
<ntasks_atm>1</ntasks_atm>
Expand Down Expand Up @@ -750,7 +750,7 @@

<grid name="a%T62.+oi%tnx2v1">
<mach name="any">
<pes pesize="M" compset="_DATM.*_BLOM%ECO">
<pes pesize="M" compset="_DATM.*_BLOM.*%ECO">
<comment>Medium sized pe-layout with 384 pes in total</comment>
<ntasks>
<ntasks_atm>18</ntasks_atm>
Expand Down Expand Up @@ -788,7 +788,7 @@

<grid name="a%T62.+oi%tnx2v1">
<mach name="any">
<pes pesize="L" compset="_DATM.*_BLOM%ECO">
<pes pesize="L" compset="_DATM.*_BLOM.*%ECO">
<comment>Large pe-layout with 512 pes in total</comment>
<ntasks>
<ntasks_atm>1</ntasks_atm>
Expand Down
Loading

0 comments on commit 9f854b4

Please sign in to comment.