diff --git a/DESCRIPTION b/DESCRIPTION index 7435de1ef9d453344ecced15a0710a5e9939a5af..a6d748381624aac8d7c537713a977bd4f7e166a7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.0.9.37 +Version: 1.0.9.38 Date: 2017-09-05 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl")), diff --git a/R/CreateIniStates.R b/R/CreateIniStates.R index 5644dcce597e68d3bf7d12adce50d3f774f4c0fe..faa603ec660afeb0a8d71f1914e698d84a79dcf7 100644 --- a/R/CreateIniStates.R +++ b/R/CreateIniStates.R @@ -62,6 +62,12 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ## check states + if (any(ProdStore < 0) | any(RoutStore < 0) | any(ExpStore < 0) | + any(UH1 < 0) | any(UH2 < 0) | + any(GCemaNeigeLayers < 0) | any(eTGCemaNeigeLayers < 0)) { + stop("Negative values are not allowed for any state variables") + } + if (identical(FUN_MOD, RunModel_GR6J) | identical(FUN_MOD, RunModel_CemaNeigeGR6J)) { if (is.null(ExpStore)) { stop("'RunModel_*GR6J' need an 'ExpStore' value")