Commit 1c48c711 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.1.2.20 CLEAN: raw numerical values replaced by variables in CreaIniStats #5438

parent c55ed973
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.1.2.19 Version: 1.1.2.20
Date: 2019-01-11 Date: 2019-01-11
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")),
......
...@@ -13,7 +13,7 @@ output: ...@@ -13,7 +13,7 @@ output:
### 1.1.2.19 Release Notes (2019-01-11) ### 1.1.2.20 Release Notes (2019-01-11)
......
...@@ -165,7 +165,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -165,7 +165,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
} else { } else {
k <- 1 k <- 1
} }
UH1 <- rep(Inf, 20 * k) UH1 <- rep(Inf, UH1n * k)
} }
if (is.null(UH2)) { if (is.null(UH2)) {
if ("hourly" %in% ObjectClass) { if ("hourly" %in% ObjectClass) {
...@@ -173,7 +173,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -173,7 +173,7 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
} else { } else {
k <- 1 k <- 1
} }
UH2 <- rep(Inf, 40 * k) UH2 <- rep(Inf, UH2n * k)
} }
if (is.null(GCemaNeigeLayers)) { if (is.null(GCemaNeigeLayers)) {
GCemaNeigeLayers <- rep(Inf, NLayers) GCemaNeigeLayers <- rep(Inf, NLayers)
...@@ -202,16 +202,16 @@ CreateIniStates <- function(FUN_MOD, InputsModel, ...@@ -202,16 +202,16 @@ CreateIniStates <- function(FUN_MOD, InputsModel,
if (!is.numeric(ExpStore) || length(ExpStore) != 1L) { if (!is.numeric(ExpStore) || length(ExpStore) != 1L) {
stop("'ExpStore' must be numeric of length one") 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)) 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)) 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)) 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)) stop(sprintf("'UH2' must be numeric of length %i (2 * %i)", UH2n, UH1n))
} }
if (!is.numeric(GCemaNeigeLayers) || length(GCemaNeigeLayers) != NLayers) { if (!is.numeric(GCemaNeigeLayers) || length(GCemaNeigeLayers) != NLayers) {
......
Markdown is supported
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