Skip to content

Commit

Permalink
Add link_to_ADF.ipynb to key_metrics
Browse files Browse the repository at this point in the history
Future PRs will update examples/key_metrics/config.yml to change the ADF
configuration
  • Loading branch information
mnlevy1981 committed Nov 21, 2024
1 parent 04200ef commit b45ae1f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/external_diag_packages/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ compute_notebooks:
kernel_name: cupid-dev
parameter_groups:
none:
adf_root: ../../external_diag_packages/ADF/
adf_root: ../../external_diag_packages/ADF_output/
case_year_range: "1_100"
base_case_year_range: "1995_2006"
external_tool:
Expand Down
3 changes: 2 additions & 1 deletion examples/key_metrics/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,14 @@ compute_notebooks:
kernel_name: cupid-dev
parameter_groups:
none:
adf_root: ../../external_diag_packages/ADF/
adf_root: ../../key_metrics/ADF_output/
case_year_range: "1_100"
base_case_year_range: "1_100"
external_tool:
tool_name: 'ADF'
vars: ['PRECT', 'SST']
plotting_scripts: ["global_latlon_map", "global_latlon_vect_map"]
base_regridded_output: True

glc:
Greenland_SMB_visual_compare_obs:
Expand Down
37 changes: 37 additions & 0 deletions helper_scripts/generate_adf_config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ def generate_adf_config(cesm_root, cupid_example, adf_file, out_file):
"proc",
"climo",
)
# UPDATE PATHS FOR REGRIDDED DATA
try:
if c_dict["compute_notebooks"]["atm"]["link_to_ADF"]["external_tool"][
"regridded_output"
]:
a_dict["diag_cam_climo"]["cam_hist_loc"] = os.path.join(
a_dict["diag_cam_climo"]["cam_hist_loc"],
"regrid",
)
a_dict["diag_cam_climo"]["cam_ts_loc"] = os.path.join(
a_dict["diag_cam_climo"]["cam_ts_loc"],
"regrid",
)
a_dict["diag_cam_climo"]["cam_climo_loc"] = os.path.join(
a_dict["diag_cam_climo"]["cam_climo_loc"],
"regrid",
)
except: # noqa: E722
pass
# TEST CASE START / END YEARS
test_case_cupid_ts_index = (
ts_case_names.index(test_case_name) if test_case_name in ts_case_names else None
Expand Down Expand Up @@ -158,6 +177,24 @@ def generate_adf_config(cesm_root, cupid_example, adf_file, out_file):
"proc",
"climo",
)
try:
if c_dict["compute_notebooks"]["atm"]["link_to_ADF"]["external_tool"][
"base_regridded_output"
]:
a_dict["diag_cam_baseline_climo"]["cam_hist_loc"] = os.path.join(
a_dict["diag_cam_baseline_climo"]["cam_hist_loc"],
"regrid",
)
a_dict["diag_cam_baseline_climo"]["cam_ts_loc"] = os.path.join(
a_dict["diag_cam_baseline_climo"]["cam_ts_loc"],
"regrid",
)
a_dict["diag_cam_baseline_climo"]["cam_climo_loc"] = os.path.join(
a_dict["diag_cam_baseline_climo"]["cam_climo_loc"],
"regrid",
)
except: # noqa: E722
pass
a_dict["diag_cam_baseline_climo"]["start_year"] = base_start_date
a_dict["diag_cam_baseline_climo"]["end_year"] = base_end_date

Expand Down

0 comments on commit b45ae1f

Please sign in to comment.