Skip to content

Commit

Permalink
improve err by removing rundir files and recopying from sta rest dire…
Browse files Browse the repository at this point in the history
…ctory
  • Loading branch information
jedwards4b committed May 9, 2017
1 parent 0847f8d commit 71b399e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scripts/lib/CIME/SystemTests/err.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def run_phase(self):
else:
dout_s_root = self._case.get_value("DOUT_S_ROOT")
rundir = self._case.get_value("RUNDIR")
logger.info("staging files from archive %s" % dout_s_root)
for item in glob.glob(os.path.join(dout_s_root, "*", "hist", "*base")):
# NOTE - this loop doesn't do anything because the
# _ers_first_phase has already copied the history files in the
# rundir adding the .base suffix before the short term archiver runs.
# The pattern matching in the env_archive.xml looks for history
# files that match ".nc$" in the rundir in order to copy them
# to the DOUT_S_ROOT location so the files with the .base
# suffix are never copied.
case = self._case.get_value("CASE")
# First remove restart, history and rpointer files from the run directory
for item in glob.iglob(os.path.join(rundir, "%s.*"%case)):
if not item.endswith("base"):
os.remove(item)
for item in glob.iglob(os.path.join(rundir, "rpointer.*")):
os.remove(item)
# Then replace them from the restart directory
for item in glob.iglob(os.path.join(dout_s_root,"rest","*","*")):
shutil.copy(item, rundir)

self._ers_second_phase()

0 comments on commit 71b399e

Please sign in to comment.