Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
forsyth2 committed Oct 27, 2023
1 parent 46a556d commit f8e6174
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
4 changes: 2 additions & 2 deletions zppy/templates/default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ diff_title = string(default="Model - Observations")
gauges_path = string(default="")
# See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html
multiprocessing = boolean(default=True)
# Set this to True if the climo links do not include the case.
no_case = boolean(default=False)
# Set this to True if the E3SM Diags output paths should not include the case.
no_case_name_in_fig = boolean(default=False)
# See https://e3sm-project.github.io/e3sm_diags/_build/html/master/available-parameters.html
num_workers = integer(default=24)
# Path to observation data for most time-series-required ("enso_diags","qbo","area_mean_time_series") runs
Expand Down
37 changes: 16 additions & 21 deletions zppy/templates/e3sm_diags.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ short="{{ short_name }}"
www="{{ www }}"
y1={{ year1 }}
y2={{ year2 }}
if [ {{ no_case_name_in_fig }} ]; then
ref_name=""
else
ref_name={{ ref_name }}
fi
Y1="{{ '%04d' % (year1) }}"
Y2="{{ '%04d' % (year2) }}"
{% if run_type == "model_vs_model" %}
Expand All @@ -53,11 +58,7 @@ create_links_climo()
error_num=$6
mkdir -p ${climo_dir_destination}
cd ${climo_dir_destination}
if [ {{ no_case }} ]; then
cp -s ${climo_dir_source}/*_${begin_year}??_${end_year}??_climo.nc .
else
cp -s ${climo_dir_source}/${nc_prefix}_*_${begin_year}??_${end_year}??_climo.nc .
fi
cp -s ${climo_dir_source}/${nc_prefix}_*_${begin_year}??_${end_year}??_climo.nc .
if [ $? != 0 ]; then
cd {{ scriptDir }}
echo "ERROR (${error_num})" > {{ prefix }}.status
Expand All @@ -76,11 +77,7 @@ create_links_climo_diurnal()
error_num=$6
mkdir -p ${climo_diurnal_dir_destination}
cd ${climo_diurnal_dir_destination}
if [ {{ no_case }} ]; then
cp -s ${climo_diurnal_dir_source}/{{ climo_diurnal_input_files }}_*_${begin_year}??_${end_year}??_climo.nc .
else
cp -s ${climo_diurnal_dir_source}/${nc_prefix}.{{ climo_diurnal_input_files }}_*_${begin_year}??_${end_year}??_climo.nc .
fi
cp -s ${climo_diurnal_dir_source}/${nc_prefix}.{{ climo_diurnal_input_files }}_*_${begin_year}??_${end_year}??_climo.nc .
if [ $? != 0 ]; then
cd {{ scriptDir }}
echo "ERROR (${error_num})" > {{ prefix }}.status
Expand Down Expand Up @@ -154,13 +151,12 @@ climo_dir_primary=climo_test
{%- endif %}
# Create local links to input climo files
climo_dir_source={{ output }}/post/atm/{{ grid }}/clim/{{ '%dyr' % (year2-year1+1) }}
# Note: the `no-case` parameter will ignore `${case}`.
create_links_climo ${climo_dir_source} ${climo_dir_primary} ${case} ${Y1} ${Y2} 1
{% if run_type == "model_vs_model" %}
# Create local links to input climo files (ref model)
climo_dir_source={{ reference_data_path }}/{{ '%dyr' % (ref_year2-ref_year1+1) }}
climo_dir_ref=climo_ref
create_links_climo ${climo_dir_source} ${climo_dir_ref} {{ ref_name }} ${ref_Y1} ${ref_Y2} 2
create_links_climo ${climo_dir_source} ${climo_dir_ref} ${ref_name} ${ref_Y1} ${ref_Y2} 2
{%- endif %}
{%- endif %}

Expand All @@ -172,13 +168,12 @@ climo_diurnal_dir_primary=climo_{{ climo_diurnal_frequency }}_test
{%- endif %}
# Create local links to input diurnal cycle climo files
climo_diurnal_dir_source={{ output }}/post/atm/{{ grid }}/clim_{{ climo_diurnal_frequency }}/{{ '%dyr' % (year2-year1+1) }}
# Note: the `no-case` parameter will ignore `${case}`.
create_links_climo_diurnal ${climo_diurnal_dir_source} ${climo_diurnal_dir_primary} ${case} ${Y1} ${Y2} 3
{% if run_type == "model_vs_model" %}
# Create local links to input climo files (ref model)
climo_diurnal_dir_source={{ reference_data_path_climo_diurnal }}/{{ '%dyr' % (ref_year2-ref_year1+1) }}
climo_diurnal_dir_ref=climo_diurnal_ref
create_links_climo_diurnal ${climo_diurnal_dir_source} ${climo_diurnal_dir_ref} {{ ref_name }} ${ref_Y1} ${ref_Y2} 4
create_links_climo_diurnal ${climo_diurnal_dir_source} ${climo_diurnal_dir_ref} ${ref_name} ${ref_Y1} ${ref_Y2} 4
{%- endif %}
{%- endif %}

Expand Down Expand Up @@ -270,7 +265,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 @@ -307,7 +302,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 @@ -339,7 +334,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 @@ -363,7 +358,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 @@ -386,7 +381,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 @@ -412,7 +407,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 @@ -442,7 +437,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 f8e6174

Please sign in to comment.