Wrong time attributes of Hadgem3 data
Hi @nperez
I found this problem with Hadgem3 (both monthly and daily data). The retrieved time attribute doesn't seem correct. You can see the results below. For daily data, dates[1] is "1998-09-02 12:00:00 UTC"
while it should be "2000-11-01 12:00:00 UTC"
. For monthly data, dates[1] is "2000-06-07 UTC"
while it should be 2000-11-16 UTC
. The returned data values are correct, only the time attribute is wrong. I also tested with startR_v1.0.3 and it returned the same results.
I check the netCDF files and the values are correct, so the problem is not in the files. Other Hadgem3 files (e.g., sdate = 1960; var = 'tasmin') also have the same problem, but MPI-ESM1.2-HR daily data is fine. (e.g., path_mpi_esm <- '/esarchive/exp/CMIP6/dcppA-hindcast/mpi-esm1-2-hr/cmip6-dcppA-hindcast_i1p1/DCPP/MPI-M/MPI-ESM1-2-HR/dcppA-hindcast/r1i1p1f1/day/$var$/gn/v20200101/$var$_day_MPI-ESM1-2-HR_dcppA-hindcast_s$sdate$-r1i1p1f1_gn_$fyear$.nc'
)
Do you have any clue? I can look into Start() code later (right now I'm doing the decadal prediction tests we discussed yesterday.)
Cheers,
An-Chi
#/// daily data ///
path_hadgem3 <- paste0('/esarchive/exp/CMIP6/dcppA-hindcast/hadgem3-gc31-mm/',
'cmip6-dcppA-hindcast_i1p1/DCPP/MOHC/HadGEM3-GC31-MM/',
'dcppA-hindcast/r1i1p1f2/day/$var$/gn/v20200101/',
'$var$_day_HadGEM3-GC31-MM_dcppA-hindcast_s$sdate$-r1i1p1f2_gn_$fyear$.nc')
sdate <- '2000'
fyear_hadgem3 <- paste0(sdate, '1101-', as.numeric(sdate) + 10, '1230')
data <- Start(dat = path_hadgem3,
var = 'tasmax',
sdate = sdate,
fyear = fyear_hadgem3, #indices(1),
time = 'all',
lat = indices(1),
lon = indices(1),
return_vars = list(lat = 'dat', lon = 'dat', time = 'sdate'),
num_procs = 1,
retrieve = TRUE)
dates <- attr(data, 'Variables')$common$time
dim(dates)
sdate time
1 3660
dates[1,1:5] # WRONG!!!!
[1] "1998-09-02 12:00:00 UTC" "1998-09-03 12:00:00 UTC"
[3] "1998-09-04 12:00:00 UTC" "1998-09-05 12:00:00 UTC"
#/// monthly data ///
path_hadgem3 <- paste0('/esarchive/exp/CMIP6/dcppA-hindcast/hadgem3-gc31-mm/',
'cmip6-dcppA-hindcast_i1p1/DCPP/MOHC/HadGEM3-GC31-MM/',
'dcppA-hindcast/r1i1p1f2/Amon/$var$/gr/v20200316/',
'$var$_Amon_HadGEM3_dcppA-hindcast_s$sdate$_r1i1p1f2_gr_200011-201103.nc')
data <- Start(dat = path_hadgem3,
var = 'tas',
sdate = '2000',
time = 'all',
latitude = indices(1),
longitude = indices(1),
return_vars = list(latitude = 'dat', longitude = 'dat', time = 'sdate'),
num_procs = 1,
retrieve = TRUE)
dates <- attr(data, 'Variables')$common$time
dates[1,1:5] #WRONG!!
[1] "2000-06-07 UTC" "2000-07-07 UTC" "2000-08-06 UTC" "2000-09-05 UTC"
[5] "2000-10-05 UTC"