Commit 2846934f authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.3.58 style: remove useless parenthesis in RunModel_GR* functions

Refs #14
Showing with 16 additions and 16 deletions
+16 -16
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.6.3.57 Version: 1.6.3.58
Date: 2020-11-16 Date: 2020-11-16
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")),
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
### 1.6.3.57 Release Notes (2020-11-16) ### 1.6.3.58 Release Notes (2020-11-16)
#### New features #### New features
......
...@@ -66,8 +66,8 @@ RunModel_GR1A <- function(InputsModel, RunOptions, Param) { ...@@ -66,8 +66,8 @@ RunModel_GR1A <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol=length(IndOutputs)), ### output series [mm] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
## Output data preparation ## Output data preparation
......
...@@ -79,8 +79,8 @@ RunModel_GR2M <- function(InputsModel, RunOptions, Param) { ...@@ -79,8 +79,8 @@ RunModel_GR2M <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] 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$Outputs [round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR2M, InputsModel = InputsModel, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR2M, InputsModel = InputsModel,
ProdStore = RESULTS$StateEnd[1L], RoutStore = RESULTS$StateEnd[2L], ExpStore = NULL, ProdStore = RESULTS$StateEnd[1L], RoutStore = RESULTS$StateEnd[2L], ExpStore = NULL,
......
...@@ -84,8 +84,8 @@ RunModel_GR4H <- function(InputsModel, RunOptions, Param) { ...@@ -84,8 +84,8 @@ RunModel_GR4H <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location 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, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR4H, InputsModel = InputsModel,
......
...@@ -83,8 +83,8 @@ RunModel_GR4J <- function(InputsModel, RunOptions, Param) { ...@@ -83,8 +83,8 @@ RunModel_GR4J <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location 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, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR4J, InputsModel = InputsModel,
......
...@@ -93,8 +93,8 @@ RunModel_GR5H <- function(InputsModel, RunOptions, Param) { ...@@ -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] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location 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, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR5H, InputsModel = InputsModel,
......
...@@ -84,8 +84,8 @@ RunModel_GR5J <- function(InputsModel, RunOptions, Param) { ...@@ -84,8 +84,8 @@ RunModel_GR5J <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location 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, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR5J, InputsModel = InputsModel,
......
...@@ -89,8 +89,8 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) { ...@@ -89,8 +89,8 @@ RunModel_GR6J <- function(InputsModel, RunOptions, Param) {
Outputs = matrix(as.double(-999.999), nrow = LInputSeries, ncol = length(IndOutputs)), ### output series [mm] 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$Outputs[ round(RESULTS$Outputs , 3) == -999.999] <- NA
RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == (-999.999)] <- NA RESULTS$StateEnd[round(RESULTS$StateEnd, 3) == -999.999] <- NA
if (ExportStateEnd) { if (ExportStateEnd) {
RESULTS$StateEnd[-3L] <- ifelse(RESULTS$StateEnd[-3L] < 0, 0, RESULTS$StateEnd[-3L]) ### remove negative values except for the ExpStore location 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, RESULTS$StateEnd <- CreateIniStates(FUN_MOD = RunModel_GR6J, InputsModel = InputsModel,
......
Supports Markdown
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