Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified setting of vertical coordinate and vertical dimension #384

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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.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
12 changes: 5 additions & 7 deletions cime_config/buildlib_2.1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def _main_func():

objroot = case.get_value("OBJROOT")
comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN")
turbclo = case.get_value("BLOM_TURBULENT_CLOSURE")
tracers = case.get_value("BLOM_TRACER_MODULES")
driver = case.get_value("COMP_INTERFACE")

Expand All @@ -65,18 +64,17 @@ def _main_func():
os.path.join(comp_root_dir_ocn, "channel"),
os.path.join(comp_root_dir_ocn, "single_column"),
os.path.join(comp_root_dir_ocn, "pkgs", "CVMix-src", "src", "shared"),
os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src"),
os.path.join(comp_root_dir_ocn, "phy")]

if turbclo != 0 and tracers != 0:
paths.append(os.path.join(comp_root_dir_ocn, "trc"))
os.path.join(comp_root_dir_ocn, "phy"),
os.path.join(comp_root_dir_ocn, "trc"),
os.path.join(comp_root_dir_ocn, "idlage")]

if tracers != 0:
for module in tracers.split():
if module == "iage":
paths.append(os.path.join(comp_root_dir_ocn, "idlage"))
continue
elif module == "ecosys":
paths.append(os.path.join(comp_root_dir_ocn, "hamocc"))
paths.append(os.path.join(comp_root_dir_ocn, "pkgs", "M4AGO-sinking-scheme", "src"))
else:
expect(False, "tracer module {} is not recognized".format(module))

Expand Down
1 change: 0 additions & 1 deletion cime_config/buildlib_2.2
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def _main_func():

objroot = case.get_value("OBJROOT")
comp_root_dir_ocn = case.get_value("COMP_ROOT_DIR_OCN")
turbclo = case.get_value("BLOM_TURBULENT_CLOSURE")
tracers = case.get_value("BLOM_TRACER_MODULES")
driver = case.get_value("COMP_INTERFACE")

Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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 != "cntiso_hybrid" or turbclo == "null",
f"BLOM_VCOORD == {blom_vcoord} and BLOM_TURBULENT_CLOSURE == {turbclo} is not a valid combination")

#--------------------------
Expand Down
60 changes: 39 additions & 21 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,9 @@
<type>char</type>
<valid_values></valid_values>
<default_value>oneeq advection</default_value>
<values>
<value compset="_BLOM%HYB">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 +60,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 @@ -74,11 +77,26 @@
<type>char</type>
<valid_values>isopyc_bulkml,cntiso_hybrid</valid_values>
<default_value>isopyc_bulkml</default_value>
<values>
<value compset="_BLOM%HYB">cntiso_hybrid</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>
</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 +139,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="HIST_CAM60%NORESM.*_BLOM%ECO" >hist</value>
<value compset="20TR_DATM.*_BLOM%ECO" >hist</value>
<value compset="2000_CAM60%NORESM.*_BLOM%ECO" >2000</value>
<value compset="SSP119_CAM60%NORESM.*_BLOM%ECO" >ssp119</value>
<value compset="SSP126_CAM60%NORESM.*_BLOM%ECO" >ssp126</value>
<value compset="SSP245_CAM60%NORESM.*_BLOM%ECO" >ssp245</value>
<value compset="SSP370_CAM60%NORESM.*_BLOM%ECO" >ssp370</value>
<value compset="SSP370LOWNTCF_CAM60%NORESM.*_BLOM%ECO" >ssp370</value>
<value compset="SSP370REFGHGLOWNTCF_CAM60%NORESM.*_BLOM%ECO">ssp370</value>
<value compset="SSP434_CAM60%NORESM.*_BLOM%ECO" >ssp434</value>
<value compset="SSP460_CAM60%NORESM.*_BLOM%ECO" >ssp460</value>
<value compset="SSP534_CAM60%NORESM.*_BLOM%ECO" >ssp534os</value>
<value compset="SSP585_CAM60%NORESM.*_BLOM%ECO" >ssp585</value>
<value compset="HIST_CAM60%NORESM.*_BLOM.*%ECO" >hist</value>
<value compset="20TR_DATM.*_BLOM.*%ECO" >hist</value>
<value compset="2000_CAM60%NORESM.*_BLOM.*%ECO" >2000</value>
<value compset="SSP119_CAM60%NORESM.*_BLOM.*%ECO" >ssp119</value>
<value compset="SSP126_CAM60%NORESM.*_BLOM.*%ECO" >ssp126</value>
<value compset="SSP245_CAM60%NORESM.*_BLOM.*%ECO" >ssp245</value>
<value compset="SSP370_CAM60%NORESM.*_BLOM.*%ECO" >ssp370</value>
<value compset="SSP370LOWNTCF_CAM60%NORESM.*_BLOM.*%ECO" >ssp370</value>
<value compset="SSP370REFGHGLOWNTCF_CAM60%NORESM.*_BLOM.*%ECO">ssp370</value>
<value compset="SSP434_CAM60%NORESM.*_BLOM.*%ECO" >ssp434</value>
<value compset="SSP460_CAM60%NORESM.*_BLOM.*%ECO" >ssp460</value>
<value compset="SSP534_CAM60%NORESM.*_BLOM.*%ECO" >ssp534os</value>
<value compset="SSP585_CAM60%NORESM.*_BLOM.*%ECO" >ssp585</value>
</values>
<group>run_component_blom</group>
<file>env_run.xml</file>
Expand Down Expand Up @@ -246,8 +264,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
20 changes: 10 additions & 10 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>128</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 @@ -280,7 +280,7 @@

<grid name="a%TL319.+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>128</ntasks_atm>
Expand Down Expand Up @@ -437,7 +437,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 @@ -591,7 +591,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 @@ -674,7 +674,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 @@ -712,7 +712,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 @@ -788,7 +788,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 @@ -826,7 +826,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
8 changes: 4 additions & 4 deletions cime_config/namelist_definition_blom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
<values>
<value>5.e-5</value>
<value ocn_grid="tnx1v4" ocn_ncpl="24">.75e-4</value>
<value ocn_grid="tnx0.5v1" >.75e-4</value>
<value ocn_grid="tnx0.5v1" >.75e-4</value>
<value ocn_grid="tnx0.25v4" >.75e-4</value>
<value ocn_grid="tnx0.125v4">.75e-4</value>
</values>
Expand Down Expand Up @@ -3997,8 +3997,8 @@
<group>config_bgc</group>
<values>
<value>.false.</value>
<value compset="HIST_CAM60%NORESM.*_BLOM%ECO">.true.</value>
<value compset="20TR_DATM.*_BLOM%ECO">.true.</value>
<value compset="HIST_CAM60%NORESM.*_BLOM.*%ECO">.true.</value>
<value compset="20TR_DATM.*_BLOM.*%ECO">.true.</value>
</values>
<desc>activates HAMOCC CFC code</desc>
</entry>
Expand All @@ -4010,7 +4010,7 @@
<values>
<value>.false.</value>
<value compset="HIST_CAM60%NORESM.*">.true.</value>
<value compset="20TR_DATM.*_BLOM%ECO">.true.</value>
<value compset="20TR_DATM.*_BLOM.*%ECO">.true.</value>
</values>
<desc>activates HAMOCC natural tracer code</desc>
</entry>
Expand Down