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
Showing with 12 additions and 4 deletions
+12 -4
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.0.4 Version: 1.2.1.0
Date: 2019-01-30 Date: 2019-01-30
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -13,7 +13,7 @@ output: ...@@ -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, ...@@ -2,6 +2,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
ProdStore = 350, RoutStore = 90, ExpStore = NULL, ProdStore = 350, RoutStore = 90, ExpStore = NULL,
UH1 = NULL, UH2 = NULL, UH1 = NULL, UH2 = NULL,
GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL, GCemaNeigeLayers = NULL, eTGCemaNeigeLayers = NULL,
GthrCemaNeigeLayers = NULL, GlocmaxCemaNeigeLayers = NULL,
verbose = TRUE) { verbose = TRUE) {
...@@ -181,7 +182,13 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -181,7 +182,13 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
if (is.null(eTGCemaNeigeLayers)) { if (is.null(eTGCemaNeigeLayers)) {
eTGCemaNeigeLayers <- rep(Inf, NLayers) 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 # check negative values
if (any(ProdStore < 0) | any(RoutStore < 0) | if (any(ProdStore < 0) | any(RoutStore < 0) |
...@@ -225,7 +232,8 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -225,7 +232,8 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
## format output ## format output
IniStates <- list(Store = list(Prod = ProdStore, Rout = RoutStore, Exp = ExpStore), IniStates <- list(Store = list(Prod = ProdStore, Rout = RoutStore, Exp = ExpStore),
UH = list(UH1 = UH1, UH2 = UH2), 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 <- unlist(IniStates)
IniStatesNA[is.infinite(IniStatesNA)] <- NA IniStatesNA[is.infinite(IniStatesNA)] <- NA
IniStatesNA <- relist(IniStatesNA, skeleton = IniStates) IniStatesNA <- relist(IniStatesNA, skeleton = IniStates)
......
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