Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for rc4 #466

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/integration/generated/test_bundles_chrysalis.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[default]
case = v2.LR.historical_0201
constraint = ""
environment_commands = ""
dry_run = "False"
environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.9.0rc9_chrysalis.sh"
input = "/lcrc/group/e3sm/ac.forsyth2/E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/generated/test_bundles_pm-cpu.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[default]
case = v2.LR.historical_0201
constraint = "cpu"
environment_commands = ""
environment_commands = "source /global/common/software/e3sm/anaconda_envs/test_e3sm_unified_1.9.0rc9_pm-cpu.sh"
input = "/global/cfs/cdirs/e3sm/forsyth/E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/generated/test_complete_run_chrysalis.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[default]
case = v2.LR.historical_0201
constraint = ""
environment_commands = ""
dry_run = "False"
environment_commands = "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.9.0rc9_chrysalis.sh"
input = "/lcrc/group/e3sm/ac.forsyth2//E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
Expand Down Expand Up @@ -92,7 +93,7 @@ years = "1850:1854:2", "1850:1854:4",
walltime = "2:00:00"

[[ atm_monthly_180x360_aave_environment_commands ]]
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_dev_20220614"
environment_commands = "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_20230731"
sets = "qbo",
ts_subsection = "atm_monthly_180x360_aave"

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/generated/test_complete_run_pm-cpu.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[default]
case = v2.LR.historical_0201
constraint = "cpu"
environment_commands = ""
environment_commands = "source /global/common/software/e3sm/anaconda_envs/test_e3sm_unified_1.9.0rc9_pm-cpu.sh"
input = "/global/cfs/cdirs/e3sm/forsyth//E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
mapping_file = "map_ne30pg2_to_cmip6_180x360_aave.20200201.nc"
Expand Down Expand Up @@ -92,7 +92,7 @@ years = "1850:1854:2", "1850:1854:4",
walltime = "6:00:00"

[[ atm_monthly_180x360_aave_environment_commands ]]
environment_commands = "source /global/homes/f/forsyth/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_dev_20220715"
environment_commands = "source /global/homes/f/forsyth/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_20230728"
sets = "qbo",
ts_subsection = "atm_monthly_180x360_aave"

Expand Down
1 change: 1 addition & 0 deletions tests/integration/template_bundles.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[default]
case = v2.LR.historical_0201
constraint = "#expand constraint#"
dry_run = "#expand dry_run#"
environment_commands = "#expand environment_commands#"
input = "#expand user_input#E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
Expand Down
1 change: 1 addition & 0 deletions tests/integration/template_complete_run.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[default]
case = v2.LR.historical_0201
constraint = "#expand constraint#"
dry_run = "#expand dry_run#"
environment_commands = "#expand environment_commands#"
input = "#expand user_input#/E3SMv2/v2.LR.historical_0201"
input_subdir = archive/atm/hist
Expand Down
17 changes: 11 additions & 6 deletions tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ def get_chyrsalis_expansions(config):
"bundles_walltime": "02:00:00",
"constraint": "",
# To run this test, replace conda environment with your e3sm_diags dev environment
"diags_environment_commands": "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_dev_20220614",
"diags_environment_commands": "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_20230731",
"diags_walltime": "2:00:00",
"environment_commands_test": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.8.0rc6_chrysalis.sh",
"environment_commands_test": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.9.0rc9_chrysalis.sh",
"expected_dir": "/lcrc/group/e3sm/public_html/zppy_test_resources/",
"partition_long": "compute",
"partition_short": "debug",
Expand Down Expand Up @@ -182,9 +182,9 @@ def get_perlmutter_expansions(config):
"bundles_walltime": "6:00:00",
"constraint": "cpu",
# To run this test, replace conda environment with your e3sm_diags dev environment
"diags_environment_commands": "source /global/homes/f/forsyth/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_dev_20220715",
"diags_environment_commands": "source /global/homes/f/forsyth/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_20230728",
"diags_walltime": "6:00:00",
"environment_commands_test": "source /global/common/software/e3sm/anaconda_envs/test_e3sm_unified_1.8.0rc6_pm-cpu.sh",
"environment_commands_test": "source /global/common/software/e3sm/anaconda_envs/test_e3sm_unified_1.9.0rc9_pm-cpu.sh",
"expected_dir": "/global/cfs/cdirs/e3sm/www/zppy_test_resources/",
"partition_long": "",
"partition_short": "",
Expand Down Expand Up @@ -231,7 +231,7 @@ def substitute_expansions(expansions, file_in, file_out):
file_write.write(line)


def generate_cfgs(unified_testing=False):
def generate_cfgs(unified_testing=False, dry_run=False):
git_top_level = (
subprocess.check_output("git rev-parse --show-toplevel".split())
.strip()
Expand All @@ -246,6 +246,11 @@ def generate_cfgs(unified_testing=False):
expansions["environment_commands"] = ""
machine = expansions["machine"]

if dry_run:
expansions["dry_run"] = "True"
else:
expansions["dry_run"] = "False"

cfg_names = ["bundles", "complete_run"]
for cfg_name in cfg_names:
cfg_template = f"{git_top_level}/tests/integration/template_{cfg_name}.cfg"
Expand All @@ -268,4 +273,4 @@ def generate_cfgs(unified_testing=False):


if __name__ == "__main__":
generate_cfgs()
generate_cfgs(unified_testing=True)
3 changes: 2 additions & 1 deletion zppy/templates/coupled_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def getmoc(dir_in):
fin = Dataset(files[i], "r")
time0 = fin["year"][:]
var0 = fin["mocAtlantic26"][:]
for iyear in range(np.int(time0[0]), np.int(time0[-1]) + 1):
for iyear in range(int(time0[0]), int(time0[-1]) + 1):
if i > 0 and iyear <= time[-1]:
print(
"the amoc value for year",
Expand Down Expand Up @@ -613,6 +613,7 @@ def run(parameters, rgn): # noqa: C901
pdf = matplotlib.backends.backend_pdf.PdfPages(f"{figstr}_{rgn}.pdf")
for page in range(num_pages):
fig = plt.figure(1, figsize=[13.5, 16.5])
fig.suptitle(f"{figstr}_{rgn}")
for j in range(plots_per_page):
if i < num_plots:
ax = plt.subplot(nrows, ncols, j + 1)
Expand Down