ILAMB

ILAMB#

The output from ILAMB is in the link below.

Note that ILAMB is currently run by users via the following process:

  1. Install ILAMB

  2. Use the CUPiD/helper_scripts/generate_ilamb_config_files.py script to generate ILAMB config files based on a CUPiD configuration file.

    • cd CUPiD/examples/external_diag_packages

    • ../../helper_scripts/generate_ilamb_config_files.py --cupid-config-loc . --run-type RUN_TYPE

  3. Run ILAMB with the newly created configuration file.

    • qinteractive -l select=1:ncpus=1:mpiprocs=1:mem=100G -l walltime=06:00:00 (specific for NCAR users)

    • follow the printed instructions

Hide code cell content

import os

from IPython.core.display import HTML, Image
from IPython.display import display

Hide code cell content

ilamb_root = "."
case_name = None
base_case_name = None
start_date = ""
end_date = ""
base_start_date = None
base_end_date = None
key_plots = None
print_table = False
# ilamb_root will be external_diag_packages/computed_notebooks/ILAMB/
# Parameters
case_name = "b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.232"
base_case_name = "b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.228"
CESM_output_dir = "/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing"
start_date = "0001-01-01"
end_date = "0021-01-01"
base_start_date = "0001-01-01"
base_end_date = "0045-01-01"
obs_data_dir = (
    "/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data"
)
ts_dir = None
lc_kwargs = {"threads_per_worker": 1}
serial = False
ilamb_root = "../../examples/key_metrics/ILAMB_output"
key_plots = [
    "EcosystemandCarbonCycle/GrossPrimaryProductivity/FLUXCOM/*_global_bias.png",
    "EcosystemandCarbonCycle/LeafAreaIndex/AVHRR/*1_global_bias.png",
    "EcosystemandCarbonCycle/GlobalNetEcosystemCarbonBalance/GCP/*_global_accumulate.png",
    "HydrologyCycle/Permafrost/Brown2002/*_global_bias.png",
]
print_table = True
subset_kwargs = {}
product = "/glade/work/richling/CUPid_pr_test/CUPiD/examples/key_metrics/computed_notebooks//lnd/ILAMB.ipynb"

Hide code cell content

# Want some base case parameter defaults to equal control case values
if base_case_name is not None:
    if base_start_date is None:
        base_start_date = start_date

    if base_end_date is None:
        base_end_date = end_date

Hide code cell content

# convert start-date and end-date to year range
case_year_range = [int(start_date.split("-")[0]), int(end_date.split("-")[0]) - 1]

base_case_year_range = [
    int(base_start_date.split("-")[0]),
    int(base_end_date.split("-")[0]) - 1,
]

Hide code cell source

display(HTML('<a href="../ILAMB/index.html">Full ILAMB output</a>'))

Key Metrics from ILAMB#

Some important things to look at from ILAMB:

Hide code cell source

for path_to_key_plot in key_plots:
    full_path = os.path.join(ilamb_root, path_to_key_plot)
    if os.path.isfile(full_path):
        print(full_path)
        display(Image(full_path))
score_chart = os.path.join(ilamb_root, "index.html")

if print_table:
    display(HTML(f'<iframe src="{score_chart}"></iframe>'))
/glade/work/richling/conda-envs/cupid-analysis/lib/python3.11/site-packages/IPython/core/display.py:447: UserWarning: Consider using IPython.display.IFrame instead
  warnings.warn("Consider using IPython.display.IFrame instead")