Dimensions provided by Start() and Compute() do not match
I'm trying to interpolate when loading the data with the Start() and Compute () functions, and the discovered data dimensions by Start() do not match with those returned by Compute().
Here is an example of the code I'm using to load and interpolate the data:
library(startR)
library(s2dverification)
data = Start(dataset = '/esarchive/exp/ecearth/a1ua/cmorfiles/DCPP/EC-Earth-Consortium/EC-Earth3/dcppA-hindcast/$member$/Amon/$var$/gr/v20190713/$var$_Amon_*_s$sdate$-$member$_gr_$leadyear$.nc',
var = 'tas',
sdate = paste0(2000:2004),
month = 'all',
lat = values(list(0,14)),
lon = values(list(0,28)),
leadyear = 'all',
member = 1:4,
leadyear_depends = 'sdate',
month_across = 'leadyear',
synonims = list(month = c('month','time'), lon = c('lon', 'longitude'), lat = c('lat', 'latitude')),
transform = CDORemapper,
transform_extra_cells = 2,
transform_params = list(grid = 'r200x100',
# grid = '/esarchive/recon/jma/jra55/monthly_mean/tas_f6h/tas_198001.nc',
method = 'con', crop = c(0,28,0,14)),
transform_vars = c('lat', 'lon'),
return_vars = list(lat = 'dataset', lon = 'dataset'),
lat_reorder = Sort(),
lon_reorder = CircularSort(-180, 180),
num_procs = 1, retrieve = FALSE)
fun = function(exp){
return(exp)
}
step <- Step(fun = fun,
use_libraries = c('s2dverification'),
target_dims = c('lat','lon'),
output_dims = c('lat','lon'))
wf <- AddStep(inputs = data,
step = step)
res <- Compute(workflow = wf,
chunks = list(member = 4, month = 6),
threads_load = 2,
threads_compute = 4)
The dimensions given by Start() are:
> attr(data,'Dimensions')
dataset var sdate month lat lon leadyear member
1 1 5 12 8 16 11 4
and by Compute() are:
> dim(res$output1)
lat lon dataset var sdate month leadyear member
8 16 1 1 5 72 3 4
Could you please have a look?
Thanks,
Carlos