From 59b0aa5dba479dd6770ee263607cff1f10cf4f8a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 2 Jan 2025 07:50:52 -0700 Subject: [PATCH 1/6] sometimes this is the same file, avoid error in this case --- cime_config/SystemTests/ssp.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/ssp.py b/cime_config/SystemTests/ssp.py index bd554aeae9..a99a57a1e8 100644 --- a/cime_config/SystemTests/ssp.py +++ b/cime_config/SystemTests/ssp.py @@ -97,8 +97,10 @@ def run_phase(self): os.symlink(item, link_name) for item in glob.glob("{}/*rpointer*".format(rest_path)): - shutil.copy(item, rundir) - + try: + shutil.copy(item, rundir) + except shutil.SameFileError: + pass self._case.set_value("CLM_ACCELERATED_SPINUP", "off") self._case.set_value("RUN_TYPE", "hybrid") self._case.set_value("GET_REFCASE", False) From 3b42fc19fb556224b7e3f7d73e39044a85f2941d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 Jan 2025 12:00:25 -0700 Subject: [PATCH 2/6] Move the same change from ssp.py to sspmatrix.py in regard for checking that rpointer files are the same --- cime_config/SystemTests/sspmatrixcn.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index 29b6dce8e6..2d7b55f004 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -248,8 +248,10 @@ def run_phase(self): os.symlink(item, linkfile) for item in glob.glob("{}/*rpointer*".format(rest_path)): - shutil.copy(item, rundir) - + try: + shutil.copy(item, rundir) + except shutil.SameFileError: + pass # # Run the case (Archiving on) # From 4b20bbd7003e6f77dab4e3268cc4a43f9b5a3b5d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 Jan 2025 12:07:38 -0700 Subject: [PATCH 3/6] Run black --- cime_config/SystemTests/sspmatrixcn.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index 2d7b55f004..e35c6dbf8e 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -249,9 +249,9 @@ def run_phase(self): for item in glob.glob("{}/*rpointer*".format(rest_path)): try: - shutil.copy(item, rundir) + shutil.copy(item, rundir) except shutil.SameFileError: - pass + pass # # Run the case (Archiving on) # From c6677bbe9d1683c998e9d3d22b74e32e71177a30 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 14 Jan 2025 12:08:18 -0700 Subject: [PATCH 4/6] Add a black commit --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 089e9fbb12..50dc3bdb0b 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -53,3 +53,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b 753fda3ff0147837231a73c9c728dd9ce47b5997 f112ba0bbf96a61d5a4d354dc0dcbd8b0c68145c bd535c710db78420b8e8b9d71d88d8339e899c59 +4b20bbd7003e6f77dab4e3268cc4a43f9b5a3b5d From 57b68fb7d1d8e8a4cfcfe771d097cf726563361c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 Jan 2025 01:01:08 -0700 Subject: [PATCH 5/6] Remove unneeded copy of rpointer files --- cime_config/SystemTests/ssp.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cime_config/SystemTests/ssp.py b/cime_config/SystemTests/ssp.py index a99a57a1e8..92cab0a961 100644 --- a/cime_config/SystemTests/ssp.py +++ b/cime_config/SystemTests/ssp.py @@ -81,7 +81,7 @@ def run_phase(self): ) refsec = "00000" - # obtain rpointer files and necessary restart files from short term archiving directory + # obtain necessary restart files from short term archiving directory rundir = self._case.get_value("RUNDIR") rest_path = os.path.join(dout_sr, "rest", "{}-{}".format(refdate, refsec)) @@ -96,11 +96,6 @@ def run_phase(self): else: os.symlink(item, link_name) - for item in glob.glob("{}/*rpointer*".format(rest_path)): - try: - shutil.copy(item, rundir) - except shutil.SameFileError: - pass self._case.set_value("CLM_ACCELERATED_SPINUP", "off") self._case.set_value("RUN_TYPE", "hybrid") self._case.set_value("GET_REFCASE", False) From deaf9331f8f24264f366911d60ad20c9e23bbfca Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 Jan 2025 08:37:42 -0700 Subject: [PATCH 6/6] Fix so working now 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). --- cime_config/SystemTests/sspmatrixcn.py | 30 ++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index e35c6dbf8e..b8c921ac5a 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -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") @@ -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 # @@ -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 # @@ -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 @@ -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) #