GDESS facilitates comparison of simulated atmospheric CO2 against observational data. Specifically, it selects, loads, and parses the observational datasets and model simulations to be in a consistent structure and generates data visualizations for several diagnostic use cases. Three diagnostic recipes currently implemented examine multidecadal trends, seasonal cycles, and meridional gradients.
There is a need to evaluate atmospheric CO2 for continuing development of U.S. Department of Energy's Energy Exascale Earth System Model (E3SM) โ particularly the v2 campaign focused on simulations of global biogeochemistry.
Although there are existing diagnostic tools for Earth System Models (e.g. ESMValTool, ILAMB, BGC-val), they do not provide functionality specific for atmospheric CO2 concentrations.
- Data requirements and availability
- Getting started
- Example
- Usage
- Updating
- Uninstalling
- Contributing
- Project structure
- Credits
- Disclaimer
Observations - Globalview+ data
- For parsing and running demo notebooks, one must first download the Obspack, which is available from the NOAA Global Monitoring Laboratory (GML) here: https://www.esrl.noaa.gov/gmd/ccgg/obspack/data.php
- There is a sample file from NOAA GML included in this Git repository to enable the running of test cases.
Model Output - CMIP6
- CMIP6 data do not need to be downloaded before running recipes, as GDESS can use the intake-esm dependency to retrieve CMIP6 data programmatically while running.
- It seems that recipes involving CMIP data won't work when on the PNNL VPN (presumably because the VPN blocks retrieval of the CMIP data catalog using a web URL, which is initiated by the intake package).
Model Output - E3SM
- E3SM outputs do not need to be available to run recipes that compare Globalview+ and CMIP6 data.
- For parsing and running recipes from E3SM Collection,
one must have access to model output history as NetCDF file(s),
and a script for post-processing E3SM output is provided in
co2_diag/bin/
.
๐ฅ Clone this repository to the location of your choice.
git clone https://github.com/E3SM-Project/gdess.git ~/gdess
cd ~/gdess
๐ Create conda environment and install dependencies. Note: Replace โmyenvโ with the preferred name of your environment, e.g. "co2_diagnostics". From here on weโll use โmyenvโ to refer to our environment.
conda create -n myenv python=3.8
conda activate myenv
conda config --add channels conda-forge
conda install --file requirements.txt
๐พ Install the package:
pip install .
To run the tests, now retrieve the example data files using:
git lfs install
git lfs pull
Instead of passing data filepaths to the recipe functions each time, you can define environment variables for the directory containing Globalview+ Obspack and CMIP model output.
- Specify the path to the repo on the first line of
co2_diag/bin/set_path_vars.sh
. For instance, by executing:export GDESS_REPO=${HOME}/gdess
- Set paths to the test data by running the script at the command line:
source ./co2_diag/bin/set_path_vars.sh
- To use stored data other than the test data, modify the other data paths in the scripts.
For example, to set the paths for every future terminal instance (and if you are running in a bash environment),
set these paths in your
~/.bash_profile
:
export GDESS_CMIP_DATA=Path/to/Model/Output/NetCDF/Files
export GDESS_GLOBALVIEW_DATA=Path/to/Obspack/NetCDF/Files
- The following steps generate this figure:
- Install the
gdess
package according to the installation instructions - Follow the configuration instructions to use the included example data files
./co2_diag/bin/gdess.py --verbose seasonal --start_yr 1980 --end_yr 2015 --model_name BCC.esm-hist --cmip_load_method local --station_list smo
- Other examples are given in the provided jupyter notebooks,
which show recipe usage (
trends_recipe.ipynb
,seasonal_cycle_recipe.ipynb
, andmeridional_recipe.ipynb
). To run them:- Enable your conda environment via:
python -m ipykernel install --user --name=myenv
- Start jupyter by entering:
jupyter notebook
- Navigate within jupyter to
gdess/notebooks/demo/
- Enable your conda environment via:
Diagnostic recipes can be run from the command line or from within a Python kernel:
Command line
- Use
co2_diag/bin/gdess.py
followed by the recipe name and then recipe options. To see available commands, run, e.g.co2_diag/bin/gdess.py --help
orco2_diag/bin/gdess.py seasonal --help
- To specify options from a file [recommended for repeated tests], use the
@
symbol prefix for the filename. For example, using the provided file:co2_diag/bin/gdess.py @recipe_options_example.txt
In a Python kernel
- The diagnostic recipes can be called directly, with options passed as a Python
dict
object. - Check out the demonstration notebooks in
gdess/notebooks/demo/
. The notebooks show recipe usage.
To use the latest version of this repository:
-
Enter the
gdess/
directory -
Activate your desired environment
-
Run the commands:
git pull git checkout main pip install . --upgrade
๐ฎ To remove this package from your environment:
pip uninstall co2_diag
If you're interested in participating in the development of gdess
,
want to suggest features or report bugs,
please leave us a message through the issue tracker.
Note that most work is done in the 'develop' branch,
so please git checkout develop
(or you can create a new branch) before modifying code.
gdess
โ
โโโ README.md <- Top-level README for users/developers of this project
โโโ requirements.txt <- Package dependencies
โโโ recipe_options_example.txt
โ
โโโ notebooks <- Example jupyter notebooks to see diagnostic capabilities of co2_diag
โ โโโdemo/
โ
โโโ co2_diag <- *Python package* for handling co2 diagnostics
โ โ
โ โโโ bin
โ โ โโโ gdess.py <- Run recipes from the command line
โ โ โโโ set_path_vars.sh <- Script to set up data file paths for running examples
โ โ โโโ concat_and_remap_E3SM_co2.sh <- Script template for post-processing of E3SM output
โ โ
โ โโโ recipes <- Generate repeatable diagnostics that span multiple data sources available as recipes
โ โ โโโ surface_trends.py
โ โ โโโ seasonal_cycles.py
โ โ โโโ meridional_gradient.py
โ โ โโโ recipe_utils.py
โ โ โโโ ...
โ โ
โ โโโ data_source <- Load, parse, and manipulate data from a particular source
โ โ โโโ models/
โ โ โโโ observations/
โ โ โโโ multiset.py
โ โ โโโ ...
โ โ
โ โโโ operations <- Manipulate datasets (e.g. spatially or temporally)
โ โ โโโ Confrontation.py
โ โ โโโ geographic.py
โ โ โโโ time.py
โ โ โโโ convert.py
โ โ โโโ datasetdict.py
โ โ โโโ ...
โ โ
โ โโโ formatters <- Manipulate formatting in desired ways
โ โ โโโ args.py
โ โ โโโ nums.py
โ โ โโโ strings.py
โ โ โโโ ...
โ โ
โ โโโ graphics <- Make repeated graphic actions available
โ โ โโโ comparison_plots.py
โ โ โโโ single_source_plots.py
โ โ โโโ utils.py
โ โ โโโ ...
โ โ
โ โโโ config <- Configuration options
โ โ โโโ defaults.ini
โ โ โโโ stations_dict.json
โ โ โโโ log_config.json
โ โ
โ โโโ recipe_parsers.py
โ
โโโ tests <- Unit and integration tests for development
โ โโโ ...
โโโ ccgcrv <- Curve fitting code from NOAA GML (see credits in the README)
โ โโโ ...
โโโ ci <- Environment specification for continuous integration
โ โโโ ...
โโโ paper <- Manuscript for the Journal of Open Source Software (JOSS)
โ โโโ ...
โ
โโโ LICENSE
โโโ MANIFEST.in
โโโ setup.cfg
โโโ setup.py
The full list of dependencies is in the requirements.txt
file.
-
Although not a dependency, ideas were also drawn from xclim: Climate indices computations.
-
ccgcrv
: The curve fitting code in the ccgcrv directory has been mildly modified โ modified for improved code integration, i.e. the computational logic has not been changed โ from the code made freely available by the NOAA Global Monitoring Laboratory. From their website, one can access the source code and read a description of its usage. Additional details regarding the curve fitting approach can be found in the following publications:- Thoning, K.W., P.P. Tans, and W.D. Komhyr, 1989, Atmospheric carbon dioxide at Mauna Loa Observatory, 2. Analysis of the NOAA/GMCC data, 1974 1985., J. Geophys. Res. ,94, 8549 8565. https://doi.org/10.1029/JD094iD06p08549
- Sweeney, C., Karion, A., Wolter, S., Newberger, T., Guenther, D., Higgs, J.A., Andrews, A.E., Lang, P.M., Neff, D., Dlugokencky, E., Miller, J.B., Montzka, S.A., Miller, B.R., Masarie, K.A., Biraud, S.C., Novelli, P.C., Crotwell, M., Crotwell, A.M., Thoning, K., Tans, P.P., 2015. Seasonal climatology of CO 2 across North America from aircraft measurements in the NOAA/ESRL Global Greenhouse Gas Reference Network. J. Geophys. Res. Atmos. 120, 5155โ5190. https://doi.org/10.1002/2014JD022591
-
The Mauna Loa (MLO), American Samoa (SMO), South Pole (SPO), and Barrow Observatory (BRW) dataset files used in the tests directory was provided via the Obspack (GLOBALVIEWplus_v6.0_2020-09-11) by: C. D. Keeling, S. C. Piper, R. B. Bacastow, M. Wahlen, T. P. Whorf, M. Heimann, and H. A. Meijer, Exchanges of atmospheric CO2 and 13CO2 with the terrestrial biosphere and oceans from 1978 to 2000. I. Global aspects, SIO Reference Series, No. 01-06, Scripps Institution of Oceanography, San Diego, 88 pages, 2001.
- This work is made possible by the Pacific Northwest National Laboratory.
- Data were obtained from the Energy Exascale Earth System Model project, sponsored by the U.S.Department of Energy, Office of Science, Office of Biological and Environmental Research.
This is a work in progress. Bugs are expected.