diff --git a/DESCRIPTION b/DESCRIPTION index 125da67c33cc7258ca8e0a7ce783e9d880d630a0..b5ac57324ce24a715f0d8dc2ce2f377f5aaee307 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.2.7.10 +Version: 1.2.7.11 Date: 2019-03-06 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.rmd b/NEWS.rmd index 81a14a71701c4274385f01f94bf2c68972f95dba..4932ab75f7ebac5e6b247ec2442566ae34a7bfc8 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.2.7.10 Release Notes (2019-03-06) +### 1.2.7.11 Release Notes (2019-03-06) diff --git a/R/Calibration_Michel.R b/R/Calibration_Michel.R index e0c3c81843978e0a27bd841a901d06235afadc15..65948136242c9d2249a81d9874b9fa0e45ad142d 100644 --- a/R/Calibration_Michel.R +++ b/R/Calibration_Michel.R @@ -15,6 +15,14 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions if (inherits(InputsCrit, "Multi")) { stop("InputsCrit must be of class 'Single' or 'Compo'") } + if (inherits(InputsCrit, "Compo") & "SCA" %in% sapply(InputsCrit, "[[", "varObs") & !"Gratio" %in% RunOptions$Outputs_Cal) { + warning("Missing 'Gratio' is automatically added to 'Output_Cal' in 'RunOptions' as it is necessary in the objective function for comparison with SCA") + RunOptions$Outputs_Cal <- c(RunOptions$Outputs_Cal, "Gratio") + } + if (inherits(InputsCrit, "Compo") & "SWE" %in% sapply(InputsCrit, "[[", "varObs") & !"SnowPack" %in% RunOptions$Outputs_Cal) { + warning("Missing 'SnowPack' is automatically added to 'Output_Cal' in 'RunOptions' as it is necessary in the objective function for comparison with SWE") + RunOptions$Outputs_Cal <- c(RunOptions$Outputs_Cal, "SnowPack") + } if (!inherits(CalibOptions, "CalibOptions")) { stop("CalibOptions must be of class 'CalibOptions'") } @@ -22,11 +30,10 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions stop("CalibOptions must be of class 'HBAN' if Calibration_Michel is used") } if (!missing(FUN_CRIT)) { - warning("argument 'FUN_CRIT' is deprecated. The error criterion function is now automatically get from the 'InputsCrit' object", call. = FALSE) + warning("argument 'FUN_CRIT' is deprecated. The error criterion function is now automatically get from the 'InputsCrit' object") } - ##_check_FUN_TRANSFO if (is.null(FUN_TRANSFO)) { if (identical(FUN_MOD, RunModel_GR4H )) { @@ -61,7 +68,7 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions if (identical(FUN_MOD, RunModel_CemaNeigeGR5J)) { FUN1 <- TransfoParam_GR5J } - if (identical(FUN_MOD,RunModel_CemaNeigeGR6J)) { + if (identical(FUN_MOD, RunModel_CemaNeigeGR6J)) { FUN1 <- TransfoParam_GR6J } if (inherits(FUN_MOD, "hysteresis")) {