diff --git a/DESCRIPTION b/DESCRIPTION index 478ecfe7075f3c9fc1118887dc8846e23de97125..0b28246fa9847212a1452ab648362d316b641bec 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.1.2.0 +Version: 1.1.2.1 Date: 2018-10-22 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/R/ErrorCrit_KGE.R b/R/ErrorCrit_KGE.R index 33dd24c76940a9d23d63cdd708255cbd2a6cfd8c..1f28868f02f2badefca134a3b648c86bb0119215 100644 --- a/R/ErrorCrit_KGE.R +++ b/R/ErrorCrit_KGE.R @@ -6,6 +6,10 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T 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") return(NULL) @@ -36,7 +40,7 @@ ErrorCrit_KGE <- 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 @@ -198,6 +202,7 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T Multiplier = Multiplier, Ind_notcomputed = Ind_TS_ignore ) + # class(OutputsCrit) <- c("ErrorCrit", "KGE") return(OutputsCrit) }