RMS() error when time_dim is not 'sdate'
Hi @aho,
I found another error in the .RMS()
atomic function. The error is the following:
exp <- array(rnorm(120), dim = c(sdates = 5, ftimes = 2, lon = 1, lat = 1))
obs <- array(rnorm(80), dim = c(sdates = 5, ftimes = 2, lon = 1, lat = 1))
RMS(exp, obs, time_dim = 'sdates', dat_dim = NULL, conf = TRUE)
"Error in Eno(dif, time_dim, ncores = ncores_input) :
Parameter 'time_dim' is not found in 'data' dimension."
It is because this line is hard-coded:
nsdate <- as.numeric(dim(exp)[1])
dif <- array(dim = c(sdate = nsdate, nexp = nexp, nobs = nobs))
The correct line would be:
dif <- array(dim = c(dim(exp)[1], nexp = nexp, nobs = nobs))
I have corrected it in this commit. The changes can be found in this merge request where I have also added a test for this case.
Sorry for the inconvenience to not have seen this error before.
Cheers,
Eva