Download ERA5 data after querying with the function grd_get_url

grd_download_data_era5(output_grd_get_url_era5)

Arguments

output_grd_get_url_era5

output of grd_get_url with collection="ERA5"

Note

There must exist the file .cdsapirc in the root directory of the computer (e.g. "/home/ptaconet"). See https://dominicroye.github.io/en/2018/access-to-climate-reanalysis-data-from-r/ for additional details

Examples

# NOT RUN {
require(sf)

roi = st_as_sf(data.frame(
geom = "POLYGON ((-5.82 9.54, -5.42 9.55, -5.41 8.84, -5.81 8.84, -5.82 9.54))"),
wkt = "geom",crs = 4326)

time_range = as.Date(c("2017-01-01","2017-01-30"))

# query to get ERA5 url
era5_urls <- grd_get_url(collection = "ERA5", variables = c("10m_u_component_of_wind","10m_v_component_of_wind"), roi = roi, time_range = time_range)

# now download data
grd_download_data_era5(era5_urls)
# }