diff --git a/R/Load.R b/R/Load.R index b5600af2a0e2b7c5383b71bf7a20fffd426e5081..9feec5d37bb6aa9cdd00cd2687675c7fca10d63a 100644 --- a/R/Load.R +++ b/R/Load.R @@ -2314,16 +2314,25 @@ Load <- function(var, exp = NULL, obs = NULL, sdates, nmember = NULL, } else { origin <- 0 } + dates[["start"]] <- do.call(c, lapply(sdates, + function(x) { + do.call(c, lapply((origin:(origin + number_ftime - 1)) * sampleperiod, + function(y) { + addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), + store_period, y + leadtimemin - 1) + })) + })) } else { origin <- 0 - } - dates[["start"]] <- do.call(c, lapply(sdates, + dates[["start"]] <- do.call(c, lapply(sdates, function(x) { - do.call(c, lapply((origin:(origin + number_ftime - 1)) * sampleperiod, + do.call(c, lapply((0:(number_ftime - 1)) * sampleperiod, function(y) { - addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), store_period, y + leadtimemin - 1) + addTime(as.POSIXct(x, format = "%Y%m%d", tz = "UTC"), + store_period, y + leadtimemin - 1) })) })) + } attr(dates[["start"]], "tzone") <- "UTC" # end is similar to start, but contains the end dates of each forecast # time step