diff --git a/DESCRIPTION b/DESCRIPTION index 0b28c6857efc6a83458831993b45c1209ac9e66e..1dcba7eb967a1ada417ecd46a684ec7ea218d644 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.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")), diff --git a/NEWS.md b/NEWS.md index 26f70024448c0d5da3baa56ad7fed63996b25b44..8840495c0dd8a5a6728f8ef287519b68a6e8851f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ -### 1.6.1.5 Release Notes (2020-04-05) +### 1.6.1.6 Release Notes (2020-04-05) #### New features diff --git a/R/CreateInputsModel.R b/R/CreateInputsModel.R index 82ed962bc34e874673ffe7a7cc146641f7d70ff2..34c85db755340d68940bffc4fad0787e4a36aed9 100644 --- a/R/CreateInputsModel.R +++ b/R/CreateInputsModel.R @@ -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")