Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle same file error #2921

Open
wants to merge 7 commits into
base: b4b-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b
753fda3ff0147837231a73c9c728dd9ce47b5997
f112ba0bbf96a61d5a4d354dc0dcbd8b0c68145c
bd535c710db78420b8e8b9d71d88d8339e899c59
4b20bbd7003e6f77dab4e3268cc4a43f9b5a3b5d
5 changes: 1 addition & 4 deletions cime_config/SystemTests/ssp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -96,9 +96,6 @@ def run_phase(self):
else:
os.symlink(item, link_name)

for item in glob.glob("{}/*rpointer*".format(rest_path)):
shutil.copy(item, rundir)

self._case.set_value("CLM_ACCELERATED_SPINUP", "off")
self._case.set_value("RUN_TYPE", "hybrid")
self._case.set_value("GET_REFCASE", False)
Expand Down
34 changes: 29 additions & 5 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,19 @@ def run_phase(self):
os.makedirs(rundir)
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(drvrest, rundir)
except shutil.SameFileError:
pass
#
# Run the case (Archiving on)
#
Expand All @@ -267,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 @@ -294,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
Loading