Trying to request ERA5 data. The request is limited by size, and the system will auto reject any requests bigger than the limit. However, one wants to be as close to the request limit as possible as each request takes few hours to be processed by Climate Data Store (CDS).
For example, I have a vector of years <- seq(from = 1981, to = 2019, by = 1)
and a vector of variables <- c("a", "b", "c", "d", "e"...., "z")
. The max request size is 11. Which means length(years) * length(variables) must be smaller or equal to 11.
For each request, I have to provide a list containing character vectors for years and variables. For example:
req.list <- list(year = c("1981", "1982", ..."1991"), variable = c("a"))
This will work since there are 11 years and 1 variable.
I thought about using expand.grid() then use row 1-11, row 12-22, ...and unique() value each column to get the years and variable for request. But this approach sometimes will lead to request size too big:
req.list <- list(year = c("2013", "2014", ..."2018"), variable = c("a", "b"))
is rejected since length(year) * length(variable) = 12 > 11.
Also I am using foreach() and doParallel to create multiple requests (max 15 requests at a time)
If anyone has a better solution please share (minimize the number of unique combos while obeying the request size limit), thank you very much.