From 2846934f7b37e10544409d8bf20c23e76f014c2c Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Mon, 16 Nov 2020 08:47:14 +0100 Subject: [PATCH] v1.6.3.58 style: remove useless parenthesis in RunModel_GR* functions Refs #14 --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/RunModel_GR1A.R | 4 ++-- R/RunModel_GR2M.R | 4 ++-- R/RunModel_GR4H.R | 4 ++-- R/RunModel_GR4J.R | 4 ++-- R/RunModel_GR5H.R | 4 ++-- R/RunModel_GR5J.R | 4 ++-- R/RunModel_GR6J.R | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 158bc726..09740262 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.3.57 +Version: 1.6.3.58 Date: 2020-11-16 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 8bf504eb..1307e01a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 1.6.3.57 Release Notes (2020-11-16) +### 1.6.3.58 Release Notes (2020-11-16) #### New features diff --git a/R/RunModel_GR1A.R b/R/RunModel_GR1A.R index 8e973fcc..2470a7fd 100644 --- a/R/RunModel_GR1A.R +++ b/R/RunModel_GR1A.R @@ -66,8 +66,8 @@ RunModel_GR1A <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol=length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA ## Output data preparation diff --git a/R/RunModel_GR2M.R b/R/RunModel_GR2M.R index 8586fd89..ab6ab67b 100644 --- a/R/RunModel_GR2M.R +++ b/R/RunModel_GR2M.R @@ -79,8 +79,8 @@ RunModel_GR2M <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs [round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs [round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR2M, InputsModel = InputsModel, ProdStore = RESULTS$StateEnd[1L], RoutStore = RESULTS$StateEnd[2L], ExpStore = NULL, diff --git a/R/RunModel_GR4H.R b/R/RunModel_GR4H.R index 57870e06..38d0cfd5 100644 --- a/R/RunModel_GR4H.R +++ b/R/RunModel_GR4H.R @@ -84,8 +84,8 @@ RunModel_GR4H <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR4H, InputsModel = InputsModel, diff --git a/R/RunModel_GR4J.R b/R/RunModel_GR4J.R index 464ab9a5..96e8cc71 100644 --- a/R/RunModel_GR4J.R +++ b/R/RunModel_GR4J.R @@ -83,8 +83,8 @@ RunModel_GR4J <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel, diff --git a/R/RunModel_GR5H.R b/R/RunModel_GR5H.R index f683c3f6..cf2cce4c 100644 --- a/R/RunModel_GR5H.R +++ b/R/RunModel_GR5H.R @@ -93,8 +93,8 @@ RunModel_GR5H <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm or mm/h] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR5H, InputsModel = InputsModel, diff --git a/R/RunModel_GR5J.R b/R/RunModel_GR5J.R index 06a62030..edd304c2 100644 --- a/R/RunModel_GR5J.R +++ b/R/RunModel_GR5J.R @@ -84,8 +84,8 @@ RunModel_GR5J <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR5J, InputsModel = InputsModel, diff --git a/R/RunModel_GR6J.R b/R/RunModel_GR6J.R index fb79a397..376604a6 100644 --- a/R/RunModel_GR6J.R +++ b/R/RunModel_GR6J.R @@ -89,8 +89,8 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) { Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] StateEnd = rep(as.double(-999.999), length(RunOptions$IniStates)) ### state variables at the end of the model run ) - RESULTS$Outputs[ round(RESULTS$Outputs , 3) == (-999.999)] <- NA - RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA + RESULTS$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA + RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA if (ExportStateEnd) { RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR6J, InputsModel = InputsModel, -- GitLab