Commit 52c24906 authored by unknown's avatar unknown
Browse files

v1.0.9.38 CreateIniStates stops if state values < 0

parent d3d98406
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.0.9.37 Version: 1.0.9.38
Date: 2017-09-05 Date: 2017-09-05
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl")), person("Laurent", "Coron", role = c("aut", "trl")),
......
...@@ -62,6 +62,12 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -62,6 +62,12 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
## check states ## 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 (identical(FUN_MOD, RunModel_GR6J) | identical(FUN_MOD, RunModel_CemaNeigeGR6J)) {
if (is.null(ExpStore)) { if (is.null(ExpStore)) {
stop("'RunModel_*GR6J' need an 'ExpStore' value") stop("'RunModel_*GR6J' need an 'ExpStore' value")
......
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