Skip to content

Commit

Permalink
Merge branch 'main' into seaice
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing authored Feb 24, 2025
2 parents 473bb0b + 0cf7823 commit eea8f4a
Show file tree
Hide file tree
Showing 19 changed files with 673 additions and 320 deletions.
21 changes: 17 additions & 4 deletions cupid/cupid_webpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
from __future__ import annotations

import os
import shutil
import subprocess

Expand Down Expand Up @@ -54,10 +55,22 @@ def build(config_path):
].get("tool_name")
== "ADF"
):
shutil.copytree(
f"{run_dir}/ADF_output",
f"{run_dir}/computed_notebooks/_build/html/ADF",
)
if os.path.exists(f"{run_dir}/ADF_output"):
shutil.copytree(
f"{run_dir}/ADF_output",
f"{run_dir}/computed_notebooks/_build/html/ADF",
)
elif (
control["compute_notebooks"][component][notebook][
"external_tool"
].get("tool_name")
== "ILAMB"
):
if os.path.exists(f"{run_dir}/ILAMB_output"):
shutil.copytree(
f"{run_dir}/ILAMB_output",
f"{run_dir}/computed_notebooks/_build/html/ILAMB",
)

# Originally used this code to copy jupyter book HTML to a location to host it online

Expand Down
2 changes: 2 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*/ADF_output
*/ILAMB_output
*/model_setup.txt
81 changes: 18 additions & 63 deletions examples/external_diag_packages/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,20 @@ computation_config:
# All parameters under global_params get passed to all the notebooks

global_params:
case_name: 'b.e30_beta02.BLT1850.ne30_t232.104'
base_case_name: 'f.e23_alpha17f.FLTHIST_ne30.roughtopo.099'
case_name: 'f.e23_alpha17f.FLTHIST_ne30.roughtopo.099'
base_case_name: 'b.e30_beta02.BLT1850.ne30_t232.104'
CESM_output_dir: /glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing
start_date: '0001-01-01'
end_date: '0101-01-01'
obs_data_dir: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data'
lc_kwargs:
threads_per_worker: 1

timeseries:
num_procs: 8
ts_done: [False, False]
overwrite_ts: [False, False]
case_name: ['b.e30_beta02.BLT1850.ne30_t232.104', 'f.e23_alpha17f.FLTHIST_ne30.roughtopo.099']
case_name: ['f.e23_alpha17f.FLTHIST_ne30.roughtopo.099','b.e30_beta02.BLT1850.ne30_t232.104']

atm:
vars: ['PSL']
Expand Down Expand Up @@ -115,58 +116,24 @@ compute_notebooks:
parameter_groups:
none:
adf_root: ../../examples/external_diag_packages/ADF_output/
key_plots: ["Surface_Wind_Stress_ANN_LatLon_Vector_Mean.png", "PRECT_ANN_LatLon_Mean.png", "PS_DJF_SHPolar_Mean.png", "TaylorDiag_ANN_Special_Mean.png"]
external_tool:
tool_name: 'ADF'
vars: ['PRECT', 'SST']
plotting_scripts: ["global_latlon_map", "global_latlon_vect_map"]
analysis_scripts: ["amwg_table"]
base_regridded_output: True

# glc:
# LIWG_SMB_diagnostic:
# parameter_groups:
# none:
# obs_path: '/glade/u/home/gunterl/obs_diagnostic_cesm/'
# obs_name: 'GrIS_MARv3.12_climo_1960_1999.nc'
# climo_nyears: 40

# ice:
# seaice:
# parameter_groups:
# none:
# cases:
# - g.e23_a16g.GJRAv4.TL319_t232_hycom1_N75.2024.005
# - g.e23_a16g.GJRAv4.TL319_t232_zstar_N65.2024.004
# begyr1: 245
# endyr1: 305
# begyr2: 245
# endyr2: 305
# nyears: 25

# lnd:
# land_comparison:
# parameter_groups:
# none:
# cases:
# - ctsm51d159_f45_GSWP3_bgccrop_1850pAD
# - ctsm51d159_f45_GSWP3_bgccrop_1850pSASU
# type:
# - 1850pAD
# - 1850pSASU

# ocn:
# ocean_surface:
# parameter_groups:
# none:
# Case: b.e23_alpha16b.BLT1850.ne30_t232.054
# savefigs: False
# mom6_tools_config:
# start_date: '0091-01-01'
# end_date: '0101-01-01'
# Fnames:
# native: 'mom6.h.native.????-??.nc'
# static: 'mom6.h.static.nc'
# oce_cat: /glade/u/home/gmarques/libs/oce-catalogs/reference-datasets.yml
lnd:
link_to_ILAMB:
parameter_groups:
none:
ilamb_root: ../../examples/external_diag_packages/ILAMB_output
key_plots: ["EcosystemandCarbonCycle/GrossPrimaryProductivity/FLUXCOM/CTSM51_global_bias.png", "EcosystemandCarbonCycle/LeafAreaIndex/AVHRR/CTSM51_global_bias.png", "EcosystemandCarbonCycle/GlobalNetEcosystemCarbonBalance/GCP/CTSM51_global_accumulate.png", "ILAMB_output_backup/HydrologyCycle/Permafrost/Brown2002/CTSM51_global_bias.png"]
print_table: False
external_tool:
tool_name: 'ILAMB'
ilamb_config_data_loc: '/glade/campaign/cesm/community/lmwg/diag/ILAMB/'

########### JUPYTER BOOK CONFIG ###########

Expand Down Expand Up @@ -194,21 +161,9 @@ book_toc:
chapters:
- file: atm/link_to_ADF

# - caption: Ocean
# chapters:
# - file: ocn/ocean_surface

# - caption: Land
# chapters:
# - file: lnd/land_comparison

# - caption: Sea Ice
# chapters:
# - file: ice/seaice

# - caption: Land Ice
# chapters:
# - file: glc/LIWG_SMB_diagnostic
- caption: Land
chapters:
- file: lnd/link_to_ILAMB

#####################################
# Keys for Jupyter Book _config.yml #
Expand Down
1 change: 0 additions & 1 deletion examples/ilamb/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions examples/ilamb/test_run.sh

This file was deleted.

11 changes: 7 additions & 4 deletions examples/key_metrics/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ global_params:
end_date: '0101-01-01'
base_start_date: '0001-01-01'
base_end_date: '0101-01-01'
obs_data_dir: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data'
lc_kwargs:
threads_per_worker: 1

Expand Down Expand Up @@ -125,12 +126,13 @@ compute_notebooks:
none:
regridded_output: False # it looks like output is already on f09 grid, didn't need to regrid time-series file
base_regridded_output: True
validation_path: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data/atm/analysis_datasets/fv0.9x1.25/seasonal_climatology/nmse_validation/PSL/'
validation_path: 'atm/analysis_datasets/fv0.9x1.25/seasonal_climatology/nmse_validation/PSL/'
link_to_ADF:
kernel_name: cupid-infrastructure
parameter_groups:
none:
adf_root: ../../examples/key_metrics/ADF_output/
key_plots: ["Surface_Wind_Stress_ANN_LatLon_Vector_Mean.png", "PRECT_ANN_LatLon_Mean.png", "PS_DJF_SHPolar_Mean.png", "TaylorDiag_ANN_Special_Mean.png"]
external_tool:
tool_name: 'ADF'
vars: ['SST', 'TS', 'SWCF', 'LWCF', 'PRECT', 'TAUX', 'TAUY', 'TGCLDLWP']
Expand All @@ -142,7 +144,7 @@ compute_notebooks:
Greenland_SMB_visual_compare_obs:
parameter_groups:
none:
obs_path: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data/glc/analysis_datasets/multi_grid/annual_avg/SMB_data'
obs_path: 'glc/analysis_datasets/multi_grid/annual_avg/SMB_data'
obs_name: 'GrIS_MARv3.12_climo_1960_1999.nc'
climo_nyears: 40

Expand Down Expand Up @@ -170,16 +172,17 @@ compute_notebooks:
none:
climo_nyears: 35
grid_file: '/glade/campaign/cesm/community/omwg/grids/tx2_3v2_grid.nc'
path_obs: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data/ice/'
path_nsdic: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data/ice/'
path_model: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_model_data/ice/'


lnd:
Global_TerrestrialCouplingIndex_VisualCompareObs:
parameter_groups:
none:
clmFile_h: '.h0.'
fluxnet_comparison: True
obsDir: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data/lnd/analysis_datasets/ungridded/timeseries/FLUXNET2015/'
obsDir: 'lnd/analysis_datasets/ungridded/timeseries/FLUXNET2015/'

# ocn:
# ocean_surface:
Expand Down
2 changes: 2 additions & 0 deletions helper_scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.cfg
*.txt
*.yml
8 changes: 6 additions & 2 deletions helper_scripts/generate_cupid_config_for_cesm_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,15 @@ def generate_cupid_config(case_root, cesm_root, cupid_example):
and "end_years" in my_dict["timeseries"][component]
):
my_dict["timeseries"][component]["end_years"] = [nyears, base_nyears]
if "link_to_ADF" in my_dict["compute_notebooks"]["atm"]:
if "link_to_ADF" in my_dict["compute_notebooks"].get("atm", {}):
my_dict["compute_notebooks"]["atm"]["link_to_ADF"]["parameter_groups"]["none"][
"adf_root"
] = os.path.join(case_root, "ADF_output")
if "Greenland_SMB_visual_compare_obs" in my_dict["compute_notebooks"]["glc"]:

if "Greenland_SMB_visual_compare_obs" in my_dict["compute_notebooks"].get(
"glc",
{},
):
my_dict["compute_notebooks"]["glc"]["Greenland_SMB_visual_compare_obs"][
"parameter_groups"
]["none"]["climo_nyears"] = climo_nyears
Expand Down
Loading

0 comments on commit eea8f4a

Please sign in to comment.