RunModel_CemaNeige fails in CreateIniStates at the hourly time step
When I try to use RunModel_CemaNeige alone (without GR models) at the hourly time step, the following error appear:
UH1' must be numeric of length 480 (20 * 24)
The error appear because in CreateIniStates, the following condition if ("CemaNeige" %in% ObjectClass & ! "GR" %in% ObjectClass)
leads to a UH1
set to rep(Inf, UH1n)
instead of rep(Inf, UH1n*k)
. This error appear also with UH2
. Note that the k
value is defined later in the script as:
if ("hourly" %in% ObjectClass) {
k <- 24
} else {
k <- 1
}
I suggest therefore to move this part at the beginning of the function CreateIniStates and after that to define everywhere UH1 and UH2 as rep(Inf, UH1n*k).
PS: The examples with CemaNeige at the hourly time step can't be run, the U2345030 catchment is not included in the package (and we can't use another catchment included in the package because they either have temperature data or hourly data, but never both).