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.

ERA5

Homepage
Download location: Copernicus

Download procedure (info; YouTube video series):

Notes

Differing timestamps across variables

Downloading ERA5 monthly data, heat fluxes from the ocean surface have a timestamp at 0600 whereas state variables like air and surface have a timestamp at 0000. A preprocess step using the floor category of the datetime accessor in xarray allows them to be loaded together:

import xarray as xr
basedir = '/gws/nopw/j04/co2clim/datasets/ERA5/monthly/'
filename = 'era5.1x1.monthly.*.*.nc'
def preprocess(ds):
    time = ds.valid_time.dt.floor("D")
    return ds.assign_coords(valid_time=time)
ds = xr.open_mfdataset(basedir+filename,preprocess=preprocess)