Skip to content

Commit 962a851

Browse files
committed
Add new parameter to formatting
1 parent 93aa843 commit 962a851

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

detclim/results_plot.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"""Plot the results of bootstrapping tests.
2-
"""
1+
"""Plot the results of bootstrapping tests."""
2+
33
from pathlib import Path
44

55
import matplotlib.pyplot as plt
@@ -30,6 +30,15 @@ def fmt_case(case):
3030
elif "new" in case:
3131
num = float(case.replace("new-", "").replace("pct", "").replace("p", "."))
3232
_out = f"new {num:.1f}%"
33+
elif "c0" in case:
34+
num = float(
35+
case.split("-")[1]
36+
.replace("pct", "")
37+
.replace("p", ".")
38+
.replace("-2mo", "")
39+
.replace("_ts40", "")
40+
)
41+
_out = f"zmconv_c0_ocn {num:.1f}%"
3342
elif "c1" in case:
3443
num = float(
3544
case.split("-")[1]

run_scripts/create_run.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def set_tasks(ninst, case_dir):
2121
if ntasks == 1:
2222
os.system(f"./xmlchange NTASKS_{comp}={ntasks * ninst}")
2323
else:
24-
os.system(f"./xmlchange NTASKS_{comp}={ntasks * ninst / 3}")
24+
os.system(f"./xmlchange NTASKS_{comp}={ntasks * ninst // 3}")
2525

2626
if comp != "CPL":
2727
os.system(f"./xmlchange NINST_{comp}={ninst}")
@@ -60,16 +60,16 @@ def main(build_case=False, run_case=False):
6060
# Surround variable names in single quotes (e.g. T -> 'T')
6161
output_vars = [f"'{_var}'" for _var in output_vars["default"]]
6262

63-
ninst = 120
63+
ninst = 30
6464
compset = "F2010"
6565
grid = "ne4_oQU240"
6666
mach = "chrysalis"
6767
# mach = "anvil"
6868
nhtfrq = None
6969
compiler = "intel"
7070
today = dt.datetime.now().strftime("%Y%m%d")
71-
# branch = "maint-2.0"
72-
branch = "master"
71+
branch = "maint-2.0"
72+
# branch = "master"
7373
plim = 1e-10
7474

7575
# zmconv_c0 = 0.0022
@@ -97,7 +97,7 @@ def main(build_case=False, run_case=False):
9797
str(Path(cime_scripts_dir, "create_newcase")),
9898
f"--compset {compset}",
9999
f"--res {grid}",
100-
"--walltime 03:00:00",
100+
"--walltime 02:00:00",
101101
f"--case {case}",
102102
f"--machine {mach}",
103103
f"--ninst {ninst}",
@@ -141,7 +141,7 @@ def main(build_case=False, run_case=False):
141141
nl_atm_file.write("new_random = .true.\n")
142142
nl_atm_file.write(f"pertlim = {plim}\n")
143143
nl_atm_file.write("seed_custom = {}\n".format(iinst))
144-
nl_atm_file.write("seed_clock = .false.\n")
144+
nl_atm_file.write("seed_clock = .true.\n")
145145

146146
if nhtfrq is not None:
147147
nl_atm_file.write(f"nhtfrq = {nhtfrq}\n")
@@ -190,4 +190,4 @@ def main(build_case=False, run_case=False):
190190

191191

192192
if __name__ == "__main__":
193-
main(True, True)
193+
main(True, False)

0 commit comments

Comments
 (0)