Commit 6a20b554 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.1.2.3 UPDATE: ErrorCrit_KGE compatible with new InputsCrit objects

parent 1f7169aa
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.1.2.2
Version: 1.1.2.3
Date: 2018-10-22
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -5,6 +5,10 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
if (!inherits(InputsCrit, "InputsCrit")) {
stop("InputsCrit must be of class 'InputsCrit' \n")
return(NULL)
}
if (inherits(InputsCrit, "Multi") | inherits(InputsCrit, "Compo")) {
stop("InputsCrit must be of class 'Single' \n")
return(NULL)
}
if (!inherits(OutputsModel, "OutputsModel")) {
stop("OutputsModel must be of class 'OutputsModel' \n")
......@@ -36,7 +40,7 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Data_preparation_______________________________
VarObs <- InputsCrit$Qobs
VarObs <- InputsCrit$obs
VarObs[!InputsCrit$BoolCrit] <- NA
VarSim <- OutputsModel$Qsim
VarSim[!InputsCrit$BoolCrit] <- NA
......@@ -124,7 +128,7 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T
##Verbose______________________________________
if (verbose) {
message("Crit. ", CritName, " = ", sprintf("%.4f", CritValue))
message("Crit. ", CritName, " = ", sprintf("%.4f", CritValue), "\n")
}
......
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