Commit 52b3cb67 authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David
Browse files

v1.6.1.6 CLEAN: check to warn about the use of the SD or the lumped modes...

v1.6.1.6 CLEAN: check to warn about the use of the SD or the lumped modes added in CreateInputsModel #34
Showing with 6 additions and 5 deletions
+6 -5
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.1.5
Version: 1.6.1.6
Date: 2020-04-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -2,7 +2,7 @@
### 1.6.1.5 Release Notes (2020-04-05)
### 1.6.1.6 Release Notes (2020-04-05)
#### New features
......
......@@ -184,12 +184,13 @@ CreateInputsModel <- function(FUN_MOD,
}
}
## check semi-distributed mode
if (!is.null(QobsUpstr) & !is.null(LengthHydro) & !is.null(BasinAreas)) {
ObjectClass <- c(ObjectClass, "SD")
}
# olivier: add a check to avoid any missing argument:
# either we have the three of them (then it is SD) or none (then it is lumped)
if (verbose & sum(is.null(QobsUpstr) | is.null(LengthHydro) | is.null(BasinAreas)) %in% 1:2) {
warning("Missing argument: 'QobsUpstr', 'LengthHydro' and 'BasinAreas' must all be set to run in a semi-distributed mode. The lumped mode will be used")
}
if ("SD" %in% ObjectClass) {
if (!("daily" %in% ObjectClass) & !("hourly" %in% ObjectClass)) {
stop("Only daily and hourly time steps can be used in a semi-distributed mode")
......
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