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.

Precipitation Frequency Analysis

Authors
Affiliations
University at Albany (SUNY)
Argonne National Laboratory

Overview

This notebook shows an advanced analysis case. The calculation was inspired by Angie Pendergrass’s work on precipitation statistics, as described in the following websites / papers:

We use xhistogram to calculate the distribution of precipitation intensity and its changes in a warming climate.

Prerequisites

ConceptsImportanceNotes
Intro to XarrayNecessary
Understanding of NetCDFHelpfulFamiliarity with metadata structure
DaskHelpful
  • Time to learn: 5 minutes


Imports

Compute Cluster

Here we use a dask cluster to parallelize our analysis.

Initiate the Dask client:

/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/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 43797 instead
  warnings.warn(
Loading...

Load Data Catalog

Loading...
78
source_id experiment_id BCC-CSM2-MR historical 1 ssp126 1 ssp245 1 ssp370 1 ssp585 1 CNRM-CM6-1 highresSST-present 1 historical 3 ssp126 1 ssp245 1 ssp370 1 ssp585 1 CNRM-CM6-1-HR highresSST-present 1 CNRM-ESM2-1 historical 1 ssp126 1 ssp245 1 ssp370 1 ssp585 1 GFDL-CM4 1pctCO2 2 abrupt-4xCO2 2 amip 2 historical 2 piControl 2 GFDL-CM4C192 highresSST-future 1 highresSST-present 1 GFDL-ESM4 1pctCO2 1 abrupt-4xCO2 1 esm-hist 1 historical 1 ssp119 1 ssp126 1 ssp370 1 GISS-E2-1-G historical 2 HadGEM3-GC31-HM highresSST-present 1 HadGEM3-GC31-LM highresSST-present 1 HadGEM3-GC31-MM highresSST-present 1 IPSL-CM6A-ATM-HR highresSST-present 1 IPSL-CM6A-LR highresSST-present 1 historical 15 piControl 1 ssp126 3 ssp245 2 ssp370 10 ssp585 1 MRI-ESM2-0 historical 1 Name: zstore, dtype: int64
Loading...
/tmp/ipykernel_5188/634789861.py:15: FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`.
  pr_hist_norm = 100 * pr_hist / ds.dims['lon'] / log_bin_spacing
/tmp/ipykernel_5188/634789861.py:15: FutureWarning: The return type of `Dataset.dims` will be changed to return a set of dimension names in future, in order to be more consistent with `DataArray.dims`. To access a mapping from dimension names to lengths, please use `Dataset.sizes`.
  pr_hist_norm = 100 * pr_hist / ds.dims['lon'] / log_bin_spacing
CPU times: user 11.6 s, sys: 3.1 s, total: 14.7 s
Wall time: 3min 14s
<Figure size 1200x600 with 2 Axes>

We’re at the end of the notebook, so let’s shutdown our Dask cluster.


Summary

In this notebook, we used CMIP6 data to compare precipitation intensity in the SSP585 scenario to historical runs.

What’s next?

More examples of using CMIP6 data.

Additional resources