Skip to content

Commit

Permalink
fix a merge error in geomar branch
Browse files Browse the repository at this point in the history
  • Loading branch information
seb-wahl committed Nov 25, 2024
1 parent f33fa89 commit 0ce9f6e
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions src/esm_runscripts/oasis.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,42 +563,11 @@ def add_restart_files(self, restart_file_label, fconfig):
# check if restart file with ini_restart_date in filename is in the restart
# folder of the parent experiment to be branched off from:
glob_search_file = (
f"{config['ini_restart_dir']}{restart_file}_????????-"
f"{config['ini_restart_dir']}{restart_file}*"
f"{config['ini_restart_date'].year}"
f"{config['ini_restart_date'].month:02}"
f"{config['ini_restart_date'].day:02}"
)
glob_restart_file = glob.glob(glob_search_file)
glob_restart_file.sort()
if restart_file and is_runtime:
# If there are more than one file found let the user decide which one to take
if len(glob_restart_file) == 1:
restart_file = os.path.basename(glob_restart_file[0])
elif len(glob_restart_file) == 0:
# in case config["restart_in_sources"] are given explicitely
# and are not absolute paths as e.g in FOCI
# ini_parent_dir: "${general.ini_parent_dir}/oasis3mct/"
# restart_in_sources: sstocean_${parent_expid}_...
# we need to check for the full path as well
# a nightmare to track this down
restart_file = f"{config['ini_restart_dir']}/{restart_file}"
if not os.path.isfile(restart_file):
user_error(
"Restart file missing",
f"No OASIS restart file for ``{restart_file}`` found "
f"matching the pattern ``{glob_search_file}``"
)
else:
if not gconfig["isinteractive"]:
# If more than one restart file found that matches ini_restart_date,
# ask the user to select from the result list:
message = (
"More than one OASIS restart file was found for "
"your branchoff experiment that matches the "
"ini_restart_date you selected. Please select "
"one of the following OASIS restart files:"
)
else:
glob_search_file = restart_file_path

Expand Down

0 comments on commit 0ce9f6e

Please sign in to comment.