Skip to content
Draft
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
1 change: 1 addition & 0 deletions zppy/e3sm_diags.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def e3sm_diags(config, scriptDir, existing_bundles, job_ids_file): # noqa: C901
("enso_diags" in c["sets"])
or ("qbo" in c["sets"])
or ("area_mean_time_series" in c["sets"])
or ("mp_partition" in c["sets"])
):
dependencies.append(
os.path.join(
Expand Down
26 changes: 25 additions & 1 deletion zppy/templates/e3sm_diags.bash
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ create_links_climo_diurnal ${climo_diurnal_dir_source} ${climo_diurnal_dir_ref}
{%- endif %}
{%- endif %}

{%- if ("enso_diags" in sets) or ("qbo" in sets) or ("area_mean_time_series" in sets) %}
{%- if ("enso_diags" in sets) or ("qbo" in sets) or ("mp_partition" in sets) or ("area_mean_time_series" in sets) %}
{% if run_type == "model_vs_obs" %}
ts_dir_primary=ts
{% elif run_type == "model_vs_model" %}
Expand All @@ -206,6 +206,7 @@ create_links_ts ${ts_dir_source} ${ts_dir_ref} ${ref_Y1} ${ref_Y2} 6
{%- endif %}
{%- endif %}


{%- if "streamflow" in sets %}
{% if run_type == "model_vs_obs" %}
ts_rof_dir_primary=rof
Expand Down Expand Up @@ -262,6 +263,9 @@ from e3sm_diags.parameter.tc_analysis_parameter import TCAnalysisParameter
{%- if "lat_lon_land" in sets %}
from e3sm_diags.parameter.lat_lon_land_parameter import LatLonLandParameter
{%- endif %}
{%- if "mp_partition" in sets %}
from e3sm_diags.parameter.mp_partition_parameter import MPpartitionParameter
{%- endif %}


from e3sm_diags.run import runner
Expand Down Expand Up @@ -417,6 +421,26 @@ if {{ swap_test_ref }}:
params.append(ts_param)
{%- endif %}

{%- if "mp_partition" in sets %}
mp_param = MPpartitionParameter()
mp_param.test_data_path = '${ts_dir_source}'
mp_param.test_name = short_name
mp_param.test_start_yr = start_yr
mp_param.test_end_yr = end_yr
{% if run_type == "model_vs_model" %}
# Reference
mp_param.reference_data_path = '${ts_dir_ref}'
mp_param.ref_name = '${ref_name}'
mp_param.short_ref_name = '{{ short_ref_name }}'
# Optionally, swap test and reference model
if {{ swap_test_ref }}:
mp_param.test_data_path, mp_param.reference_data_path = mp_param.reference_data_path, mp_param.test_data_path
mp_param.test_name, mp_param.ref_name = mp_param.ref_name, mp_param.test_name
mp_param.short_test_name, mp_param.short_ref_name = mp_param.short_ref_name, mp_param.short_test_name
{%- endif %}
params.append(mp_param)
{%- endif %}

{%- if "diurnal_cycle" in sets %}
dc_param = DiurnalCycleParameter()
dc_param.test_data_path = '${climo_diurnal_dir_primary}'
Expand Down
5 changes: 5 additions & 0 deletions zppy/templates/ts.bash
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ vars={{ vars }}
# https://stackoverflow.com/questions/26457052/remove-a-substring-from-a-bash-variable
# Remove U, since it is a 3D variable and thus will not work with rgn_avg
vars=${vars//,U}
# Remove more 3D variables:
vars=${vars//,T}
vars=${vars//,CLDICE}
vars=${vars//,CLDLIQ}

{%- else %}
vars={{ vars }}
{%- endif %}
Expand Down