From 66e954b2978faaf1586ac8f10eaf7e03fb4e6de8 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.fr> Date: Mon, 16 Nov 2020 08:42:19 +0100 Subject: [PATCH] v1.6.3.57 style: remove useless spaces in RunModel_GR* functions Refs #14 --- DESCRIPTION | 2 +- NEWS.md | 2 +- R/RunModel_GR2M.R | 16 ++++++++-------- R/RunModel_GR4H.R | 16 ++++++++-------- R/RunModel_GR4J.R | 16 ++++++++-------- R/RunModel_GR5H.R | 16 ++++++++-------- R/RunModel_GR5J.R | 16 ++++++++-------- R/RunModel_GR6J.R | 18 +++++++++--------- 8 files changed, 51 insertions(+), 51 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index da547bd3..158bc726 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.56 +Version: 1.6.3.57 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 d977dbc3..8bf504eb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 1.6.3.56 Release Notes (2020-11-16) +### 1.6.3.57 Release Notes (2020-11-16) #### New features diff --git a/R/RunModel_GR2M.R b/R/RunModel_GR2M.R index 90fd4488..8586fd89 100644 --- a/R/RunModel_GR2M.R +++ b/R/RunModel_GR2M.R @@ -77,7 +77,7 @@ RunModel_GR2M <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -98,21 +98,21 @@ RunModel_GR2M <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_SateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_SateEnd - if ((ExportDatesR==TRUE & ExportStateEnd==TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } diff --git a/R/RunModel_GR4H.R b/R/RunModel_GR4H.R index f323479f..57870e06 100644 --- a/R/RunModel_GR4H.R +++ b/R/RunModel_GR4H.R @@ -82,7 +82,7 @@ RunModel_GR4H <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -103,21 +103,21 @@ RunModel_GR4H <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_SateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_SateEnd if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } diff --git a/R/RunModel_GR4J.R b/R/RunModel_GR4J.R index 58e7d163..464ab9a5 100644 --- a/R/RunModel_GR4J.R +++ b/R/RunModel_GR4J.R @@ -81,7 +81,7 @@ RunModel_GR4J <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -102,21 +102,21 @@ RunModel_GR4J <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_StateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_StateEnd if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } diff --git a/R/RunModel_GR5H.R b/R/RunModel_GR5H.R index 5afb287f..f683c3f6 100644 --- a/R/RunModel_GR5H.R +++ b/R/RunModel_GR5H.R @@ -91,7 +91,7 @@ RunModel_GR5H <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -113,21 +113,21 @@ RunModel_GR5H <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_StateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_StateEnd if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } diff --git a/R/RunModel_GR5J.R b/R/RunModel_GR5J.R index 5c2e8157..06a62030 100644 --- a/R/RunModel_GR5J.R +++ b/R/RunModel_GR5J.R @@ -82,7 +82,7 @@ RunModel_GR5J <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -103,21 +103,21 @@ RunModel_GR5J <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_SateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_SateEnd if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } diff --git a/R/RunModel_GR6J.R b/R/RunModel_GR6J.R index 92042076..fb79a397 100644 --- a/R/RunModel_GR6J.R +++ b/R/RunModel_GR6J.R @@ -70,7 +70,7 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) { if (!is.null(RunOptions$IniResLevels)) { RunOptions$IniStates[1] <- RunOptions$IniResLevels[1]*Param[1] ### production store level (mm) RunOptions$IniStates[2] <- RunOptions$IniResLevels[2]*Param[3] ### routing store level (mm) - RunOptions$IniStates[3] <- RunOptions$IniResLevels[3] ### exponential store level (mm) + RunOptions$IniStates[3] <- RunOptions$IniResLevels[3] ### exponential store level (mm) } ## Call_fortan @@ -87,7 +87,7 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) { IndOutputs = IndOutputs, ### indices of output series ## outputs 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 + 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 @@ -108,21 +108,21 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) { } ## DatesR_and_OutputsModel_only if (ExportDatesR == TRUE & ExportStateEnd == FALSE) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i])) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs]) } ## OutputsModel_and_SateEnd_only if (ExportDatesR == FALSE & ExportStateEnd == TRUE) { - OutputsModel <- c( lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c(FortranOutputs[IndOutputs], "StateEnd") } ## DatesR_and_OutputsModel_and_SateEnd if ((ExportDatesR == TRUE & ExportStateEnd == TRUE) | "all" %in% RunOptions$Outputs_Sim) { - OutputsModel <- c( list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), - lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), - list(RESULTS$StateEnd) ) + OutputsModel <- c(list(InputsModel$DatesR[RunOptions$IndPeriod_Run]), + lapply(seq_len(RESULTS$NOutputs), function(i) RESULTS$Outputs[IndPeriod2, i]), + list(RESULTS$StateEnd)) names(OutputsModel) <- c("DatesR", FortranOutputs[IndOutputs], "StateEnd") } -- GitLab