Set number of IniStates and StateEnd values when only CemaNeige is used
For initial states (e.g. RunOptions$IniStates
) or final states (OutputsModel$StateEnd
, we store 7 + 60(*24) + Nlayers*4
states at the daily or hourly time steps. This is not useful when only CemaNeige
is used. For exemple, for GR2M
we store only 2
states, not 7 + 60
.
I propose to modify CreateRunOptions
lines accordingly:
NState <- NULL
if ("GR" %in% ObjectClass | "CemaNeige" %in% ObjectClass) {
if ("hourly" %in% ObjectClass) {
NState <- 7 + 3 * 24 * 20+ 4 * NLayers
}
if ("daily" %in% ObjectClass) {
NState <- 7 + 3 * 20 + 4 * NLayers
}
if ("monthly" %in% ObjectClass) {
NState <- 2
}
if ("yearly" %in% ObjectClass) {
NState <- 1
}
}
should become :
NState <- 0
if ("GR" %in% ObjectClass) {
if ("hourly" %in% ObjectClass) {
NState <- 7 + 3 * 24 * 20
}
if ("daily" %in% ObjectClass) {
NState <- 7 + 3 * 20
}
if ("monthly" %in% ObjectClass) {
NState <- 2
}
if ("yearly" %in% ObjectClass) {
NState <- 1
}
}
if ("CemaNeige" %in% ObjectClass) {
if (!"yearly" %in% ObjectClass) {
NState <- NState + 4 * NLayers
}
}
In addition, RunModel_CemaNeige.R
and CreateIniStates.R
should be modified accordingly. This will ease the implementation of RunModel_CemaNeigeGR2M
.