From 617bc09d4fe4648e467438163e4646b6def6bb6b Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Sun, 5 Apr 2020 09:28:25 +0200
Subject: [PATCH] v1.6.0.2 UPDATE: new SD arguments renamed in
 CreateInputsModel #34

---
 DESCRIPTION           |  2 +-
 NEWS.md               |  2 +-
 R/CreateInputsModel.R | 34 +++++++++++++++++-----------------
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index fae41452..657e5648 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.0.1
+Version: 1.6.0.2
 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 8677536e..b75c75fe 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -4,7 +4,7 @@
 
 
 
-### 1.6.0.1 Release Notes (2020-04-05)
+### 1.6.0.2 Release Notes (2020-04-05)
 
 #### New features
 
diff --git a/R/CreateInputsModel.R b/R/CreateInputsModel.R
index b1a7d4dd..82ed962b 100644
--- a/R/CreateInputsModel.R
+++ b/R/CreateInputsModel.R
@@ -4,7 +4,7 @@ CreateInputsModel <- function(FUN_MOD,
                               PotEvap = NULL,
                               TempMean = NULL, TempMin = NULL, TempMax = NULL,
                               ZInputs = NULL, HypsoData = NULL, NLayers = 5,
-                              Q_upstr = NULL, L_hyd = NULL, S_basin = NULL, 
+                              QobsUpstr = NULL, LengthHydro = NULL, BasinAreas = NULL, 
                               verbose = TRUE) {
     
     
@@ -184,7 +184,7 @@ CreateInputsModel <- function(FUN_MOD,
       }
     }
     
-    if (!is.null(Q_upstr) & !is.null(L_hyd) & !is.null(S_basin)) {
+    if (!is.null(QobsUpstr) & !is.null(LengthHydro) & !is.null(BasinAreas)) {
       ObjectClass <- c(ObjectClass, "SD")
     }
     # olivier: add a check to avoid any missing argument: 
@@ -194,23 +194,23 @@ CreateInputsModel <- function(FUN_MOD,
       if (!("daily" %in% ObjectClass) & !("hourly" %in% ObjectClass)) {
         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)) {
-        stop("'Q_upstr', 'L_hyd' and 'S_basin' must be matrices of numeric values")
+      if (!is.matrix(QobsUpstr) | !is.matrix(LengthHydro) | !is.matrix(BasinAreas)) {
+        stop("'QobsUpstr', 'LengthHydro' and 'BasinAreas' must be matrices of numeric values")
       }
-      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")
+      if (!is.numeric(QobsUpstr) | !is.numeric(LengthHydro) | !is.numeric(BasinAreas)) {
+        stop("'QobsUpstr', 'LengthHydro' and 'BasinAreas' must be matrices of numeric values")
       }
-      if (ncol(Q_upstr) != ncol(L_hyd)) {
-        stop("'Q_upstr' and 'L_hyd' must have the same number of columns")
+      if (ncol(QobsUpstr) != ncol(LengthHydro)) {
+        stop("'QobsUpstr' and 'LengthHydro' must have the same number of columns")
       }
-      if (ncol(Q_upstr)+1 != ncol(S_basin)) {
-        stop("'S_basin' must have one column more than 'Q_upstr' and 'L_hyd'")
+      if (ncol(QobsUpstr)+1 != ncol(BasinAreas)) {
+        stop("'BasinAreas' must have one column more than 'QobsUpstr' and 'LengthHydro'")
       }
-      if (nrow(L_hyd) != 1 | nrow(S_basin) != 1) {
-        stop("'L_hyd' and 'S_basin' must have only one row")
+      if (nrow(LengthHydro) != 1 | nrow(BasinAreas) != 1) {
+        stop("'LengthHydro' and 'BasinAreas' must have only one row")
       }
-      if(any(is.na(Q_upstr))) {
-        stop("'Q_upstr' cannot contain any NA value")
+      if(any(is.na(QobsUpstr))) {
+        stop("'QobsUpstr' cannot contain any NA value")
       }
     }
     
@@ -327,9 +327,9 @@ CreateInputsModel <- function(FUN_MOD,
                                          ZLayers              = RESULT$ZLayers))
     }
     if ("SD" %in% ObjectClass) {
-      InputsModel <- c(InputsModel, list(Q_upstr = Q_upstr, 
-                                         L_hyd   = L_hyd,
-                                         S_basin = S_basin)) 
+      InputsModel <- c(InputsModel, list(QobsUpstr = QobsUpstr, 
+                                         LengthHydro   = LengthHydro,
+                                         BasinAreas = BasinAreas)) 
     }
     
     class(InputsModel) <- c("InputsModel", ObjectClass)
-- 
GitLab