Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Global Mean Surface Temperature Anomalies (GMSTA) from CMIP6 data


Overview

In this notebook we will compute the Global Mean Surface Temperature Anomalies (GMSTA) from CMIP6 data and compare it with observations. This notebook is heavily inspired by the GMST example in the CMIP6 cookbook and we thank the authors for their workflow.

  1. We will get the CMIP6 temperature data from the AWS open data program via the us-west-2 origin

  2. In order to do this, we will use an intake-ESM catalog (hosted on NCAR’s GDEX) that uses pelicanFS backed links instead of https or s3 links

  3. We will grab observational data hosted on NCAR’s GDEX, which is accessible via the NCAR origin

  4. Please refer to the first chapter of this cookbook to learn more about OSDF, pelican or pelicanFS

  5. This notebook demonstrates that you can seamlessly stream data from multiple OSDF origins in your workflow

Prerequisites

ConceptsImportanceNotes
Intro to Intake-ESMNecessaryUsed for searching CMIP6 data
Understanding of ZarrHelpfulFamiliarity with metadata structure
SeabornHelpfulUsed for plotting
PelicanFSNecessaryThe python package used to stream data in this notebook
OSDFHelpfulOSDF is used to stream data in this notebook
  • Time to learn: 20 mins

Imports

/tmp/ipykernel_4821/2849986847.py:5: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from tqdm.autonotebook import tqdm

We will use an intake-ESM catalog hosted on NCAR’s Geoscience Data Exchange. This is nothing but the AWS cmip6 catalog modified to use OSDF

https://data.gdex.ucar.edu/d850001/catalogs/cmip6-osdf-zarr.json

Set up local dask cluster

Before we do any computation let us first set up a local cluster using dask

/home/runner/micromamba/envs/osdf-cookbook/lib/python3.12/site-packages/distributed/node.py:195: UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 44975 instead
  warnings.warn(
Loading...

Data Loading

Load CMIP6 data from AWS

Loading...
Loading...
  • Let us inspect the zarr store paths to see if we are using the pelican protocol.

  • We see that zstore column has paths that start with ‘osdf:///’ instead of ‘https://’ which tells us that we are not using a simple ‘https’ GET request to fetch the data.

  • In order to know more about the pelican protocol, please refer to the first chapter of this cookbook.

Loading...

Grab some Observational time series data for comparison with ensemble spread

  • The observational data we will use is the HadCRUT5 dataset from the UK Met Office

  • The data has been downloaded to NCAR’s Geoscience Data Exchange (GDEX) from https://www.metoffice.gov.uk/hadobs/hadcrut5/

  • We will use an OSDF to access this copy from the GDEX. Again the links will start with ‘osdf:///’

CPU times: user 573 ms, sys: 108 ms, total: 681 ms
Wall time: 1.66 s
Loading...

Some helpful functions

GMST computation

  0%|          | 0/27 [00:00<?, ?it/s]
  4%|▎         | 1/27 [00:00<00:24,  1.08it/s]
  7%|▋         | 2/27 [00:01<00:12,  1.94it/s]
 11%|█         | 3/27 [00:01<00:09,  2.61it/s]
 15%|█▍        | 4/27 [00:01<00:06,  3.51it/s]
 19%|█▊        | 5/27 [00:01<00:05,  4.11it/s]
 22%|██▏       | 6/27 [00:01<00:04,  4.99it/s]
 26%|██▌       | 7/27 [00:01<00:03,  5.09it/s]
 30%|██▉       | 8/27 [00:02<00:03,  4.80it/s]
 33%|███▎      | 9/27 [00:02<00:03,  4.91it/s]
 37%|███▋      | 10/27 [00:02<00:04,  4.02it/s]
 41%|████      | 11/27 [00:03<00:04,  3.57it/s]
 44%|████▍     | 12/27 [00:03<00:03,  3.84it/s]
 48%|████▊     | 13/27 [00:03<00:03,  4.11it/s]
 52%|█████▏    | 14/27 [00:03<00:03,  4.33it/s]
 56%|█████▌    | 15/27 [00:03<00:02,  4.31it/s]
 59%|█████▉    | 16/27 [00:04<00:02,  4.45it/s]
 63%|██████▎   | 17/27 [00:04<00:02,  4.73it/s]
 67%|██████▋   | 18/27 [00:04<00:01,  4.55it/s]
 70%|███████   | 19/27 [00:04<00:01,  4.54it/s]
 74%|███████▍  | 20/27 [00:05<00:01,  4.77it/s]
 78%|███████▊  | 21/27 [00:05<00:01,  5.11it/s]
 81%|████████▏ | 22/27 [00:05<00:00,  5.25it/s]
 85%|████████▌ | 23/27 [00:05<00:00,  5.87it/s]
 89%|████████▉ | 24/27 [00:05<00:00,  5.85it/s]
 93%|█████████▎| 25/27 [00:05<00:00,  5.75it/s]
 96%|█████████▋| 26/27 [00:06<00:00,  5.29it/s]
100%|██████████| 27/27 [00:06<00:00,  5.28it/s]
100%|██████████| 27/27 [00:06<00:00,  4.33it/s]

CPU times: user 11.3 s, sys: 2.08 s, total: 13.3 s
Wall time: 2min 37s
/tmp/ipykernel_4821/2886188115.py:5: FutureWarning: In a future version of xarray the default value for join will change from join='outer' to join='exact'. This change will result in the following ValueError: cannot be aligned with join='exact' because index/labels/sizes are not equal along these coordinates (dimensions): 'year' ('year',) The recommendation is to set join explicitly for this case.
  big_ds = xr.concat([ds.reset_coords(drop=True)
Loading...

Compute anomlaies and plot

  • We will compute the temperature anomalies w.r.t 1960-1990 baseline period

  • Convert xarray datasets to pandas dataframes

  • Use Seaborn to plot GMSTA

Loading...
Loading...
Loading...

Almost there! Let us now use seaborn to plot all the anomalies

<Figure size 1113.5x500 with 1 Axes>

Summary

In this notebook, we used surface air temperature data from several CMIP6 models for the ‘historical’, ‘SSP245’ and ‘SSP370’ runs to compute Global Mean Surface Temperature Anomaly (GMSTA) relative to the 1960-1990 baseline period and compare it with anomalies computed from the HadCRUT monthly surface temperature dataset. We used a modified intake-ESM catalog and pelicanFS to ‘stream/download’ temperature data from two different OSDF origins. The CMIP6 model data was streamed from the AWS OpenData origin in the us-west-2 region and the observational data was streamed from NCAR’s OSDF origin.

Resources and references

  1. Original notebook in the Pangeo Gallery by Henri Drake and Ryan Abernathey

  2. CMIP6 cookbook by Ryan Abernathey, Henri Drake, Robert Ford and Max Grover

  3. Coupled Model Intercomparison Project 6 was accessed from https://registry.opendata.aws/cmip6 using a modified intake-ESM catalog hosted on NCAR’s GDEX

  4. We thank the UK Met Office Hadley Center for providing the observational data