Commit a8c2d08d authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.12.24 UPDATE: ErrorCrit* funs now use VarObs argument of CreateRunOptions instead varObs

parent 1d026a06
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.12.23
Version: 1.2.12.24
Date: 2019-04-01
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -13,7 +13,7 @@ output:
### 1.2.12.23 Release Notes (2019-04-01)
### 1.2.12.24 Release Notes (2019-04-01)
......
......@@ -15,7 +15,7 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Initialisation_________________________________
CritName <- NA
CritVar <- InputsCrit$varObs
CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") {
CritName <- "KGE[CritVar]"
}
......@@ -41,13 +41,13 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________
VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") {
if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
......
......@@ -15,7 +15,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Initialisation_________________________________
CritName <- NA
CritVar <- InputsCrit$varObs
CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") {
CritName <- "KGE'[CritVar]"
}
......@@ -41,13 +41,13 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________
VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") {
if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
......
......@@ -15,7 +15,7 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Initialisation_________________________________
CritName <- NA
CritVar <- InputsCrit$varObs
CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") {
CritName <- "NSE[CritVar]"
}
......@@ -41,13 +41,13 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________
VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") {
if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
......
......@@ -15,7 +15,7 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Initialisation_________________________________
CritName <- NA
CritVar <- InputsCrit$varObs
CritVar <- InputsCrit$VarObs
if (InputsCrit$transfo == "") {
CritName <- "RMSE[CritVar]"
}
......@@ -41,13 +41,13 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose =
##Data_preparation_______________________________
VarObs <- InputsCrit$Obs
VarObs[!InputsCrit$BoolCrit] <- NA
if (InputsCrit$varObs == "Q") {
if (InputsCrit$VarObs == "Q") {
VarSim <- OutputsModel$Qsim
}
if (InputsCrit$varObs == "SCA") {
if (InputsCrit$VarObs == "SCA") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "Gratio"))
}
if (InputsCrit$varObs == "SWE") {
if (InputsCrit$VarObs == "SWE") {
VarSim <- rowMeans(sapply(OutputsModel$CemaNeigeLayers[InputsCrit$idLayer], FUN = "[[", "SnowPack"))
}
VarSim[!InputsCrit$BoolCrit] <- NA
......
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