Skip to content

Commit

Permalink
Add system tests of having a second grain pool
Browse files Browse the repository at this point in the history
These are useful for testing infrastructure that will be needed to
incorporate AgSys. They can be dropped once we have tests of AgSys,
which will exercise this infrastructure and more.
  • Loading branch information
billsacks committed Mar 4, 2022
1 parent cf8f3a1 commit 807c307
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
40 changes: 40 additions & 0 deletions cime_config/SystemTests/lgrain2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"""
Implementation of the CIME LGRAIN2 (Land 2-grain-pool) test.
This is a CTSM specific test: Verifies that we can allocate and use a second grain pool,
and that answers are identical to a run with a single grain pool. This is useful until we
have tests that include AgSys, which will exercise this capability more completely.
(1) do a run with a second grain pool
(2) do a standard run only a single grain pool
The reason for having the second grain pool in the first case (rather than the other way
around) is that this results in having a few extra fields present in the baselines.
"""

from CIME.SystemTests.system_tests_compare_two import SystemTestsCompareTwo
from CIME.XML.standard_module_setup import *
from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files

logger = logging.getLogger(__name__)

class LGRAIN2(SystemTestsCompareTwo):

def __init__(self, case):
SystemTestsCompareTwo.__init__(self, case,
separate_builds = False,
run_two_suffix = 'grain1',
run_one_description = 'use a second grain pool',
run_two_description = 'use a single grain pool',
ignore_fieldlist_diffs = True)

def _case_one_setup(self):
append_to_user_nl_files(caseroot = self._get_caseroot(),
component = "clm",
contents = "for_testing_use_second_grain_pool=.true.")

def _case_two_setup(self):
append_to_user_nl_files(caseroot = self._get_caseroot(),
component = "clm",
contents = "for_testing_use_second_grain_pool=.false.")
10 changes: 10 additions & 0 deletions cime_config/config_tests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ This defines various CTSM-specific system tests
<HIST_N>$STOP_N</HIST_N>
</test>

<test NAME="LGRAIN2">
<DESC>CTSM Land model test to ensure that we can allocate and use a second grain pool</DESC>
<INFO_DBUG>1</INFO_DBUG>
<DOUT_S>FALSE</DOUT_S>
<CONTINUE_RUN>FALSE</CONTINUE_RUN>
<REST_OPTION>never</REST_OPTION>
<HIST_OPTION>$STOP_OPTION</HIST_OPTION>
<HIST_N>$STOP_N</HIST_N>
</test>

<test NAME="LII">
<DESC>CLM initial condition interpolation test (requires configuration with non-blank finidat)</DESC>
<INFO_DBUG>1</INFO_DBUG>
Expand Down
21 changes: 21 additions & 0 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2498,6 +2498,27 @@
</machines>
</test>

<test name="LGRAIN2_Ly1_P72x1" grid="f10_f10_mg37" compset="I2000Clm50BgcCrop" testmods="clm/ciso--clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm">
<options>
<option name="wallclock">02:00:00</option>
<option name="comment">Ensure that it works to have a second grain pool, and that we can get bit-for-bit identical answers with a standard run with just one grain pool. This tests infrastructure that will be needed when incorporating AgSys. This test can be dropped once we have some tests exercising AgSys (which will exercise this code).</option>
</options>
</machine>
</machines>
</test>
<test name="LGRAIN2_Ly1_P72x1" grid="f10_f10_mg37" compset="I2000Clm45BgcCrop" testmods="clm/ciso--clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm">
<options>
<option name="wallclock">02:00:00</option>
<option name="comment">Ensure that it works to have a second grain pool, and that we can get bit-for-bit identical answers with a standard run with just one grain pool. This tests infrastructure that will be needed when incorporating AgSys. This test can be dropped once we have some tests exercising AgSys (which will exercise this code). Compared to the Clm50 test, this Clm45 test exercises code in NutrientCompetitionCLM45defaultMod and use_grainproduct false.</option>
</options>
</machine>
</machines>
</test>

<test name="FUNITCTSM_P1x1" grid="f10_f10_mg37" compset="I2000Clm50Sp">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm">
Expand Down

0 comments on commit 807c307

Please sign in to comment.