Commit 66e954b2 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.3.57 style: remove useless spaces in RunModel_GR* functions

Refs #14
parent b1db2ae8
Pipeline #17584 passed with stages
in 11 minutes and 16 seconds
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")),
......
......@@ -4,7 +4,7 @@
### 1.6.3.56 Release Notes (2020-11-16)
### 1.6.3.57 Release Notes (2020-11-16)
#### New features
......
......@@ -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")
}
......
......@@ -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")
}
......
......@@ -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")
}
......
......@@ -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")
}
......
......@@ -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")
}
......
......@@ -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")
}
......
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