Problem using StartR with dates
Hi @aho, @nperez and @pabretonniere (PA I think you might help with this)
I'm loading data from multiple seasonal forecast systems but I've a problem with the meteofrance data.
library(startR)
data_mf <- Start(dat = list(list(path='/esarchive/exp/meteofrance/system6c3s/daily_mean/$var$_f6h/$var$_$sdate$.nc')),
var = 'psl',
member = 'all',
sdate = '19930101',
time = as.POSIXct('1993-01-01'),
latitude = indices(1:3),
longitude = indices(1:3),
synonims = list(latitude=c('lat','latitude'),
longitude=c('lon','longitude'),
member=c('ensemble','realization')),
return_vars = list(latitude = 'dat',
longitude = 'dat',
time = NULL),
retrieve = T)
When I load this I get the following error:
Error in `-.POSIXt`(var, x) : can only subtract from "POSIXt" objects
However if I change the path to load the ECMWF data (/esarchive/exp/ecmwf/system5c3s/daily_mean/$var$_f6h/$var$_$sdate$.nc
) these data are successfully retrieved.
I've been checking the dates with cdo showtimestamp
and it is providing the same values for both datasets. However if I use ncdump -c -t
I have this for meteofrance:
time = 19930101.75, 19930102.75, 19930103.75, 19930104.75, 19930105.75,...
and this for ecmwf:
time = "1993-01-01 18", "1993-01-02 18", "1993-01-03 18", "1993-01-04 18",...
Do you think this is the source of my error? Should the Meteofrance files be reformatted or there is any option in StartR to deal with these files? I know I can use the indices option to specify the time, but as I'm loading different systems this is not the most convenient option to me (particularly due to Glosea5....).
Thanks a lot,
Vero