From 807c30703438d858b6217c0d14af131d8d5e7b99 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 4 Mar 2022 16:09:39 -0700 Subject: [PATCH] Add system tests of having a second grain pool 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. --- cime_config/SystemTests/lgrain2.py | 40 +++++++++++++++++++++++++++ cime_config/config_tests.xml | 10 +++++++ cime_config/testdefs/testlist_clm.xml | 21 ++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 cime_config/SystemTests/lgrain2.py diff --git a/cime_config/SystemTests/lgrain2.py b/cime_config/SystemTests/lgrain2.py new file mode 100644 index 0000000000..129c3275e3 --- /dev/null +++ b/cime_config/SystemTests/lgrain2.py @@ -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.") diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index adbbff9038..e6ac6572d2 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -25,6 +25,16 @@ This defines various CTSM-specific system tests $STOP_N + + CTSM Land model test to ensure that we can allocate and use a second grain pool + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + CLM initial condition interpolation test (requires configuration with non-blank finidat) 1 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9c32bd09d1..ea6f58b79f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2498,6 +2498,27 @@ + + + + + + + + + + + + + + + + + + + + +