File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -399,10 +399,13 @@ def prechecks(case, inst_suffixes):
399399 f"Missing rpointer files in rundir. Expected files with pattern { rpointer_pattern } ." ,
400400 )
401401
402- # check if the restart file is present in rundir
402+ # check if the restart file is present in rundir for fresh branch or hybrid runs
403403 if run_type in ["branch" , "hybrid" ] and not continue_run and not get_refcase :
404- restart_file = os .path .join (rundir , f'./{ run_refcase } .mom6.r.{ run_refdate } -{ run_reftod } .nc' )
405- assert os .path .exists (restart_file ), f"Missing restart file { run_refcase } .mom6.r.{ run_refdate } -{ run_reftod } .nc in rundir."
404+ restart_file_pattern = run_refcase + r".mom6.*.r." + run_refdate + "-" + run_reftod + r".*nc$"
405+ restart_files = [
406+ f for f in os .listdir (rundir ) if re .match (restart_file_pattern , f )
407+ ]
408+ assert len (restart_files ) > 0 , f"Missing restart file in rundir. Expected file matching pattern { restart_file_pattern } ."
406409
407410def postchecks (case , MOM_input_final ):
408411 """Performs checks after input files are generated. To be called within prep_input() as a final step."""
You can’t perform that action at this time.
0 commit comments