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.

CESM2 Large Ensemble: Global Mean Surface Temperature

Authors
Affiliations
NSF NCAR
NSF NCAR
NSF NCAR
GDEX Cookbook logo

Overview

GDEX hosts output from a range of General Circulation Models (GCMs), including CMIP-era simulations. This notebook demonstrates how to access and analyze that output directly from GDEX, using one such dataset as a worked example.

The CESM2 Large Ensemble (CESM2-LE) is a 100-member ensemble of climate simulations run with the Community Earth System Model v2, designed to separate forced climate change from internal variability. GDEX hosts it as dataset d010092 in cloud-optimized Zarr stores served over OSDF.

In this notebook we compute the ensemble’s Global Mean Surface Temperature (GMST) — opening the Zarr stores directly (no intake-ESM) and using a Dask LocalCluster to handle the out-of-core computation.

  1. Spin up a Dask LocalCluster

  2. Open CESM2-LE TREFHT Zarr stores directly over OSDF

  3. Compute an area-weighted, annual-mean GMST across the ensemble

  4. Visualize the GMST anomaly and its ensemble spread

Prerequisites

ConceptsImportanceNotes
Introduction to ARCO/Zarr on GDEXNecessaryOpening Zarr stores on GDEX
xarrayNecessaryLabeled N-D arrays
DaskNecessaryParallel / out-of-core compute
OSDF CookbookHelpfulWhat OSDF is and how to stream data
Area-weighted averagingHelpfulWhy we cosine-weight by latitude
  • Time to learn: 35 minutes


Imports

Spin up a Dask cluster

CESM2-LE TREFHT is far larger than memory (tens of GB per scenario across all members). A Dask LocalCluster parallelizes the computation across your machine’s cores and streams data lazily, so we never hold the full arrays in memory at once. Click the dashboard link in the output to watch tasks execute.

/home/runner/micromamba/envs/gdex-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 36043 instead
  warnings.warn(
Loading...

CESM2-LE on GDEX

We use TREFHT (reference-height air temperature, in K) at monthly frequency. The ensemble is split across two forcing variants — cmip6 and smbb (50 members each, 100 total) — and two experiments: historical (1850–2014) and ssp370 (2015–2100). Each combination is a single Zarr store.

The store paths follow a regular naming pattern, so we build the URLs directly. You can also discover them on the d010092 data-access page, or from the dataset’s intake-ESM catalog.)

{('historical', 'cmip6'): 'osdf:///ncar-gdex/d010092/atm/monthly/cesm2LE-historical-cmip6-TREFHT.zarr', ('ssp370', 'cmip6'): 'osdf:///ncar-gdex/d010092/atm/monthly/cesm2LE-ssp370-cmip6-TREFHT.zarr', ('historical', 'smbb'): 'osdf:///ncar-gdex/d010092/atm/monthly/cesm2LE-historical-smbb-TREFHT.zarr', ('ssp370', 'smbb'): 'osdf:///ncar-gdex/d010092/atm/monthly/cesm2LE-ssp370-smbb-TREFHT.zarr'}

Opening the Zarr stores

These are Zarr v2 stores with consolidated metadata, so we pass consolidated=True and zarr_format=2. chunks={} keeps the arrays lazy (Dask-backed) — nothing is read until we compute. We focus on the cmip6 forcing variant here; swap in smbb to analyze the other half of the ensemble.

Loading...

Computing area-weighted GMST

A simple average over grid cells would over-weight the poles, where cells cover less area. Therefore the correct method is to weight each cell by the cosine of its latitude. We average over latitude and longitude while keeping time and member_id, so we retain one GMST time series per ensemble member.

We concatenate historical and ssp370 into one 1850–2100 timeline, take the annual mean, compute the area-weighted global mean, and express it as an anomaly relative to the 1850–1900 pre-industrial baseline.

CPU times: user 318 ms, sys: 9.07 ms, total: 327 ms
Wall time: 328 ms
CPU times: user 11.2 s, sys: 1.41 s, total: 12.6 s
Wall time: 1min

Visualizing the GMST anomaly

Plotting every member (thin grey lines) alongside the ensemble mean (bold) shows both the forced warming signal and the spread from internal variability.

<Figure size 1000x600 with 1 Axes>

Summary

We computed the CESM2 Large Ensemble’s global mean surface temperature from GDEX’s Zarr stores: spin up a LocalCluster → open the stores lazily → area-weight and average to annual GMST per member → plot the forced signal against the ensemble spread.

What’s next?

Continue to the High-Resolution Dataset Workflow, which applies a similar GDEX access pattern to high-resolution model output.