YAML files#

The ADF requires 2 different yaml configuration files:

config_cam_baseline_example.yaml and adf_variable_defaults.yaml

NOTE: Throughout this tutorial we will reference these as the run-time and variable default yaml files respectively.

If yaml files are new to you, they are just specialized text files that python (and other languages) can read in and use as configuration files. In the case of the ADF, the variables set in the yaml files will be parsed into Python dictionaries and will accessable throughout the ADF workflow.

A couple of notes about using the ADF yaml files:
  Variables can be referenced within the yaml file called with the ${} syntax.
IE if we set a user variable user: richling we can call this by ${user} and richling wil be used where ever it is referenced.

Warning

Please do not modify either of these files!

It is recommended to make a copy of each file, make modifications in those copies, and then run them with the ADF.

Modifying the originals should only be done if you plan to push changes back to the main ADF repo.

Run-time yaml#

 config_cam_baseline_example.yaml

This is the most important file for the ADF, it stores all the necessary information that the ADF needs to run including all the relevant information about the case and baseline/observation/cmip runs.

It is also broken up into subsections with each subsection of the yaml file representing grouped sets of information sent to the ADF each having their own variable names.

Subsections#

  • 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

CAVEAT: using variables in this yaml file
In this file, we have built subsections in which variables set in a subsection are only callable by referencing the subsection first with a “.” then variable name.

IE: Say we want to set the climo years in the test case subsection diag_cam_climo and call them in the baseline case subsection diag_cam_baseline_climo

diag_cam_climo:

   start_year: 1995 -> we would reference this with diag_cam_climo.start_year
   end_year: 2000 -> we would reference this with diag_cam_climo.end_year

Now if we wanted to reference these climo years in the baseline subsection:

diag_cam_baseline_climo:

   start_year: ${diag_cam_climo.start_year}
   end_year: ${diag_cam_climo.end_year}

We can also set global variables (like the user example) that can be called in any subsections without the ‘.’ notation.

IE: Say we want to reference the user variable in the test case subsection diag_cam_climo

diag_cam_climo:

   cam_climo_loc: /glade/work/${user}/ADF/data/climos/ -> /glade/work/richling/ADF/data/climos/

Tip

Please see the config yaml file reference section for more details about this config file including how to use defined variables and more information about the config variables.


Variable Default yaml#

 lib/adf_variable_defaults.yaml

This yaml file is designed to host a myriad of information related to each of the variables that are being analyzed in the ADF. Some main points to using this file is to customize plotting options or calcuations/analysis on a variable by variable basis.

Example of options for zonal wind U

U:
  colormap: "Blues"
  contour_levels_range: [-10, 90, 5]
  diff_colormap: "BrBG"
  diff_contour_range: [-15, 15, 2]
  scale_factor: 1
  add_offset: 0
  new_unit: "ms$^{-1}$"
  mpl:
    colorbar:
      label : "ms$^{-1}$"
  obs_file: "U_ERA5_monthly_climo_197901-202112.nc"
  obs_name: "ERA5"
  obs_var_name: "U"
  vector_pair: "V"
  vector_name: "Wind"
  category: "State"