{ "cells": [ { "cell_type": "markdown", "id": "623cbc23-45bf-4dfd-9f49-8d814d0394ba", "metadata": { "papermill": { "duration": 0.001295, "end_time": "2026-01-23T18:48:03.027508", "exception": false, "start_time": "2026-01-23T18:48:03.026213", "status": "completed" }, "tags": [] }, "source": [ "# ILAMB\n", "\n", "The output from ILAMB is in the link below.\n", "\n", "\n", "Note that ILAMB is currently run by users via the following process:\n", "1) Install ILAMB\n", "2) Use the `CUPiD/helper_scripts/generate_ilamb_config_files.py` script to generate ILAMB config files based on a CUPiD configuration file.\n", " * `cd CUPiD/examples/external_diag_packages`\n", " * `../../helper_scripts/generate_ilamb_config_files.py --cupid-config-loc . --run-type RUN_TYPE`\n", "4) Run ILAMB with the newly created configuration file.\n", " * `qinteractive -l select=1:ncpus=1:mpiprocs=1:mem=100G -l walltime=06:00:00` (specific for NCAR users)\n", " * follow the printed instructions" ] }, { "cell_type": "code", "execution_count": 1, "id": "82af7435-3849-4fd1-bb2d-2e062719ec5b", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.030838Z", "iopub.status.busy": "2026-01-23T18:48:03.030642Z", "iopub.status.idle": "2026-01-23T18:48:03.070298Z", "shell.execute_reply": "2026-01-23T18:48:03.069712Z" }, "papermill": { "duration": 0.042138, "end_time": "2026-01-23T18:48:03.070771", "exception": false, "start_time": "2026-01-23T18:48:03.028633", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "import os\n", "\n", "from IPython.core.display import HTML, Image\n", "from IPython.display import display" ] }, { "cell_type": "code", "execution_count": 2, "id": "2a759f1b-eca7-4eec-a16a-eede1a6ab36c", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.073778Z", "iopub.status.busy": "2026-01-23T18:48:03.073615Z", "iopub.status.idle": "2026-01-23T18:48:03.076629Z", "shell.execute_reply": "2026-01-23T18:48:03.076074Z" }, "papermill": { "duration": 0.005088, "end_time": "2026-01-23T18:48:03.077018", "exception": false, "start_time": "2026-01-23T18:48:03.071930", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "parameters", "hide-cell" ] }, "outputs": [], "source": [ "ilamb_root = \".\"\n", "base_case_name = None\n", "start_date = \"\"\n", "end_date = \"\"\n", "base_start_date = None\n", "base_end_date = None\n", "key_plots = None\n", "print_table = False\n", "# ilamb_root will be external_diag_packages/computed_notebooks/ILAMB/" ] }, { "cell_type": "code", "execution_count": 3, "id": "b2bfc3c6", "metadata": { "execution": { "iopub.execute_input": "2026-01-23T18:48:03.079933Z", "iopub.status.busy": "2026-01-23T18:48:03.079778Z", "iopub.status.idle": "2026-01-23T18:48:03.084831Z", "shell.execute_reply": "2026-01-23T18:48:03.084351Z" }, "papermill": { "duration": 0.007299, "end_time": "2026-01-23T18:48:03.085370", "exception": false, "start_time": "2026-01-23T18:48:03.078071", "status": "completed" }, "tags": [ "injected-parameters" ] }, "outputs": [], "source": [ "# Parameters\n", "case_name = \"ctsm5.4.004_bgc_f09_131_HIST\"\n", "base_case_name = \"ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST\"\n", "case_nickname = \"131_HIST\"\n", "base_case_nickname = \"124_HIST\"\n", "CESM_output_dir = \"/glade/derecho/scratch/wwieder/archive\"\n", "start_date = \"2000-01-01\"\n", "end_date = \"2005-01-01\"\n", "climo_start_year = 2000\n", "climo_end_year = 2004\n", "base_start_date = \"2000-01-01\"\n", "base_end_date = \"2005-01-01\"\n", "base_climo_start_year = 2000\n", "base_climo_end_year = 2004\n", "obs_data_dir = (\n", " \"/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data\"\n", ")\n", "ts_dir = None\n", "lc_kwargs = {\"threads_per_worker\": 1}\n", "serial = False\n", "ilamb_root = \"../../examples/land_only/ILAMB_output\"\n", "key_plots = [\n", " \"EcosystemandCarbonCycle/GrossPrimaryProductivity/FLUXCOM/*_global_bias.png\",\n", " \"EcosystemandCarbonCycle/LeafAreaIndex/AVHRR/*1_global_bias.png\",\n", "]\n", "print_table = True\n", "subset_kwargs = {}\n", "product = (\n", " \"/glade/work/wwieder/CUPiD/examples/land_only/computed_notebooks//lnd/ILAMB.ipynb\"\n", ")\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "81bf4573-8806-486f-a2f6-79e244415c07", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.088442Z", "iopub.status.busy": "2026-01-23T18:48:03.088311Z", "iopub.status.idle": "2026-01-23T18:48:03.097174Z", "shell.execute_reply": "2026-01-23T18:48:03.096707Z" }, "papermill": { "duration": 0.011309, "end_time": "2026-01-23T18:48:03.097887", "exception": false, "start_time": "2026-01-23T18:48:03.086578", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "# Want some base case parameter defaults to equal control case values\n", "if base_case_name is not None:\n", " if base_start_date is None:\n", " base_start_date = start_date\n", "\n", " if base_end_date is None:\n", " base_end_date = end_date" ] }, { "cell_type": "code", "execution_count": 5, "id": "4104f878-a8c3-4d0f-8c00-555e6b2b3273", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.100813Z", "iopub.status.busy": "2026-01-23T18:48:03.100686Z", "iopub.status.idle": "2026-01-23T18:48:03.105542Z", "shell.execute_reply": "2026-01-23T18:48:03.104993Z" }, "papermill": { "duration": 0.007058, "end_time": "2026-01-23T18:48:03.106067", "exception": false, "start_time": "2026-01-23T18:48:03.099009", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-cell" ] }, "outputs": [], "source": [ "# convert start-date and end-date to year range\n", "case_year_range = [int(start_date.split(\"-\")[0]), int(end_date.split(\"-\")[0]) - 1]\n", "\n", "base_case_year_range = [\n", " int(base_start_date.split(\"-\")[0]),\n", " int(base_end_date.split(\"-\")[0]) - 1,\n", "]" ] }, { "cell_type": "code", "execution_count": 6, "id": "ee0774cc-c68a-4385-b94c-08fa806f28c0", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.108980Z", "iopub.status.busy": "2026-01-23T18:48:03.108856Z", "iopub.status.idle": "2026-01-23T18:48:03.117308Z", "shell.execute_reply": "2026-01-23T18:48:03.116853Z" }, "papermill": { "duration": 0.010736, "end_time": "2026-01-23T18:48:03.117935", "exception": false, "start_time": "2026-01-23T18:48:03.107199", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "outputs": [ { "data": { "text/html": [ "Full ILAMB output" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "display(\n", " HTML(\n", " 'Full ILAMB output'\n", " )\n", ")" ] }, { "cell_type": "markdown", "id": "f9234aec-1fe5-4bbf-ad6c-fb565297afbe", "metadata": { "papermill": { "duration": 0.001152, "end_time": "2026-01-23T18:48:03.120282", "exception": false, "start_time": "2026-01-23T18:48:03.119130", "status": "completed" }, "tags": [] }, "source": [ "## Key Metrics from ILAMB\n", "\n", "Some important things to look at from ILAMB:" ] }, { "cell_type": "code", "execution_count": 7, "id": "be819352-c723-4f48-afac-d93f6d192f96", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2026-01-23T18:48:03.123444Z", "iopub.status.busy": "2026-01-23T18:48:03.123258Z", "iopub.status.idle": "2026-01-23T18:48:03.138613Z", "shell.execute_reply": "2026-01-23T18:48:03.138088Z" }, "papermill": { "duration": 0.017693, "end_time": "2026-01-23T18:48:03.139093", "exception": false, "start_time": "2026-01-23T18:48:03.121400", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "for path_to_key_plot in key_plots:\n", " full_path = os.path.join(ilamb_root, path_to_key_plot)\n", " if os.path.isfile(full_path):\n", " print(full_path)\n", " display(Image(full_path))" ] }, { "cell_type": "code", "execution_count": 8, "id": "de0bc64c", "metadata": { "execution": { "iopub.execute_input": "2026-01-23T18:48:03.142440Z", "iopub.status.busy": "2026-01-23T18:48:03.142289Z", "iopub.status.idle": "2026-01-23T18:48:03.162016Z", "shell.execute_reply": "2026-01-23T18:48:03.161676Z" }, "papermill": { "duration": 0.022235, "end_time": "2026-01-23T18:48:03.162644", "exception": false, "start_time": "2026-01-23T18:48:03.140409", "status": "completed" }, "tags": [] }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/glade/work/wwieder/conda-envs/cupid-analysis/lib/python3.13/site-packages/IPython/core/display.py:447: UserWarning: Consider using IPython.display.IFrame instead\n", " warnings.warn(\"Consider using IPython.display.IFrame instead\")\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "score_chart = os.path.join(ilamb_root, \"index.html\")\n", "\n", "if print_table:\n", " display(HTML(f''))" ] } ], "metadata": { "kernelspec": { "display_name": "cupid-analysis", "language": "python", "name": "cupid-analysis" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.11" }, "papermill": { "duration": 0.998562, "end_time": "2026-01-23T18:48:03.378669", "exception": null, "input_path": "/glade/derecho/scratch/wwieder/tmp/tmp52e7d0w1.ipynb", "output_path": "/glade/work/wwieder/CUPiD/examples/land_only/computed_notebooks/lnd/ILAMB.ipynb", "parameters": { "CESM_output_dir": "/glade/derecho/scratch/wwieder/archive", "base_case_name": "ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST", "base_case_nickname": "124_HIST", "base_climo_end_year": 2004, "base_climo_start_year": 2000, "base_end_date": "2005-01-01", "base_start_date": "2000-01-01", "case_name": "ctsm5.4.004_bgc_f09_131_HIST", "case_nickname": "131_HIST", "climo_end_year": 2004, "climo_start_year": 2000, "end_date": "2005-01-01", "ilamb_root": "../../examples/land_only/ILAMB_output", "key_plots": [ "EcosystemandCarbonCycle/GrossPrimaryProductivity/FLUXCOM/*_global_bias.png", "EcosystemandCarbonCycle/LeafAreaIndex/AVHRR/*1_global_bias.png" ], "lc_kwargs": { "threads_per_worker": 1 }, "obs_data_dir": "/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data", "print_table": true, "product": "/glade/work/wwieder/CUPiD/examples/land_only/computed_notebooks//lnd/ILAMB.ipynb", "serial": false, "start_date": "2000-01-01", "subset_kwargs": {}, "ts_dir": null }, "start_time": "2026-01-23T18:48:02.380107" } }, "nbformat": 4, "nbformat_minor": 5 }