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

v1.2.1.0 NEW: add GthrCemaNeigeLayers and GlocmaxCemaNeigeLayers argiments to...

v1.2.1.0 NEW: add GthrCemaNeigeLayers and GlocmaxCemaNeigeLayers argiments to CreateIniStates to use hysteresis in CemaNeige #5252
parent 96b3ec9e
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.0.4
Version: 1.2.1.0
Date: 2019-01-30
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -13,7 +13,7 @@ output:
### 1.2.0.4 Release Notes (2019-01-30)
### 1.2.1.0 Release Notes (2019-01-30)
......
......@@ -2,6 +2,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
ProdStore = 350, RoutStore = 90, ExpStore = NULL,
UH1 = NULL, UH2 = NULL,
GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL,
GthrCemaNeigeLayers = NULL, GlocmaxCemaNeigeLayers = NULL,
verbose = TRUE) {
......@@ -181,7 +182,13 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
if (is.null(eTGCemaNeigeLayers)) {
eTGCemaNeigeLayers <- rep(Inf, NLayers)
}
if (is.null(GthrCemaNeigeLayers)) {
GthrCemaNeigeLayers <- rep(Inf, NLayers)
}
if (is.null(GlocmaxCemaNeigeLayers)) {
GlocmaxCemaNeigeLayers <- rep(Inf, NLayers)
}
cat(GCemaNeigeLayers)
# check negative values
if (any(ProdStore < 0) | any(RoutStore < 0) |
......@@ -225,7 +232,8 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
## format output
IniStates <- list(Store = list(Prod = ProdStore, Rout = RoutStore, Exp = ExpStore),
UH = list(UH1 = UH1, UH2 = UH2),
CemaNeigeLayers = list(G = GCemaNeigeLayers, eTG = eTGCemaNeigeLayers))
CemaNeigeLayers = list(G = GCemaNeigeLayers, eTG = eTGCemaNeigeLayers,
Gthr = GthrCemaNeigeLayers, Glocmax = GlocmaxCemaNeigeLayers))
IniStatesNA <- unlist(IniStates)
IniStatesNA[is.infinite(IniStatesNA)] <- NA
IniStatesNA <- relist(IniStatesNA, skeleton = IniStates)
......
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