{ "cells": [ { "cell_type": "raw", "id": "d646b2ff-5423-4c46-a8a7-f307af5c13aa", "metadata": {}, "source": [ "
\n", "\n", "\n", "

We will be editing the following sections:

\n", "\n", "*

Global Variables

\n", "*

diag_basic_info

\n", "*

diag_cam_climo

\n", "*

diag_cam_baseline_climo

\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "d8c7126f-826d-4cdb-8017-ac667a1be951", "metadata": {}, "source": [ "# CAM vs CAM\n", "\n", "
This will be a simple guided demo of running the ADF with sample data for CAM vs CAM comparison.
\n", "\n", "For this example we will run the ADF diagnostics for two different f-case CAM simulations for 5 years, 1995-2000:\n", "\n", "

The test (experiment) case is f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001

\n", "

The baseline (control) case is f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001

\n", "\n", "\n", "\n", "\n", "---\n", "\n", "\n", "\n", "
Use this as a follow along as you work locally for this example ADF run.
\n", "\n", "Navigate to where you cloned the ADF:\n", "\n", "- If you followed our instructions earlier, you should have the ADF root directory at: `/glade/work//ADF/`\n", "\n", "\n", "\n", "### Configure Run-Time yaml file\n", "\n", "###### Introduction\n", "\n", "Look for the conifuration yaml file that will be used to run the ADF: `config_baseline_example.yaml`\n", "\n", "This is probably the most important file for the ADF. This stores all the necessary information that the ADF needs to run as well as all the relevant information about the case and baseline/observation/cmip runs.\n", "\n", "\n", "As a quick refresher from the intro to yaml section, we can utilize the `${}` notation to reference already declared variables elsewhere in the yaml files.\n", "\n", "We will copy the provided configuration yaml file `config_baseline_example.yaml` and will do small edits to that copy and we will run an example ADF with some sample data.\n", "\n", " cp config_baseline_example.yaml config_model_vs_model_example.yaml\n", "\n", "\n", "\n", "###### Modify the Copy\n", "\n", "

Next open this new copy in your favorite editor:\n", " \n", " emacs config_model_vs_model_example.yaml\n", "\n", "Here we will do just a couple of changes for the output paths and cases/climo years\n", "

\n", "\n", "\n", "##### Subsections\n", "\n", "\n", "\n", "A quick refresher of the different sections in this yaml file. The highlighted scetions will be ones we will change variables in for this example.\n", "\n", "
\n", "

Note

\n", "

Change only the variables listed in each highlighted subsection below and leave all the other variables in the conifg file as they are by default

\n", "
\n", "\n", "* diag_basic_info\n", " - Basic overall run variables\n", " \n", "* diag_cam_climo\n", " - Test (experiment) case variables\n", " \n", "* diag_cam_baseline_climo\n", " - Baseline (control) case variables\n", " - Note: these are the same variables as `diag_cam_climo` just for the baseline case\n", " \n", "* diag_cvdp_info\n", " - For running the Climate Variability Diagnostics Package https://www.cesm.ucar.edu/projects/cvdp\n", " - This will run in the background of the ADF\n", " \n", "* time_averaging_scripts\n", " - Climotology file creation\n", " \n", "* regridding_scripts\n", " - Regridding of climo files\n", " \n", "* analysis_scripts\n", " - AMWG statisics tables\n", " \n", "* plotting_scripts\n", " - Various plotting scripts\n", " \n", "* diag_var_list\n", " - List of CAM variables for ADF to run\n", "\n", "
\n", "\n", "###### Global Variables\n", "\n", "In the yaml file, above the `diag_basic_info` subsections let's set global variables. These variables will be set above all the subsections so that they can be easily called in anywhere in the file. Make sure there is no indentation between the variable name and the left margin of the file!\n", "\n", "Set the user name that will be help set all paths later in the yaml file\n", "

user: richling (YOUR-USER-NAME)

\n", "\n", "Set the variable `diag_loc` for the root ADF diagnostic data/plots paths. This will be used to house the different directories for the time series, climo, and regridded files as well as where the plots and websites will go\n", "

diag_loc: /glade/scratch/${user}/ADF

\n", "\n", "Also set the variable `hist_path` for the path to the sample history files\n", "

hist_path: /glade/scratch/richling/ADF/tutorials/data

\n", "\n", "
\n", "

Attention

\n", "

This is meerly a suggestion of how to configure the locations of all the files and diagnostic plots. We will stick to this convention for this tutorial, but please feel free to setup your ADF diagnsotics paths/hieracrhy in anyway that makes sense for your actual needs!

\n", "
\n", "\n", "\n", "\n", "###### diag_basic_info\n", "This subsection defines necessary variables for the overall ADF run. hange the following variables:\n", "\n", "

cam_regrid_loc: ${diag_loc}/regrid

\n", "\n", "

cam_diag_plot_loc: ${diag_loc}/plots

\n", "\n", "###### diag_cam_climo\n", "\n", "This subsection follows the `diag_basic_info` and is used for the test (experiment) case run and diagnostics details. Change the following variables:\n", "\n", "

cam_case_name: f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001

\n", "\n", "

cam_hist_loc: ${hist_path}/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001

\n", "

cam_climo_loc: ${diag_loc}/climo/{diag_cam_climo.cam_case_name}

\n", "

start_year: 1995

\n", "

end_year: 2000

\n", "

cam_ts_loc: ${diag_loc}/ts/{diag_cam_climo.cam_case_name}

\n", "\n", "###### diag_cam_baseline_climo\n", "\n", "This subsection follows the `diag_cam_climo` and is used for the baseline (control/target) case run and diagnostics details. Change the following variables:\n", "\n", "

cam_case_name: f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001

\n", "

cam_hist_loc: ${hist_path}/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001

\n", "

cam_climo_loc: ${diag_loc}/climo/{diag_cam_baseline_climo.cam_case_name}

\n", "

start_year: 1995

\n", "

end_year: 2000

\n", "

cam_ts_loc: ${diag_loc}/ts/{diag_cam_baseline_climo.cam_case_name}

\n", "\n", "\n", "---\n", "\n", "

\n", "\n", "\n", "\n", "````{div} full-width\n", "\n", "

With all these variables now set, let's take a quick catalogue of the different paths:

\n", "\n", "\n", "Regridded file location:\n", "
\n", "

/glade/scratch/<user>/ADF/adf_tutorial/data/regrid/

\n", "\n", "Diagnostic plot location:\n", "\n", "

/glade/scratch/<user>/ADF/adf_tutorial/plots

\n", "\n", "

   The ADF will output a new directory in the above location named:

\n", "\n", "

    f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001_1995_2000_vs_f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001_1995_2000/

\n", "\n", "Climatology file locations:\n", "\n", "

/glade/scratch/<user>/ADF/adf_tutorial/data/climo/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001

\n", "\n", "

/glade/scratch/<user>/ADF/adf_tutorial/data/climo/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001

\n", "\n", "Timeseries locations:\n", " \n", "

/glade/scratch/<user>/ADF/adf_tutorial/data/ts/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_non-ogw.001

\n", "\n", "

/glade/scratch/<user>/ADF/adf_tutorial/data/ts/f.cam6_3_106.FLTHIST_v0a.ne30.dcs_effgw_rdg.001

\n", " \n", "
\n", "\n", "````" ] }, { "cell_type": "markdown", "id": "028a4b50-011e-4bff-8e38-398db07efa25", "metadata": {}, "source": [ "### Run the ADF via terminal\n", "\n", "With the run-time config file setup, the next step is to actaully run the ADF, oh boy! The most basic ADF run is through tthe terminal (although it can be run via Jupyter too, please see the ADF in Jupyter chapter in this Guided Examples section).\n", "\n", "Make sure you are still in the root directory of the ADF .\n", "\n", "From here, you just need to call the command line script `run_adf_diag` followed by the run-time config file we just editied `config_model_vs_model_example.yaml`\n", "\n", " ./run_adf_diag config_model_vs_model_example.yaml" ] }, { "cell_type": "raw", "id": "e5b35522-8426-423c-b5ad-116392669eef", "metadata": {}, "source": [ "#