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.

CONUS404 — Monthly precipitation across CONUS

Monthly precipitation across the contiguous US (CONUS404)

This notebook illustrates how to make diagnostic plots using the CONUS404 dataset hosted on NCAR’s Geoscience Data Exchange (GDEX).

CONUS404 is a 4-km, hourly, 43-year hydroclimate reanalysis of the contiguous United States, produced by NCAR and the USGS by dynamically downscaling ERA5 with the Weather Research and Forecasting (WRF) model in a convection-permitting configuration. The dataset is described in Rasmussen et al. (2023, BAMS).

The native data are hourly NetCDF files — roughly 377,000 files for the full 1979–2022 record — which would be awkward to stream individually. GDEX provides a kerchunk reference layer on top of those NetCDFs that exposes the entire record as a single virtual xarray.Dataset. With it, we can slice 43 years of 4-km hourly data using a single xarray call and only stream the bytes we actually need.

What this notebook does

Using one calendar year of CONUS404, we produce a 12-panel map of monthly precipitation totals over CONUS. This is a scaled-down version of Figure 3 in Rasmussen et al. (2023), which averages 35 water years to build the published climatology. Here we focus on a single year so the workflow stays tractable and the seasonal march of precipitation across the country is visible in one figure.

https://data.gdex.ucar.edu/d559000/catalogs/d559000-https.json
/glade/derecho/scratch/harshah

Create a PBS cluster

Load CONUS 404 data from GDEX using an intake catalog

Loading...
  • col.df turns the catalog object into a pandas dataframe!

  • (Actually, it accesses the dataframe attribute of the catalog)

Select data and plot

What if you don’t know the variable names ?

  • Use pandas logic to print out the short_name and long_name

Loading...

Find the precipitation variable in the catalog

CONUS404 WRF output stores grid-scale accumulated precipitation per hourly output step as PREC_ACC_NC (units: mm). Because the output step is hourly, this is also the hourly precipitation rate in mm hr⁻¹.

Loading...
kerchunk url is : https://data.gdex.ucar.edu/d559000/kerchunk/wrf2d-remote-https.parq

Choosing how to access CONUS404

CONUS404 is published as hourly NetCDF files — one file per hour, roughly 377,000 files for the full 1979–2022 record. Streaming hundreds of thousands of small files over the network would be slow and brittle.

GDEX adds a kerchunk reference layer on top of those NetCDFs. A kerchunk reference is a small parquet file that tells xarray which byte range of which NetCDF holds each chunk. From the reader’s perspective it looks like a single virtual xarray.Dataset, and you only stream the bytes you actually request.

GDEX publishes two such references for CONUS404, aggregating across all water years and all variables in each group:

FileCoverage
wrf2dAll 2D variables — precipitation, 2-m temperature, surface energy fluxes, snow water equivalent, …
wrf3dAll 3D variables — temperature, humidity, wind on model levels

We want hourly precipitation (PREC_ACC_NC), which is a 2D variable, so we pick the wrf2d reference from the catalog paths returned in the previous cell and open it with xarray’s kerchunk engine. The result is the full 43-year hourly record of every 2D variable in a single Dataset — ready to slice with .sel(Time=...).

Load data into xarray

CPU times: user 10.8 s, sys: 1.45 s, total: 12.3 s
Wall time: 13.5 s
Loading...

Data Analysis

Part A: Monthly precipitation climatology

We sum hourly precipitation to monthly totals over WY 2020 and lay them out as a 12-panel map. This is one water year — Fig. 3 of Rasmussen et al. (2023) averages 35 water years. To reproduce the published climatology, loop this reduction over water years 1986–2020 and average.

CPU times: user 1.71 s, sys: 61.6 ms, total: 1.77 s
Wall time: 1.76 s
Loading...

Compute the monthly totals and plot

The next cell triggers the reduction: streaming hourly precipitation chunks from GDEX for all of 2020 and summing into 12 monthly grids.

CPU times: user 2min 32s, sys: 6.83 s, total: 2min 39s
Wall time: 10min 42s
<Figure size 1600x900 with 13 Axes>
CPU times: user 28.1 s, sys: 1.2 s, total: 29.4 s
Wall time: 1min 1s