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.
a path where to save the gridded data
filename of the file holding the final ERA5 netcdf data
which ERA5 product to download,
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!!
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 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.
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.
nothing is returned to the R working environment, files are downloaded and stored on disk
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.
if (FALSE) {
print("todo")
}