Skip to content

Commit

Permalink
Merge pull request #668 from E3SM-Project/fix_ref_end_yr_v3rc2
Browse files Browse the repository at this point in the history
Use ref_final_yr for model vs model
  • Loading branch information
forsyth2 authored Feb 4, 2025
2 parents 50cf94d + 7dd8855 commit 1f4dd5e
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ multiprocessing = True
num_workers = 8
partition = "compute"
qos = "regular"
ref_end_yr = 1981
ref_final_yr = 1981
ref_start_yr = 1980
ref_years = "1980-1981",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ multiprocessing = True
num_workers = 8
partition = "compute"
qos = "regular"
ref_end_yr = 1986
ref_final_yr = 1986
ref_start_yr = 1985
ref_years = "1985-1986",
Expand Down
1 change: 0 additions & 1 deletion tests/integration/template_weekly_comprehensive_v2.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ multiprocessing = True
num_workers = 8
partition = "#expand partition_long#"
qos = "#expand qos_long#"
ref_end_yr = 1981
ref_final_yr = 1981
ref_start_yr = 1980
ref_years = "1980-1981",
Expand Down
1 change: 0 additions & 1 deletion tests/integration/template_weekly_comprehensive_v3.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ multiprocessing = True
num_workers = 8
partition = "#expand partition_long#"
qos = "#expand qos_long#"
ref_end_yr = 1986
ref_final_yr = 1986
ref_start_yr = 1985
ref_years = "1985-1986",
Expand Down
7 changes: 0 additions & 7 deletions tests/test_zppy_e3sm_diags.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ def test_check_parameters_for_bash():
with pytest.raises(ParameterNotProvidedError):
check_parameters_for_bash(c)

# tropical_subseasonal
c = {"sets": ["tropical_subseasonal"], "ref_end_yr": "2000"}
check_parameters_for_bash(c)
c = {"sets": ["tropical_subseasonal"], "ref_end_yr": ""}
with pytest.raises(ParameterNotProvidedError):
check_parameters_for_bash(c)


def test_check_mvm_only_parameters_for_bash():
z0 = {"diff_title": "a", "ref_name": "b", "short_ref_name": "c"}
Expand Down
4 changes: 0 additions & 4 deletions zppy/defaults/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ obs_ts = string(default="")
output_format = string_list(default=list("png"))
# See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html
output_format_subplot = string_list(default=list())
# End year (i.e., the last year to use) for the reference data
# Required for "tropical_subseasonal" runs
ref_end_yr = string(default="")
# Final year (i.e., the last available year) for the reference data
# Required for "qbo" runs
# Required for run_type="model_vs_model" "enso_diags"/"streamflow"/"tc_analysis"/"tropical_subseasonal" runs
Expand Down Expand Up @@ -252,7 +249,6 @@ ts_daily_subsection = string(default="")
obs_ts = string(default=None)
output_format = string_list(default=None)
output_format_subplot = string_list(default=None)
ref_end_yr = string(default=None)
ref_final_yr = string(default=None)
ref_name = string(default=None)
ref_start_yr = string(default=None)
Expand Down
1 change: 0 additions & 1 deletion zppy/e3sm_diags.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def e3sm_diags(config: ConfigObj, script_dir: str, existing_bundles, job_ids_fil

def check_parameters_for_bash(c: Dict[str, Any]) -> None:
# Check parameters that aren't used until e3sm_diags.bash is run
check_required_parameters(c, set(["tropical_subseasonal"]), "ref_end_yr")
check_required_parameters(c, set(["qbo"]), "ref_final_yr")
check_required_parameters(c, set(["enso_diags", "qbo"]), "ref_start_yr")
check_required_parameters(c, set(["diurnal_cycle"]), "climo_diurnal_frequency")
Expand Down
10 changes: 4 additions & 6 deletions zppy/templates/e3sm_diags.bash
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ params.append(enso_param)
trop_param = TropicalSubseasonalParameter()
trop_param.test_data_path = '${ts_daily_dir}'
trop_param.test_name = short_name
trop_param.test_start_yr = f'{start_yr:04}'
trop_param.test_end_yr = f'{end_yr:04}'
trop_param.test_start_yr = start_yr
trop_param.test_end_yr = end_yr
{% if run_type == "model_vs_obs" %}
# Obs
trop_param.reference_data_path = '{{ obs_ts }}'
Expand All @@ -298,10 +298,8 @@ trop_param.ref_end_yr = 2010
trop_param.reference_data_path = '${ts_daily_dir_ref}'
trop_param.ref_name = '${ref_name}'
trop_param.short_ref_name = '{{ short_ref_name }}'
ref_start_yr = {{ ref_start_yr }}
ref_end_yr = {{ ref_end_yr }}
trop_param.ref_start_yr = f'{ref_start_yr:04}'
trop_param.ref_end_yr = f'{ref_end_yr:04}'
trop_param.ref_start_yr = '{{ ref_start_yr }}'
trop_param.ref_end_yr = '{{ ref_final_yr }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
trop_param.test_data_path, trop_param.reference_data_path = trop_param.reference_data_path, trop_param.test_data_path
Expand Down

0 comments on commit 1f4dd5e

Please sign in to comment.