Commit 3a5ea38f authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.7.11 UPDATE: Calibration_Michel can now run with SCA and SWE

Showing with 12 additions and 5 deletions
+12 -5
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.2.7.10 Version: 1.2.7.11
Date: 2019-03-06 Date: 2019-03-06
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")),
......
...@@ -13,7 +13,7 @@ output: ...@@ -13,7 +13,7 @@ output:
### 1.2.7.10 Release Notes (2019-03-06) ### 1.2.7.11 Release Notes (2019-03-06)
......
...@@ -15,6 +15,14 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions ...@@ -15,6 +15,14 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
if (inherits(InputsCrit, "Multi")) { if (inherits(InputsCrit, "Multi")) {
stop("InputsCrit must be of class 'Single' or 'Compo'") 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")) { if (!inherits(CalibOptions, "CalibOptions")) {
stop("CalibOptions must be of class 'CalibOptions'") stop("CalibOptions must be of class 'CalibOptions'")
} }
...@@ -22,11 +30,10 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions ...@@ -22,11 +30,10 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
stop("CalibOptions must be of class 'HBAN' if Calibration_Michel is used") stop("CalibOptions must be of class 'HBAN' if Calibration_Michel is used")
} }
if (!missing(FUN_CRIT)) { 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 ##_check_FUN_TRANSFO
if (is.null(FUN_TRANSFO)) { if (is.null(FUN_TRANSFO)) {
if (identical(FUN_MOD, RunModel_GR4H )) { if (identical(FUN_MOD, RunModel_GR4H )) {
...@@ -61,7 +68,7 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions ...@@ -61,7 +68,7 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
if (identical(FUN_MOD, RunModel_CemaNeigeGR5J)) { if (identical(FUN_MOD, RunModel_CemaNeigeGR5J)) {
FUN1 <- TransfoParam_GR5J FUN1 <- TransfoParam_GR5J
} }
if (identical(FUN_MOD,RunModel_CemaNeigeGR6J)) { if (identical(FUN_MOD, RunModel_CemaNeigeGR6J)) {
FUN1 <- TransfoParam_GR6J FUN1 <- TransfoParam_GR6J
} }
if (inherits(FUN_MOD, "hysteresis")) { if (inherits(FUN_MOD, "hysteresis")) {
......
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