Commit 17a3ee9c authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David
Browse files

v1.6.0.1 CLEAN: minor typo revisions in CreatInputsModel #34

Showing with 11 additions and 10 deletions
+11 -10
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.6.0.0 Version: 1.6.0.1
Date: 2020-04-05 Date: 2020-04-05
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")),
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
### 1.6.0.0 Release Notes (2020-04-05) ### 1.6.0.1 Release Notes (2020-04-05)
#### New features #### New features
- Semi-distributed GR models. - Semi-distributed GR models.
____________________________________________________________________________________ ____________________________________________________________________________________
......
...@@ -190,8 +190,8 @@ CreateInputsModel <- function(FUN_MOD, ...@@ -190,8 +190,8 @@ CreateInputsModel <- function(FUN_MOD,
# olivier: add a check to avoid any missing argument: # 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) # either we have the three of them (then it is SD) or none (then it is lumped)
if("SD" %in% ObjectClass){ if ("SD" %in% ObjectClass) {
if (!("daily" %in% ObjectClass) & !("hourly" %in% ObjectClass)){ if (!("daily" %in% ObjectClass) & !("hourly" %in% ObjectClass)) {
stop("Only daily and hourly time steps can be used in a semi-distributed mode") stop("Only daily and hourly time steps can be used in a semi-distributed mode")
} }
if (!is.matrix(Q_upstr) | !is.matrix(L_hyd) | !is.matrix(S_basin)) { if (!is.matrix(Q_upstr) | !is.matrix(L_hyd) | !is.matrix(S_basin)) {
...@@ -200,16 +200,16 @@ CreateInputsModel <- function(FUN_MOD, ...@@ -200,16 +200,16 @@ CreateInputsModel <- function(FUN_MOD,
if (!is.numeric(Q_upstr) | !is.numeric(L_hyd) | !is.numeric(S_basin)) { if (!is.numeric(Q_upstr) | !is.numeric(L_hyd) | !is.numeric(S_basin)) {
stop("'Q_upstr', 'L_hyd' and 'S_basin' must be matrices of numeric values") stop("'Q_upstr', 'L_hyd' and 'S_basin' must be matrices of numeric values")
} }
if (ncol(Q_upstr) != ncol(L_hyd)){ if (ncol(Q_upstr) != ncol(L_hyd)) {
stop("'Q_upstr' and 'L_hyd' must have the same number of columns") stop("'Q_upstr' and 'L_hyd' must have the same number of columns")
} }
if (ncol(Q_upstr)+1 != ncol(S_basin)){ if (ncol(Q_upstr)+1 != ncol(S_basin)) {
stop("'S_basin' must have one column more than 'Q_upstr' and 'L_hyd'") stop("'S_basin' must have one column more than 'Q_upstr' and 'L_hyd'")
} }
if (nrow(L_hyd) != 1 | nrow(S_basin) != 1){ if (nrow(L_hyd) != 1 | nrow(S_basin) != 1) {
stop("'L_hyd' and 'S_basin' must have only one row") stop("'L_hyd' and 'S_basin' must have only one row")
} }
if(any(is.na(Q_upstr))){ if(any(is.na(Q_upstr))) {
stop("'Q_upstr' cannot contain any NA value") stop("'Q_upstr' cannot contain any NA value")
} }
} }
...@@ -326,9 +326,9 @@ CreateInputsModel <- function(FUN_MOD, ...@@ -326,9 +326,9 @@ CreateInputsModel <- function(FUN_MOD,
LayerFracSolidPrecip = RESULT$LayerFracSolidPrecip, LayerFracSolidPrecip = RESULT$LayerFracSolidPrecip,
ZLayers = RESULT$ZLayers)) ZLayers = RESULT$ZLayers))
} }
if("SD" %in% ObjectClass){ if ("SD" %in% ObjectClass) {
InputsModel <- c(InputsModel, list(Q_upstr = Q_upstr, InputsModel <- c(InputsModel, list(Q_upstr = Q_upstr,
L_hyd=L_hyd, L_hyd = L_hyd,
S_basin = S_basin)) S_basin = S_basin))
} }
......
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