GRASS logo

NAME

t.in.era5 - Imports ERA5-Land (falling back to ERA5) daily climate variables from the Copernicus Climate Data Store as one space-time raster dataset per variable.

KEYWORDS

temporal, import, climate, hydrology

SYNOPSIS

t.in.era5
t.in.era5 --help
t.in.era5 [-e] variables=string[,string,...] start=string end=string [area=north,west,south,east] output_prefix=string [cache_dir=name] [--help] [--verbose] [--quiet] [--ui]

Flags:

-e
Force plain ERA5 for every variable (skip the ERA5-Land attempt entirely)
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

variables=string[,string,...] [required]
Climate variables to import, one STRDS per variable (named <output_prefix>_<variable>)
Options: precipitation, temperature, temperature_min, temperature_max, dewpoint_temperature, potential_evaporation, solar_radiation, wind_u, wind_v, surface_pressure, snowfall
start=string [required]
Start date, YYYY-MM-DD
end=string [required]
End date, YYYY-MM-DD (inclusive)
area=north,west,south,east
Bounding box in WGS84 degrees (north,west,south,east); default derived from the current region
output_prefix=string [required]
STRDS name prefix; each variable becomes <output_prefix>_<variable>
Default: era5
cache_dir=name
Directory to cache downloaded NetCDF files in (default a temporary, run-scoped directory -- pass a persistent path to avoid re-downloading on repeat runs)

Table of contents

DESCRIPTION

t.in.era5 downloads one or more daily climate variables from the Copernicus Climate Data Store (CDS) and imports each as its own STRDS (<output_prefix>_<variable>), ready to feed r.hydro.hbv.forcing (which reduces a STRDS to a per-basin table for r.hydro.hbv), or any other temporal GRASS workflow.

For each variable, ERA5-Land (~9km grid, generally preferable for land applications) is tried first; if that fails for a given month (explicit CDS error, network issue, or a genuine coverage gap), the module automatically falls back to ERA5 (~31km grid, longer historical record) for that month only -- other months/variables are unaffected. One CDS quirk drives part of this fallback even when ERA5-Land data actually exists: the derived-era5-land-daily-statistics product used for "instantaneous" variables (temperature, wind, pressure, ...) explicitly refuses to compute daily statistics for accumulated variables (precipitation, potential evaporation, solar radiation, snowfall). For those, t.in.era5 requests raw hourly reanalysis-era5-land data instead and sums it to a daily total itself -- still ERA5-Land, just via a different CDS product -- before falling back to ERA5's own (accumulation-capable) daily-statistics product only if that also fails.

Requests are chunked per (variable, year, month), so a single failure doesn't force re-fetching a whole multi-year request, and repeat runs against the same cache_dir reuse already-downloaded months instead of re-downloading them.

VARIABLES

keyCDS variablenative unitsconverted to
precipitationtotal_precipitationm/day (accum.)mm/d
temperature2m_temperature (daily mean)Kdeg C
temperature_min2m_temperature (daily min)Kdeg C
temperature_max2m_temperature (daily max)Kdeg C
dewpoint_temperature2m_dewpoint_temperatureKdeg C
potential_evaporationpotential_evaporationm/day (accum.)mm/d
solar_radiationsurface_solar_radiation_downwardsJ/m2 (accum.)MJ/m2/d
wind_u10m_u_component_of_windm/sm/s
wind_v10m_v_component_of_windm/sm/s
surface_pressuresurface_pressurePakPa
snowfallsnowfallm (accum.)mm/d

CDS ACCOUNT SETUP

t.in.era5 uses the cdsapi Python package, which reads credentials from ~/.cdsapirc. Create a free account at https://cds.climate.copernicus.eu, accept the ERA5/ERA5-Land dataset licences on the CDS website (one-time, per dataset), then copy your personal access token from your CDS profile page into ~/.cdsapirc:
url: https://cds.climate.copernicus.eu/api
key: <your-personal-access-token>
(the url/key values above are the real format this file takes -- only the token itself is account-specific). Without this file (or with an invalid token), every CDS request t.in.era5 makes will fail immediately with an authentication error.

EXAMPLE

g.region n=34 s=31 e=49 w=47 res=0:06 # ~0.1 deg, matches ERA5-Land's native grid

t.in.era5 variables=precipitation,temperature,potential_evaporation \
  start=2001-06-01 end=2001-08-31 \
  output_prefix=karkheh cache_dir=$HOME/era5_cache

r.hydro.hbv.forcing strds=karkheh_precipitation basins=basins \
  basins_vector=basins_v output_table=karkheh_precip_table

SEE ALSO

r.hydro.hbv, r.hydro.hbv.forcing, t.create, t.register, r.import

AUTHOR

Yann Chemin

SOURCE CODE

Available at: t.in.era5 source code (history)

Accessed: Monday Jul 27 12:30:21 2026


Main index | Temporal index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual