Skip to content

Commit

Permalink
Make case optional for mvm diags
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 committed Nov 3, 2023
1 parent 2fbc427 commit a8c6931
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 83 deletions.
40 changes: 2 additions & 38 deletions tests/integration/generated/test_complete_run_chrysalis.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ years = "1850:1854:2",
input_subdir = "archive/atm/hist"
vars = "PRECT"

[[ atm_monthly_glb ]]
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
years = "1850:1860:5",

[[ land_monthly ]]
extra_vars = "landfrac"
frequency = "monthly"
Expand All @@ -75,6 +68,7 @@ years = "1850:1854:2",
[e3sm_diags]
active = True
grid = '180x360_aave'
keep_mvm_case_name_in_fig = True
ref_final_yr = 2014
ref_start_yr = 1985
# TODO: this directory is missing OMI-MLS
Expand All @@ -93,7 +87,7 @@ years = "1850:1854:2", "1850:1854:4",
walltime = "5:00:00"

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

Expand Down Expand Up @@ -123,33 +117,3 @@ years = "1850:1854:2", "1850:1854:4",
ts_subsection = "atm_monthly_180x360_aave"
walltime = "5:00:00"
years = "1852-1853",

[mpas_analysis]
active = True
anomalyRefYear = 1850
climo_years ="1850-1854", "1855-1860",
enso_years = "1850-1854", "1855-1860",
mesh = "EC30to60E2r2"
parallelTaskCount = 6
partition = "compute"
qos = "regular"
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"

[global_time_series]
active = True
climo_years ="1850-1854", "1855-1860",
experiment_name = "v2.LR.historical_0201"
figstr = "v2_historical_0201"
moc_file=mocTimeSeries_1850-1860.nc
ts_num_years = 5
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",

[ilamb]
active = True
grid = '180x360_aave'
short_name = 'v2.LR.historical_0201'
ts_num_years = 2
years = "1850:1854:2",
38 changes: 1 addition & 37 deletions tests/integration/template_complete_run.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ years = "1850:1854:2",
input_subdir = "archive/atm/hist"
vars = "PRECT"

[[ atm_monthly_glb ]]
frequency = "monthly"
input_files = "eam.h0"
input_subdir = "archive/atm/hist"
mapping_file = "glb"
years = "1850:1860:5",

[[ land_monthly ]]
extra_vars = "landfrac"
frequency = "monthly"
Expand All @@ -75,6 +68,7 @@ years = "1850:1854:2",
[e3sm_diags]
active = True
grid = '180x360_aave'
keep_mvm_case_name_in_fig = True
ref_final_yr = 2014
ref_start_yr = 1985
# TODO: this directory is missing OMI-MLS
Expand Down Expand Up @@ -123,33 +117,3 @@ years = "1850:1854:2", "1850:1854:4",
ts_subsection = "atm_monthly_180x360_aave"
walltime = "#expand diags_walltime#"
years = "1852-1853",

[mpas_analysis]
active = True
anomalyRefYear = 1850
climo_years ="1850-1854", "1855-1860",
enso_years = "1850-1854", "1855-1860",
mesh = "EC30to60E2r2"
parallelTaskCount = 6
partition = "#expand partition_long#"
qos = "#expand qos_long#"
ts_years = "1850-1854", "1850-1860",
walltime = "#expand mpas_analysis_walltime#"

[global_time_series]
active = True
climo_years ="1850-1854", "1855-1860",
experiment_name = "v2.LR.historical_0201"
figstr = "v2_historical_0201"
moc_file=mocTimeSeries_1850-1860.nc
ts_num_years = 5
ts_years = "1850-1854", "1850-1860",
walltime = "00:30:00"
years = "1850-1860",

[ilamb]
active = True
grid = '180x360_aave'
short_name = 'v2.LR.historical_0201'
ts_num_years = 2
years = "1850:1854:2",
2 changes: 1 addition & 1 deletion tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_chyrsalis_expansions(config):
"bundles_walltime": "07: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_20230914",
"diags_environment_commands": "source /home/ac.forsyth2/miniconda3/etc/profile.d/conda.sh; conda activate e3sm_diags_20231027v2",
"diags_walltime": "5:00:00",
"environment_commands_test": "source /lcrc/soft/climate/e3sm-unified/test_e3sm_unified_1.9.0rc16_chrysalis.sh",
"expected_dir": "/lcrc/group/e3sm/public_html/zppy_test_resources/",
Expand Down
2 changes: 2 additions & 0 deletions zppy/templates/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ dc_obs_climo = string(default="")
# See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html
# Required for run_type="model_vs_model"
diff_title = string(default="Model - Observations")
# Set this to True if the E3SM Diags model-vs-model output path should include the case name.
keep_mvm_case_name_in_fig = boolean(default=False)
# See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html
# Required for run_type="model_vs_model" "streamflow" runs
gauges_path = string(default="")
Expand Down
27 changes: 20 additions & 7 deletions zppy/templates/e3sm_diags.bash
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,19 @@ create_links_ts_rof ${ts_rof_dir_source} ${ts_rof_dir_ref} ${ref_Y1} ${ref_Y2} 8
{%- endif %}
{%- endif %}

{% if run_type == "model_vs_obs" %}
echo "A"
ref_name={{ ref_name }}
{%- endif %}
{% if (run_type == "model_vs_model") and keep_mvm_case_name_in_fig %}
echo "B"
ref_name={{ ref_name }}
{%- endif %}
{% if (run_type == "model_vs_model") and not keep_mvm_case_name_in_fig %}
echo "C"
ref_name=""
{%- endif %}

# Run E3SM Diags
echo
echo ===== RUN E3SM DIAGS =====
Expand Down Expand Up @@ -260,7 +273,7 @@ param.reference_data_path = '{{ reference_data_path }}'
{% elif run_type == "model_vs_model" %}
# Reference
param.reference_data_path = '${climo_dir_ref}'
param.ref_name = '{{ ref_name }}'
param.ref_name = '${ref_name}'
param.short_ref_name = '{{ short_ref_name }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
Expand Down Expand Up @@ -297,7 +310,7 @@ enso_param.ref_end_yr = ref_start_yr + 10
{% elif run_type == "model_vs_model" %}
# Reference
enso_param.reference_data_path = '${ts_dir_ref}'
enso_param.ref_name = '{{ ref_name }}'
enso_param.ref_name = '${ref_name}'
enso_param.short_ref_name = '{{ short_ref_name }}'
enso_param.ref_start_yr = '{{ ref_start_yr }}'
enso_param.ref_end_yr = '{{ ref_final_yr }}'
Expand Down Expand Up @@ -329,7 +342,7 @@ qbo_param.reference_data_path = '{{ obs_ts }}'
{% elif run_type == "model_vs_model" %}
# Reference
qbo_param.reference_data_path = '${ts_dir_ref}'
qbo_param.ref_name = '{{ ref_name }}'
qbo_param.ref_name = '${ref_name}'
qbo_param.short_ref_name = '{{ short_ref_name }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
Expand All @@ -353,7 +366,7 @@ ts_param.reference_data_path = '{{ obs_ts }}'
{% elif run_type == "model_vs_model" %}
# Reference
ts_param.reference_data_path = '${ts_dir_ref}'
ts_param.ref_name = '{{ ref_name }}'
ts_param.ref_name = '${ref_name}'
ts_param.short_ref_name = '{{ short_ref_name }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
Expand All @@ -376,7 +389,7 @@ dc_param.reference_data_path = '{{ dc_obs_climo }}'
{% elif run_type == "model_vs_model" %}
# Reference
dc_param.reference_data_path = '${climo_diurnal_dir_ref}'
dc_param.ref_name = '{{ ref_name }}'
dc_param.ref_name = '${ref_name}'
dc_param.short_ref_name = '{{ short_ref_name }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
Expand All @@ -402,7 +415,7 @@ streamflow_param.ref_end_yr = "1995"
{% elif run_type == "model_vs_model" %}
# Reference
streamflow_param.reference_data_path = '${ts_rof_dir_ref}'
streamflow_param.ref_name = '{{ ref_name }}'
streamflow_param.ref_name = '${ref_name}'
streamflow_param.short_ref_name = '{{ short_ref_name }}'
streamflow_param.ref_start_yr = '{{ ref_start_yr }}'
streamflow_param.ref_end_yr = '{{ ref_final_yr }}'
Expand Down Expand Up @@ -432,7 +445,7 @@ tc_param.ref_end_yr = "2018"
{% elif run_type == "model_vs_model" %}
# Reference
tc_param.reference_data_path = '{{ reference_data_path_tc }}'
tc_param.ref_name = '{{ ref_name }}'
tc_param.ref_name = '${ref_name}'
tc_param.short_ref_name = '{{ short_ref_name }}'
tc_param.ref_start_yr = '{{ ref_start_yr }}'
tc_param.ref_end_yr = '{{ ref_final_yr }}'
Expand Down

0 comments on commit a8c6931

Please sign in to comment.