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:

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...
/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
  warnings.warn(
/tmp/ipykernel_4645/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
/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
  warnings.warn(
/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
  warnings.warn(
/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
  warnings.warn(
/home/runner/micromamba/envs/cmip6-cookbook-dev/lib/python3.14/site-packages/google/auth/transport/grpc.py:43: FutureWarning: grpcio < 1.83.0 does not support Post-Quantum Cryptography (PQC). Support for non-PQC environments is deprecated. In April 2027, google-auth will raise its minimum requirements to enforce grpcio >= 1.83.0. For more details on Google Cloud's post-quantum security migration, visit: https://cloud.google.com/security/resources/post-quantum-cryptography
  warnings.warn(
/tmp/ipykernel_4645/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 9.24 s, sys: 2.53 s, total: 11.8 s
Wall time: 2min 47s
<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

References
  1. Pendergrass, A. G., & Deser, C. (2017). Climatological Characteristics of Typical Daily Precipitation. Journal of Climate, 30(15), 5985–6003. 10.1175/jcli-d-16-0684.1