Skip to content

Commit 112f5ca

Browse files
Fix rpointer check in buildnml (#204)
* account for date stamps while checking whether rpointer files exist * accomodate old rpointer file naming in builnml check
1 parent a2e713c commit 112f5ca

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cime_config/buildnml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,15 @@ def prechecks(case, inst_suffixes):
388388
# check if rpointer files are present in rundir
389389
if not testcase and (run_type != "startup" or continue_run):
390390
for inst_suffix in inst_suffixes:
391-
pointer_file = os.path.join(rundir, "rpointer.ocn" + inst_suffix)
391+
rpointer_pattern = (
392+
r"rpointer\.ocn" + inst_suffix + r"(\.\d{4}-\d{2}-\d{2}-\d{5})?$"
393+
)
394+
rpointer_files = [
395+
f for f in os.listdir(rundir) if re.match(rpointer_pattern, f)
396+
]
392397
expect(
393-
os.path.exists(pointer_file),
394-
f"Missing rpointer file rpointer.ocn{inst_suffix} in rundir.",
398+
len(rpointer_files) > 0,
399+
f"Missing rpointer files in rundir. Expected files with pattern {rpointer_pattern}.",
395400
)
396401

397402
# check if the restart file is present in rundir

0 commit comments

Comments
 (0)