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
Showing with 4 additions and 5 deletions
+4 -5
......@@ -49,17 +49,16 @@
}
res$TimeStep <- switch(res$TimeUnit,
hourly = 1,
daily = 24,
monthly = 28:31,
yearly = 365:366)
daily = 1 * 24,
monthly = 28:31 * 24,
yearly = 365:366 * 24)
res$TimeStep <- res$TimeStep * 3600
res$Class <- c(res$TimeUnit, res$Class)
if (grepl("CemaNeige", res$NameFunMod)) {
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")
}
return(res)
......
Supports Markdown
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