diff --git a/DESCRIPTION b/DESCRIPTION index da547bd32cd923b0edd284a345282bbb2868a3b2..158bc726f5cc006b94855035f20daf65b49d3468 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 d977dbc34fe07bd2894a6b1a383c67472aa54649..8bf504ebb398e93132914b261bfca39ec29b2230 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 90fd4488c9b452f66c7eec04bc8de4be1c68e1b0..8586fd890cb53c2365e6779f9a5e2aa31fb8790e 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 f323479f8a0f2231327bb320ceca591f056a7d21..57870e06d0de1c904f6e16dc187b1d17e9caa325 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 58e7d163ce860bb110bad1862df33083c01e0edb..464ab9a5acc561920d49f75fa9bfe565a5331390 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 5afb287f1af6dfae9404ee04aa709c947a3c2b35..f683c3f61451a5a279f8cddbefc895ece06931b4 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 5c2e81579efdafcbbb4ca1c4c552f02f2fa26ff8..06a62030369cccb419cdc4aa96b5ec6b20286a74 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 92042076bd40eafb97cc09d37485d2ff0d08a91c..fb79a3979b25e07a1e12f297fd0e883044e47cab 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") }