Skip to content

Commit a8cfe5e

Browse files
committed
revert src changes for later merge with #1138 after testing
1 parent 3edb67b commit a8cfe5e

File tree

2 files changed

+11
-20
lines changed

2 files changed

+11
-20
lines changed

src/esm_environment/esm_environment.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,8 @@ def write_dummy_script(self, include_set_e=True):
548548
print('WARNING: "sh_interpreter" not defined in the machine yaml')
549549
with open("dummy_script.sh", "w") as script_file:
550550
# Write the file headings
551-
#script_file.write(
552-
# f'#!{self.config.get("sh_interpreter", "/bin/bash")} -l\n'
553-
#)
554551
script_file.write(
555-
f'#!{self.config.get("sh_interpreter", "/bin/bash")}\n'
552+
f'#!{self.config.get("sh_interpreter", "/bin/bash")} -l\n'
556553
)
557554
script_file.write(
558555
"# Dummy script generated by esm-tools, to be removed later: \n"

src/esm_runscripts/oasis.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ def __init__(
4545
self.namcouple += [" $NBMODEL", " " + str(exec_entry), " $END"]
4646
self.namcouple += [" $RUNTIME", " " + str(runtime), " $END"]
4747
if lucia:
48-
# LUCIA (load balancing) is done differently in MCT 5.0
49-
if mct_version >= (5,0):
50-
# In MCT5 you set X Y Z, where X refers to verbosity, Y to timing info and Z to load balancing
51-
# Here: Set X = debug_level, Y = 0 (no info), Z = 1 (activate load balancing)
52-
self.namcouple += [" $NLOGPRT", " " + str(debug_level) + " 0 1 ", " $END"]
48+
if mct_version >= (5, 0):
49+
self.namcouple += [" $NLOGPRT", " " + str(debug_level) + " 0 1", " $END"]
5350
else:
5451
self.namcouple += [" $NLOGPRT", " " + "1 -1", " $END"]
5552
else:
@@ -543,9 +540,12 @@ def add_restart_files(self, restart_file_label, fconfig):
543540
config["restart_in_in_work"][restart_file_label] = restart_file
544541

545542
# In case of a branch-off experiment -> use the correct oasis restart files:
546-
# Not the rstas.nc soft link to the last, but the actual one for the
547-
# branch-off date
548-
if gconfig["run_number"] == 1 and config["lresume"] and gconfig["jobtype"] == "prepcompute" and config.get("norestart", "F") == "F":
543+
# Not the soft link to the last, but the actual one for the branch-off date
544+
if (
545+
gconfig["run_number"] == 1
546+
and config["lresume"]
547+
and gconfig["jobtype"] == "prepcompute"
548+
):
549549
# If they do not exist, define ``ini_restart_date`` and ``ini_restart_dir``
550550
# based on ``ini_parent_date`` and ``ini_parent_dir``
551551
if "ini_parent_date" in config and "ini_restart_date" not in config:
@@ -561,7 +561,7 @@ def add_restart_files(self, restart_file_label, fconfig):
561561
# check if restart file with ini_restart_date in filename is in the restart
562562
# folder of the parent experiment to be branched off from:
563563
glob_search_file = (
564-
f"{config['ini_restart_dir']}{restart_file}*"
564+
f"{restart_file_path}*"
565565
f"{config['ini_restart_date'].year}"
566566
f"{config['ini_restart_date'].month:02}"
567567
f"{config['ini_restart_date'].day:02}"
@@ -577,13 +577,7 @@ def add_restart_files(self, restart_file_label, fconfig):
577577
restart_file = os.path.basename(glob_restart_file[0])
578578
elif len(glob_restart_file) == 0:
579579
restart_file = restart_file_path
580-
# in case config["restart_in_sources"] are given explicitely
581-
# AND are not absolute paths as e.g in FOCI
582-
# ini_parent_dir: "${general.ini_parent_dir}/oasis3mct/"
583-
# restart_in_sources: sstocean_${parent_expid}_...
584-
# we need to check for the full path as well
585-
# btw it was a nightmare to track this down
586-
if not os.path.isfile(restart_file) and not os.path.isfile(f"{config['ini_restart_dir']}/{restart_file}"):
580+
if not os.path.isfile(restart_file):
587581
user_error(
588582
"Restart file missing",
589583
f"No OASIS restart file for ``{restart_file_label}`` found "

0 commit comments

Comments
 (0)