Formats ERA5 data as downloaded through the Copernicus CDS service, using pr_dl_era5().

pr_fm_era5(
  path = tempdir(),
  file = "era5.nc",
  year = 2016,
  offset = 264,
  internal = TRUE,
  extent
)

Arguments

path

a path to the gridded data

file

a netCDF containing ERA5 data, by default this will be a file named era5.nc. Alternatively you can point to a different file in the path (e.g. when you downloaded multiple source files)

year

year to process (requires year - 1 to be present / downloaded)

offset

offset of the time series in DOY (default = 264, sept 21)

internal

TRUE / FALSE, write data structure to file as RDS (default = FALSE)

extent

vector with coordinates defining the region of interest defined as xmin, xmax, ymin, ymax in lat/lon (default = c(-80, -70, 40, 50)), note that this differs from the download routine!!

Value

data structure formatted for phenor model optimization and validation

Examples

# run with default settings
# look for alternative models on the CMIP6
# downscaled data page
if (FALSE) {
cmip5_data <- pr_fm_cmip()
}