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

Use ref_final_yr for model vs model #668

Merged
merged 3 commits into from
Feb 4, 2025
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
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In zppy/templates/e3sm_diags.bash, we have:

{% if run_type == "model_vs_obs" %}
# Obs
trop_param.reference_data_path = '{{ obs_ts }}'
trop_param.ref_start_yr = 2001
trop_param.ref_end_yr = 2010

Those are hard coded, so we're good to delete this check here, yes

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}'
Comment on lines -290 to -291
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are always put in as 4-digit years, so this change should be ok

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
Loading