Skip to content

Commit

Permalink
Merge pull request #4744 from ESMCI/jgfouca/e3sm_cime_fixes
Browse files Browse the repository at this point in the history
Last couple fixes for e3sm

Test suite:
Test baseline:
Test namelist changes:
Test status: [bit for bit, roundoff, climate changing]

Fixes [CIME Github issue #]

User interface changes?:

Update gh-pages html (Y/N)?:
  • Loading branch information
jgfouca authored Feb 4, 2025
2 parents 5eff840 + 9d6673b commit 99fa564
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CIME/SystemTests/eri.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def run_phase(self):

ninst = self._case.get_value("NINST")
drvrest = "rpointer.cpl"
if ninst > 1:
if ninst is not None and ninst > 1:
drvrest += "_0001"
drvrest += self._rest_time
self._set_drv_restart_pointer(drvrest)
Expand Down Expand Up @@ -288,7 +288,7 @@ def run_phase(self):
self._case.set_value("HIST_OPTION", stop_option)
self._case.set_value("HIST_N", hist_n)
drvrest = "rpointer.cpl"
if ninst > 1:
if ninst is not None and ninst > 1:
drvrest += "_0001"
drvrest += self._rest_time

Expand Down
2 changes: 1 addition & 1 deletion CIME/SystemTests/restart_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _case_two_setup(self):
self._case.set_value("REST_OPTION", "never")
ninst = self._case.get_value("NINST")
drvrest = "rpointer.cpl"
if ninst > 1:
if ninst is not None and ninst > 1:
drvrest += "_0001"
drvrest += self._rest_time
self._set_drv_restart_pointer(drvrest)
6 changes: 6 additions & 0 deletions CIME/SystemTests/system_tests_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ def _set_restart_interval(
if ncpl and minncpl < ncpl:
minncpl = ncpl

comp_interface = self._case.get_value("COMP_INTERFACE")
# mct doesn't care about maxncpl so set it to minncpl
if comp_interface == "mct":
maxncpl = minncpl

ncpl_base_period = self._case.get_value("NCPL_BASE_PERIOD")
if ncpl_base_period == "hour":
coupling_secs = 3600 / maxncpl
Expand Down Expand Up @@ -187,6 +192,7 @@ def _set_restart_interval(
else:
expect(False, f"stop_option {stop_option} not available for this test")
stop_n = int(stop_n * factor // coupling_secs)

rest_n = math.ceil((stop_n // 2 + 1) * coupling_secs / factor)
expect(stop_n > 0, "Bad STOP_N: {:d}".format(stop_n))
expect(stop_n > 2, "ERROR: stop_n value {:d} too short".format(stop_n))
Expand Down

0 comments on commit 99fa564

Please sign in to comment.