Home

Awesome

Greenhouse gas Diagnostics for Earth System Simulations

<!-- Information badges -->

test status codecov Python 3.8|3.9 DOI DOI

Overview

GDESS facilitates comparison of simulated atmospheric CO<sub>2</sub> 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.

Motivation

Model intercomparisons and benchmarking is critical for Earth System Models. By comparing the values of variables, such as CO<sub>2</sub>, in these simulations against observed values, one can discover the needs and means for refining model components, and learn much about Earth system dynamics in the process.

Development of gdess was initiated by a need to evaluate atmospheric CO<sub>2</sub> for the U.S. Department of Energy's Energy Exascale Earth System Model (E3SM) and its campaign focused on simulations of global biogeochemistry.

Problem to solve

Although there are existing diagnostic tools for Earth System Models (e.g. ESMValTool, ILAMB, BGC-val), they do not provide functionality specific for atmospheric CO<sub>2</sub> concentrations.

See ./gdess/bin/gdess_cli.py --help for more command-line switches and the documentation for more usage examples.

Contents

Data requirements and availability

Observations - Globalview+ data

Model Output - CMIP6

Model Output - E3SM

Getting started

Installation

๐Ÿ‘ฅ Clone this repository to the location of your choice.

git clone https://github.com/E3SM-Project/gdess.git ~/gdess
cd ~/gdess

๐ŸŒ Using conda, create a runtime or development environment and install dependencies. Note: Replace โ€œmyenvโ€ with the preferred name of your environment, e.g. "gdess_env". 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 .

(Optional) Retrieve the example data files used for running tests:

git lfs install
git lfs pull

Configuration

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.

On a Mac/Linux OS:
source ./gdess/bin/set_path_vars.sh
export GDESS_CMIP_DATA=Path/to/Model/Output/NetCDF/Files
export GDESS_GLOBALVIEW_DATA=Path/to/Obspack/NetCDF/Files
On a Windows OS:

Example

./gdess/bin/gdess_cli.py --verbose seasonal --start_yr 1980 --end_yr 2015 --model_name BCC.esm-hist --cmip_load_method local --station_list smo

Usage description

Diagnostic recipes can be run from the command line or from within a Python kernel:

Command line

In a Python kernel

Updating

To use the latest version of this repository:

Uninstalling

๐Ÿšฎ To remove this package from your environment:

pip uninstall gdess

Contributing

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.

Running the code tests

To run the built-in tests:

pytest

Project structure

Components

<img src="./.images/structure_diagram_20210903.png" alt="components" width="607" height="384"/>

Directory Tree

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 gdess
โ”‚   โ””โ”€โ”€demo/
โ”‚
โ”œโ”€โ”€ gdess                                <- *Python package* for handling co2 diagnostics
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ bin                  
โ”‚   โ”‚   โ”œโ”€โ”€ gdess_cli.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

Credits

Dependencies

The full list of dependencies is in the requirements.txt file.

Additional acknowledgements

Funding:

Disclaimer

This is a work in progress. Bugs are expected.