Start(): Error when $var$ is not used in path
The wildcard $var$
is necessary to used in the path. It is a special one that serves as both file dim and inner dim. If it is not used, Start() may return errors (but not for all the cases.) See more explanation in practical guide.
Here is an example script that return the error:
Error in FUN(X[[i]], ...) : Could not find dimension 'time' (or its synonims if specified) in the file /esarchive/exp/ecmwf/system5c3s/monthly_mean/tas_f6h/tas_19960501.nc
hcst.path <- "/esarchive/exp/ecmwf/system5c3s/monthly_mean/tas_f6h/tas_$syear$.nc" # change tas to $var$ solve the problem
variable <- "tas"
hcst.sdates <- paste0(1993:2016,"0501")
dim(hcst.sdates) <- list(syear=length(hcst.sdates))
longitude_reorder = CircularSort(0, 361)
latitude_reorder = Sort(decreasing=TRUE)
data <- Start(dat = hcst.path,
var = variable,
syear = hcst.sdates,
time = indices(1:6),
latitude = values(list(-40, 10)),
latitude_reorder = latitude_reorder,
longitude = values(list(0, 60)),
longitude_reorder = longitude_reorder,
synonims = list(latitude=c('lat','latitude'),
longitude=c('lon','longitude'),
member=c('ensemble')),
member = indices(1:25),
return_vars = list(latitude = 'dat',
longitude = 'dat',
time = c('syear')),
split_multiselected_dims = FALSE,
retrieve = T)
issue #80 (closed) was also caused by the missing $var$
, while the error message is different.
TODO:
(1) Test different cases to see if the problematic parts differ.
(2) Add a check for the existence of var
, if not, return an error.