ERA5

ERA5 is ECMWF’s fifth-generation global climate reanalysis, combining historical observations with numerical weather prediction models to produce a comprehensive, consistent record of past weather and climate from 1940 to present. Data is accessed via the Copernicus Climate Data Store (CDS) API.

MetaData(ERA5())
MetaData("CDSAPI_KEY", "1 concurrent job", :weather, Dict(:u_wind_10m => "10m u-component of wind (m/s)", :total_cloud_cover => "Total cloud cover (0–1)", :volumetric_soil_water_1 => "Volumetric soil water layer 1 (m³/m³)", :dewpoint_temperature_2m => "2m dewpoint temperature (K)", :surface_pressure => "Surface pressure (Pa)", :skin_temperature => "Skin temperature (K)", :snowfall => "Snowfall (m of water equivalent)", :evaporation => "Total evaporation (m of water equivalent)", :temperature_2m => "2m temperature (K)", :v_wind_10m => "10m v-component of wind (m/s)"…), :raster, "0.25° (~25 km)", "Global", :timeseries, Hour(1), "1940–present", "CC BY 4.0", "https://cds.climate.copernicus.eu/", Dict("Rasters" => "a3a2b9e3-a471-40c9-b274-f788e487c689"))

Setup

  1. Create a free account at https://cds.climate.copernicus.eu/
  2. Accept the ERA5 dataset license on the CDS website
  3. Get your Personal Access Token from https://cds.climate.copernicus.eu/profile
  4. Set the CDSAPI_KEY environment variable:
ENV["CDSAPI_KEY"] = "your-personal-access-token"

Basic Usage

using GeoDataAccess
using GeoDataAccess: ERA5, DataAccessPlan, fetch
using GeoInterface.Extents: Extent
using Dates

# Temperature and precipitation over Europe for 3 days
ext = Extent(X=(-10.0, 30.0), Y=(35.0, 60.0))
plan = DataAccessPlan(ERA5(), ext, Date(2024, 1, 1), Date(2024, 1, 3);
    variables = [:temperature_2m, :total_precipitation])
files = fetch(plan)

Specific Times

By default, data is retrieved at 6-hourly intervals (00:00, 06:00, 12:00, 18:00). Request all 24 hours or specific times:

# All hours
plan = DataAccessPlan(ERA5(), ext, Date(2024, 7, 1), Date(2024, 7, 1);
    variables = [:temperature_2m],
    times = [lpad(h, 2, '0') * ":00" for h in 0:23])

# Only noon
plan = DataAccessPlan(ERA5(), ext, Date(2024, 7, 1), Date(2024, 7, 31);
    variables = [:temperature_2m],
    times = ["12:00"])

Options

Option Type Default Description
variables Vector{Symbol} [:temperature_2m] Variables to retrieve
dataset String "reanalysis-era5-single-levels" CDS dataset identifier
product_type String "reanalysis" "reanalysis" or "ensemble_members"
times Vector{String} ["00:00","06:00","12:00","18:00"] Hours to retrieve (UTC)
data_format String "netcdf" "netcdf" or "grib"

Common Variables

Symbol CDS Name Description
:temperature_2m 2m_temperature Air temperature at 2m (K)
:dewpoint_temperature_2m 2m_dewpoint_temperature Dewpoint temperature at 2m (K)
:u_wind_10m 10m_u_component_of_wind U-wind at 10m (m/s)
:v_wind_10m 10m_v_component_of_wind V-wind at 10m (m/s)
:total_precipitation total_precipitation Total precipitation (m)
:surface_pressure surface_pressure Surface pressure (Pa)
:mean_sea_level_pressure mean_sea_level_pressure Mean sea level pressure (Pa)
:skin_temperature skin_temperature Skin temperature (K)
:sea_surface_temperature sea_surface_temperature Sea surface temperature (K)
:total_cloud_cover total_cloud_cover Total cloud cover (0–1)
:low_cloud_cover low_cloud_cover Low cloud cover (0–1)
:high_cloud_cover high_cloud_cover High cloud cover (0–1)
:surface_solar_radiation surface_solar_radiation_downwards Surface solar radiation (J/m²)
:surface_thermal_radiation surface_thermal_radiation_downwards Surface thermal radiation (J/m²)
:snowfall snowfall Snowfall (m of water eq.)
:snow_depth snow_depth Snow depth (m of water eq.)
:soil_temperature_level_1 soil_temperature_level_1 Soil temperature level 1 (K)
:volumetric_soil_water_1 volumetric_soil_water_layer_1 Volumetric soil water layer 1 (m³/m³)
:boundary_layer_height boundary_layer_height Boundary layer height (m)
:evaporation total_evaporation Total evaporation (m of water eq.)

Loading Data

Loading ERA5 NetCDF/GRIB files requires the Rasters package:

using Rasters

raster = load(plan)  # returns Raster or RasterStack