Skip to content

Commit

Permalink
Fix so working now
Browse files Browse the repository at this point in the history
Copy the logic from other CIME SystemTests about setting the
driver rpointer file
for branch run types.
(requires setting the file and DRV_RESTART_POINTER xml variable).
  • Loading branch information
ekluzek committed Jan 16, 2025
1 parent 57b68fb commit deaf933
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions cime_config/SystemTests/sspmatrixcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Step 4: matrix Spinup off
"""
import shutil, glob, os, sys
from datetime import datetime

if __name__ == "__main__":
CIMEROOT = os.environ.get("CIMEROOT")
Expand Down Expand Up @@ -225,6 +226,7 @@ def run_phase(self):
self.append_user_nl(clone_path, n)

dout_sr = clone.get_value("DOUT_S_ROOT")
ninst = self._case.get_value("NINST")

self._skip_pnl = False
#
Expand All @@ -247,9 +249,17 @@ def run_phase(self):
os.makedirs(rundir)
os.symlink(item, linkfile)

for item in glob.glob("{}/*rpointer*".format(rest_path)):
# For a branch the cpl rpointer file needs to be handled
if self.runtyp[n] is "branch":

drvrest = "rpointer.cpl"
if ninst > 1:
drvrest += "_0001"
drvrest += rest_time

self._set_drv_restart_pointer(drvrest)
try:
shutil.copy(item, rundir)
shutil.copy(drvrest, rundir)
except shutil.SameFileError:
pass
#
Expand All @@ -269,6 +279,7 @@ def run_phase(self):
)
refsec = "00000"
rest_path = os.path.join(dout_sr, "rest", "{}-{}".format(refdate, refsec))
rest_time = "." + refdate + "-" + refsec

#
# Last step in original case
Expand Down Expand Up @@ -296,8 +307,19 @@ def run_phase(self):
os.remove(linkfile)
os.symlink(item, linkfile)

for item in glob.glob("{}/*rpointer*".format(rest_path)):
shutil.copy(item, rundir)
# For a branch the cpl rpointer file needs to be handled
if self.runtyp[n] is "branch":

drvrest = "rpointer.cpl"
if ninst > 1:
drvrest += "_0001"
drvrest += rest_time

self._set_drv_restart_pointer(drvrest)
try:
shutil.copy(os.path.join( rest_path, drvrest), rundir)
except shutil.SameFileError:
pass

self.append_user_nl(clone_path, n)
#
Expand Down

0 comments on commit deaf933

Please sign in to comment.