CAM vs CAM#

This will be a simple guided demo of running the ADF with sample data for CAM vs CAM comparison.

For this example we will run the ADF diagnostics for two different f-case CAM simulations for 5 years, 1995-2000:

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

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


Use this as a follow along as you work locally for this example ADF run.

Navigate to where you cloned the ADF:

  • If you followed our instructions earlier, you should have the ADF root directory at: /glade/work/<user>/ADF/

Configure Run-Time yaml file#

Introduction#

Look for the conifuration yaml file that will be used to run the ADF: config_baseline_example.yaml

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.

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.

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.

cp config_baseline_example.yaml config_model_vs_model_example.yaml

Modify the Copy#

Next open this new copy in your favorite editor:

emacs config_model_vs_model_example.yaml

Here we will do just a couple of changes for the output paths and cases/climo years

Subsections#

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.

Note

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

  • diag_basic_info

    • Basic overall run variables

  • diag_cam_climo

    • Test (experiment) case variables

  • diag_cam_baseline_climo

    • Baseline (control) case variables

    • Note: these are the same variables as diag_cam_climo just for the baseline case

  • diag_cvdp_info

  • time_averaging_scripts

    • Climotology file creation

  • regridding_scripts

    • Regridding of climo files

  • analysis_scripts

    • AMWG statisics tables

  • plotting_scripts

    • Various plotting scripts

  • diag_var_list

    • List of CAM variables for ADF to run


Global Variables#

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!

Set the user name that will be help set all paths later in the yaml file

user: richling (YOUR-USER-NAME)

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

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

Also set the variable hist_path for the path to the sample history files

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

Attention

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!

diag_basic_info#

This subsection defines necessary variables for the overall ADF run. hange the following variables:

cam_regrid_loc: ${diag_loc}/regrid

cam_diag_plot_loc: ${diag_loc}/plots

diag_cam_climo#

This subsection follows the diag_basic_info and is used for the test (experiment) case run and diagnostics details. Change the following variables:

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

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

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

start_year: 1995

end_year: 2000

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

diag_cam_baseline_climo#

This subsection follows the diag_cam_climo and is used for the baseline (control/target) case run and diagnostics details. Change the following variables:

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

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

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

start_year: 1995

end_year: 2000

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




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

Regridded file location:

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

Diagnostic plot location:

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

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

    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/

Climatology file locations:

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

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

Timeseries locations:

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

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

Run the ADF via terminal#

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).

Make sure you are still in the root directory of the ADF .

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

./run_adf_diag config_model_vs_model_example.yaml

End single CAM vs CAM case#

Hope everything went well...

Did the ADF fail?

Check config files
Check error/logs
Check data/paths

Check the outputs!#

We can now check the output diagnostics from a couple ways:

Locally

If the ADF ran successfully, we can navigate to where we set the diagnostic plots output:

 On a CISL machine, navigate to the root ADF directory

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

 Then go to where you assigned the cam_diag_plot_loc location in the run-time config file

 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/

JupyterHub

apidfjwd

Website

If you choose to create HTML files you can publish those to a web server. In the diagnostics plotting location (cam_diag_plot_loc) you set in the run-time config file, a website directory exists where all the html and css files are saved.

.
├── plots
│   └── 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
│       └── website
│           ├── assets
│           ├── html_img
│           ├── html_table
│           └── templates

Example: If you have a project page on a CGD machine like Tungsten, it is a simple secure copy of files to the server:

 Navigate to the cam_diag_plot_loc location and copy all the files from the website directory to the server address:

 For Tungsten:   scp -r website/* tungsten.cgd.ucar.edu:/path/to/your/project/page/)