pr_dl_era5: Download Global ERA5 (land) driver data

View source: R/pr_dl_era5.R

pr_dl_era5R Documentation

Download Global ERA5 (land) driver data

Description

Data is downloaded from the Copernicus Data Store, this routine therefore requires a valid account with this service and your ID and key installed on your system using the 'ecmwfr' package.

Usage

pr_dl_era5(
  path = tempdir(),
  file = "era5.nc",
  product = "era5",
  year = 2019,
  extent = c(-80, -70, 40, 50),
  time_out = 3600,
  user
)

Arguments

path

a path where to save the gridded data

file

filename of the file holding the final ERA5 netcdf data

product

which ERA5 product to download,

year

year of the data queried, this can be a single year or a list of multiple years e.g. c(2018,2019,2020). Note that you will need data for the year of interest and the preceding year to make predictions. When specifying one year the preceding year will be appended, when specifying multiple years no checks are in place!!

extent

vector with coordinates defining the region of interest defined as ymax, xmin, ymin, xmax in lat/lon (default = c( 40, -80, 50, -70))

time_out

time out in seconds before the ecmwfr download returns to the prompt retaining the request running on the CDS server. Data can be retrieved later from the CDS webpage once finished. By default the time-out is set to an 3600 seconds (1h). It is advised to increase this to 2 or 3 hours for larger downloads.

user

Copernicus Data Store user ID (a number), on linux do not forget to set options(keyring_backend='file') if you use a file based keyring.

Details

The routine provides access to all available model runs and is a user friendly wrapper around a standard 'ecmwfr' call. Custom data formatting is possible but we refer to the 'ecmwfr' package.

Value

nothing is returned to the R working environment, files are downloaded and stored on disk

Examples


## Not run: 
print("todo")

## End(Not run)

khufkens/phenor documentation built on Aug. 31, 2023, 1:24 a.m.