From 1c48c7119ae6c3ac6462871192d0ae47bdf1e342 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Fri, 11 Jan 2019 09:42:43 +0100
Subject: [PATCH] v1.1.2.20 CLEAN: raw numerical values replaced by variables
 in CreaIniStats #5438

---
 DESCRIPTION         |  2 +-
 NEWS.rmd            |  2 +-
 R/CreateIniStates.R | 12 ++++++------
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 6986a2cf..d81f61b8 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.1.2.19
+Version: 1.1.2.20
 Date: 2019-01-11
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
diff --git a/NEWS.rmd b/NEWS.rmd
index 62965dcb..c58ed452 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -13,7 +13,7 @@ output:
 
 
 
-### 1.1.2.19 Release Notes (2019-01-11) 
+### 1.1.2.20 Release Notes (2019-01-11) 
 
 
 
diff --git a/R/CreateIniStates.R b/R/CreateIniStates.R
index 290105d0..85bd8ad6 100644
--- a/R/CreateIniStates.R
+++ b/R/CreateIniStates.R
@@ -165,7 +165,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
     } else {
       k <- 1
     }
-    UH1 <- rep(Inf, 20 * k)
+    UH1 <- rep(Inf, UH1n * k)
   }
   if (is.null(UH2)) {
     if ("hourly"  %in% ObjectClass) {
@@ -173,7 +173,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
     } else {
       k <- 1
     }
-    UH2 <- rep(Inf, 40 * k)
+    UH2 <- rep(Inf, UH2n * k)
   }
   if (is.null(GCemaNeigeLayers)) {
     GCemaNeigeLayers <- rep(Inf, NLayers)
@@ -202,16 +202,16 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
   if (!is.numeric(ExpStore) || length(ExpStore) != 1L) {
     stop("'ExpStore' must be numeric of length one")
   }
-  if ( "hourly" %in% ObjectClass & (!is.numeric(UH1) || length(UH1) != 480L)) {
+  if ( "hourly" %in% ObjectClass & (!is.numeric(UH1) || length(UH1) != UH1n * 24)) {
     stop(sprintf("'UH1' must be numeric of length 480 (%i * 24)", UH1n))
   }
-  if (!"hourly" %in% ObjectClass & (!is.numeric(UH1) || length(UH1) != 20L)) {
+  if (!"hourly" %in% ObjectClass & (!is.numeric(UH1) || length(UH1) != UH1n)) {
     stop(sprintf("'UH1' must be numeric of length %i", UH1n))
   }
-  if ( "hourly" %in% ObjectClass & (!is.numeric(UH2) || length(UH2) != 960L)) {
+  if ( "hourly" %in% ObjectClass & (!is.numeric(UH2) || length(UH2) != UH2n * 24)) {
     stop(sprintf("'UH2' must be numeric of length 960 (%i * 24)", UH2n))
   }
-  if (!"hourly" %in% ObjectClass & (!is.numeric(UH2) || length(UH2) != 40L)) {
+  if (!"hourly" %in% ObjectClass & (!is.numeric(UH2) || length(UH2) != UH2n)) {
     stop(sprintf("'UH2' must be numeric of length %i (2 * %i)", UH2n, UH1n))
   }
   if (!is.numeric(GCemaNeigeLayers) || length(GCemaNeigeLayers) != NLayers) {
-- 
GitLab