Commit b6f18ce9 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

fix(Utils): fix monthly and yearly time step management in .GetFeatModel

Refs #106
parent 91cdf61a
Pipeline #21791 passed with stages
in 8 minutes
...@@ -49,17 +49,16 @@ ...@@ -49,17 +49,16 @@
} }
res$TimeStep <- switch(res$TimeUnit, res$TimeStep <- switch(res$TimeUnit,
hourly = 1, hourly = 1,
daily = 24, daily = 1 * 24,
monthly = 28:31, monthly = 28:31 * 24,
yearly = 365:366) yearly = 365:366 * 24)
res$TimeStep <- res$TimeStep * 3600 res$TimeStep <- res$TimeStep * 3600
res$Class <- c(res$TimeUnit, res$Class) res$Class <- c(res$TimeUnit, res$Class)
if (grepl("CemaNeige", res$NameFunMod)) { if (grepl("CemaNeige", res$NameFunMod)) {
res$Class <- unique(c(res$Class, "CemaNeige")) res$Class <- unique(c(res$Class, "CemaNeige"))
} }
if (DiffTimeStep != res$TimeStep) { 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, "\n")
} }
return(res) 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