-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1482 from ESMCI/jgfouca/alternative_impl_for_ers
Make alternative implementation for ERS Creatively named ERS2. First phase does no restarts. Second phase does two runs, the first run makes a restart file and stops, second run resumes and then compares to the first phase. Test suite: ERS2 test, code checker Test baseline: Test namelist changes: Test status: bit for bit Fixes #1244 User interface changes?: new ERS2 test type Code review: @jedwards4b @mnlevy1981
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
""" | ||
CIME restart test 2 This class inherits from SystemTestsCommon | ||
""" | ||
from CIME.XML.standard_module_setup import * | ||
from CIME.SystemTests.system_tests_common import SystemTestsCommon | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
class ERS2(SystemTestsCommon): | ||
|
||
def __init__(self, case): | ||
""" | ||
initialize an object interface to the ERS2 system test | ||
""" | ||
SystemTestsCommon.__init__(self, case) | ||
|
||
def _ers2_first_phase(self): | ||
stop_n = self._case.get_value("STOP_N") | ||
stop_option = self._case.get_value("STOP_OPTION") | ||
rest_n = self._case.get_value("REST_N") | ||
|
||
# Don't need restarts for first run | ||
self._case.set_value("REST_OPTION","never") | ||
|
||
expect(stop_n > 0, "Bad STOP_N: %d" % stop_n) | ||
expect(stop_n > 2, "ERROR: stop_n value %d too short"%stop_n) | ||
|
||
logger.info("doing an %s %s initial test with restart file at %s %s" | ||
%(str(stop_n), stop_option, str(rest_n), stop_option)) | ||
self.run_indv() | ||
|
||
def _ers2_second_phase(self): | ||
stop_n = self._case.get_value("STOP_N") | ||
stop_option = self._case.get_value("STOP_OPTION") | ||
|
||
rest_n = stop_n/2 + 1 | ||
stop_new = rest_n | ||
|
||
self._case.set_value("REST_OPTION",stop_option) | ||
self._case.set_value("STOP_N", stop_new) | ||
self._case.flush() | ||
logger.info("doing first part %s %s restart test" | ||
%(str(stop_new), stop_option)) | ||
self.run_indv(suffix="intermediate") | ||
|
||
stop_new = stop_n - rest_n | ||
self._case.set_value("STOP_N", stop_new) | ||
self._case.set_value("CONTINUE_RUN", True) | ||
self._case.set_value("REST_OPTION","never") | ||
|
||
logger.info("doing second part %s %s restart test" | ||
%(str(stop_new), stop_option)) | ||
self.run_indv(suffix="rest") | ||
|
||
# Compare restart file | ||
self._component_compare_test("base", "rest") | ||
|
||
def run_phase(self): | ||
self._ers2_first_phase() | ||
self._ers2_second_phase() |