Commit 87bb2834 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

fix(test): use the 365.25 day by a year accordinf to the complete leap cycle of 400 years

parent 22d3f5ff
Pipeline #22383 passed with stages
in 8 minutes and 13 seconds
......@@ -387,10 +387,10 @@ CreateRunOptions <- function(FUN_MOD, InputsModel,
}
Factor <- NULL
if (inherits(InputsModel, "hourly")) {
Factor <- 365.2425 * 24
Factor <- 365.25 * 24
}
if (inherits(InputsModel, "daily")) {
Factor <- 365.2425
Factor <- 365.25
}
if (inherits(InputsModel, "monthly")) {
Factor <- 12
......
......@@ -55,10 +55,10 @@
monthly = 28:31 * 24,
yearly = 365:366 * 24)
res$TimeStepMean <- switch(res$TimeUnit,
hourly = 1,
daily = 1 * 24,
monthly = 365.2425 / 12 * 24,
yearly = 365.2425 * 24)
hourly = 1,
daily = 1 * 24,
monthly = 365.25 / 12 * 24,
yearly = 365.25 * 24)
res$TimeStep <- res$TimeStep * 3600
res$TimeStepMean <- as.integer(res$TimeStepMean * 3600)
res$Class <- c(res$TimeUnit, res$Class)
......@@ -68,7 +68,7 @@
res$Class <- res$Class[!is.na(res$Class)]
if (!is.null(DatesR)) {
if (all(DiffTimeStep != res$TimeStep)) {
stop("the time step of the model inputs must be ", res$TimeUnit, "\n")
stop("the time step of the model inputs must be ", res$TimeUnit)
}
}
return(res)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment