{ "cells": [ { "cell_type": "markdown", "id": "623cbc23-45bf-4dfd-9f49-8d814d0394ba", "metadata": { "papermill": { "duration": 0.002737, "end_time": "2025-10-28T23:29:23.276963", "exception": false, "start_time": "2025-10-28T23:29:23.274226", "status": "completed" }, "tags": [] }, "source": [ "# CVDP\n", "\n", "A number of plots are provided from CVDP. The full output from the stand-alone CDVP configuration is in the link below.\n", "\n", "\n", "Note that in standalone format (eg, CUPiD run not through CESM workflow), CVDP is currently run by users via ADF with the following process:\n", "1) Install ADF and activate cupid-analysis\n", "2) Use the `CUPiD/helper_scripts/generate_adf_config_file.py` script to generate an ADF config file based on a CUPiD configuration file.\n", " * `cd CUPiD/examples/external_diag_packages`\n", " * `../../helper_scripts/generate_adf_config_file.py --cupid-config-loc . --adf-template ../../externals/ADF/config_amwg_default_plots.yaml --out-file ADF_config.yaml`\n", "3) Run ADF with the newly created configuration file.\n", " * `../../externals/ADF/run_adf_diag ADF_config.yaml`" ] }, { "cell_type": "code", "execution_count": 1, "id": "82af7435-3849-4fd1-bb2d-2e062719ec5b", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2025-10-28T23:29:23.283170Z", "iopub.status.busy": "2025-10-28T23:29:23.282848Z", "iopub.status.idle": "2025-10-28T23:29:23.554578Z", "shell.execute_reply": "2025-10-28T23:29:23.554077Z" }, "papermill": { "duration": 0.276317, "end_time": "2025-10-28T23:29:23.555964", "exception": false, "start_time": "2025-10-28T23:29:23.279647", "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\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 2, "id": "2a759f1b-eca7-4eec-a16a-eede1a6ab36c", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2025-10-28T23:29:23.561996Z", "iopub.status.busy": "2025-10-28T23:29:23.561821Z", "iopub.status.idle": "2025-10-28T23:29:23.564845Z", "shell.execute_reply": "2025-10-28T23:29:23.564256Z" }, "papermill": { "duration": 0.006468, "end_time": "2025-10-28T23:29:23.565466", "exception": false, "start_time": "2025-10-28T23:29:23.558998", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "parameters", "hide-cell" ] }, "outputs": [], "source": [ "cvdp_root = \".\"\n", "case_name = None\n", "key_plots = None\n", "# cvdp_root will be external_diag_packages/computed_notebooks/CVDP/" ] }, { "cell_type": "code", "execution_count": 3, "id": "99194e05", "metadata": { "execution": { "iopub.execute_input": "2025-10-28T23:29:23.568165Z", "iopub.status.busy": "2025-10-28T23:29:23.567937Z", "iopub.status.idle": "2025-10-28T23:29:23.588426Z", "shell.execute_reply": "2025-10-28T23:29:23.587777Z" }, "papermill": { "duration": 0.022954, "end_time": "2025-10-28T23:29:23.589451", "exception": false, "start_time": "2025-10-28T23:29:23.566497", "status": "completed" }, "tags": [ "injected-parameters" ] }, "outputs": [], "source": [ "# Parameters\n", "case_name = \"b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.232\"\n", "base_case_name = \"b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.228\"\n", "CESM_output_dir = \"/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing\"\n", "start_date = \"0001-01-01\"\n", "end_date = \"0021-01-01\"\n", "base_start_date = \"0001-01-01\"\n", "base_end_date = \"0045-01-01\"\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", "cvdp_root = \"../../examples/key_metrics/CVDP_output/\"\n", "key_plots = [\n", " \"nino34.spatialcomp.djf1.png\",\n", " \"nino34.hov.elnino.png\",\n", " \"nino34.hov.lanina.png\",\n", " \"sst.stddev.djf.png\",\n", " \"nino34.monstddev.png\",\n", "]\n", "subset_kwargs = {}\n", "product = \"/glade/work/richling/CUPid_pr_test/CUPiD/examples/key_metrics/computed_notebooks//atm/CVDP.ipynb\"\n" ] }, { "cell_type": "code", "execution_count": 4, "id": "ee0774cc-c68a-4385-b94c-08fa806f28c0", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2025-10-28T23:29:23.595088Z", "iopub.status.busy": "2025-10-28T23:29:23.594859Z", "iopub.status.idle": "2025-10-28T23:29:23.626865Z", "shell.execute_reply": "2025-10-28T23:29:23.626252Z" }, "papermill": { "duration": 0.035942, "end_time": "2025-10-28T23:29:23.627896", "exception": false, "start_time": "2025-10-28T23:29:23.591954", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "outputs": [ { "data": { "text/html": [ "Full CVDP output" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "cvdp_case_name = f\"{case_name}\"\n", "cvdp_root = os.path.join(cvdp_root, cvdp_case_name, \"output/\")\n", "display(\n", " HTML(\n", " f'Full CVDP output'\n", " )\n", ")" ] }, { "cell_type": "markdown", "id": "f9234aec-1fe5-4bbf-ad6c-fb565297afbe", "metadata": { "papermill": { "duration": 0.002483, "end_time": "2025-10-28T23:29:23.633221", "exception": false, "start_time": "2025-10-28T23:29:23.630738", "status": "completed" }, "tags": [] }, "source": [ "## Key Metrics from CVDP\n", "\n", "Some important things to look at from the CVDP:" ] }, { "cell_type": "code", "execution_count": 5, "id": "f877ed8e-bca3-4256-8010-69aad302bb32", "metadata": { "editable": true, "execution": { "iopub.execute_input": "2025-10-28T23:29:23.637708Z", "iopub.status.busy": "2025-10-28T23:29:23.637601Z", "iopub.status.idle": "2025-10-28T23:29:23.650645Z", "shell.execute_reply": "2025-10-28T23:29:23.649954Z" }, "papermill": { "duration": 0.01616, "end_time": "2025-10-28T23:29:23.651896", "exception": false, "start_time": "2025-10-28T23:29:23.635736", "status": "completed" }, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "for path_to_key_plot in key_plots:\n", " full_path = os.path.join(cvdp_root, path_to_key_plot)\n", " if os.path.isfile(full_path):\n", " display(Image(full_path))" ] } ], "metadata": { "kernelspec": { "display_name": "cupid-infrastructure", "language": "python", "name": "cupid-infrastructure" }, "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.11.4" }, "papermill": { "duration": 1.169961, "end_time": "2025-10-28T23:29:23.877361", "exception": null, "input_path": "/glade/derecho/scratch/richling/tmp/tmpgca9b404.ipynb", "output_path": "/glade/work/richling/CUPid_pr_test/CUPiD/examples/key_metrics/computed_notebooks/atm/CVDP.ipynb", "parameters": { "CESM_output_dir": "/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CESM_output_for_testing", "base_case_name": "b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.228", "base_end_date": "0045-01-01", "base_start_date": "0001-01-01", "case_name": "b.e30_alpha07c_cesm.B1850C_LTso.ne30_t232_wgx3.232", "cvdp_root": "../../examples/key_metrics/CVDP_output/", "end_date": "0021-01-01", "key_plots": [ "nino34.spatialcomp.djf1.png", "nino34.hov.elnino.png", "nino34.hov.lanina.png", "sst.stddev.djf.png", "nino34.monstddev.png" ], "lc_kwargs": { "threads_per_worker": 1 }, "obs_data_dir": "/glade/campaign/cesm/development/cross-wg/diagnostic_framework/CUPiD_obs_data", "product": "/glade/work/richling/CUPid_pr_test/CUPiD/examples/key_metrics/computed_notebooks//atm/CVDP.ipynb", "serial": false, "start_date": "0001-01-01", "subset_kwargs": {}, "ts_dir": null }, "start_time": "2025-10-28T23:29:22.707400" } }, "nbformat": 4, "nbformat_minor": 5 }