Start() fails when evaluating condition in inner dimension check
The "Not all the inner dims are defined in Start() call" check is supposed to raise an informative error if there are dimensions in the file that are not defined in the Start() call. However, this check only works if there is one undefined inner dim, and it fails when there are two or more undefined inner dims:
Error in if (data_dims[tmp] != 1) { : the condition has length > 1
This is because data_dims[tmp]
is of length > 1 in that case and cannot be evaluated to a single value. The condition should be improved to consider this case.
Reproducible example:
path <- "/gpfs/projects/bsc32/esarchive_cache/exp/ecmwf/system51c3s/constant/sftof/$var$.nc"
data <- startR::Start(dat = path,
var = "sftof",
lon = values(list(200, 201)),
lat = values(list(-50.5, -60.5)),
return_vars = list(lat = NULL, lon = NULL),
synonims = list(lon = c('lon','longitude'),
lat = c('lat','latitude')),
lat_reorder = Sort(decreasing = TRUE),
lon_reorder = CircularSort(0, 360),
num_procs = 1, retrieve = TRUE)
Victòria