Skip to content

Commit

Permalink
Fix rpointer check in buildnml (#204)
Browse files Browse the repository at this point in the history
* account for date stamps while checking whether rpointer files exist

* accomodate old rpointer file naming in builnml check
  • Loading branch information
alperaltuntas authored Nov 4, 2024
1 parent a2e713c commit 112f5ca
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,15 @@ def prechecks(case, inst_suffixes):
# check if rpointer files are present in rundir
if not testcase and (run_type != "startup" or continue_run):
for inst_suffix in inst_suffixes:
pointer_file = os.path.join(rundir, "rpointer.ocn" + inst_suffix)
rpointer_pattern = (
r"rpointer\.ocn" + inst_suffix + r"(\.\d{4}-\d{2}-\d{2}-\d{5})?$"
)
rpointer_files = [
f for f in os.listdir(rundir) if re.match(rpointer_pattern, f)
]
expect(
os.path.exists(pointer_file),
f"Missing rpointer file rpointer.ocn{inst_suffix} in rundir.",
len(rpointer_files) > 0,
f"Missing rpointer files in rundir. Expected files with pattern {rpointer_pattern}.",
)

# check if the restart file is present in rundir
Expand Down

0 comments on commit 112f5ca

Please sign in to comment.