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

v1.2.9.24 UPDATE: check if FUN_MOD inherits from hysteresis in...

v1.2.9.24 UPDATE: check if FUN_MOD inherits from hysteresis in Calibration_Michel to take into account the use of hysteresis #5252
parent 6e48d1b2
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.2.9.23
Version: 1.2.9.24
Date: 2019-03-19
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -13,7 +13,7 @@ output:
### 1.2.9.23 Release Notes (2019-03-19)
### 1.2.9.24 Release Notes (2019-03-19)
......
......@@ -195,7 +195,12 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
}
##Model_run
Param <- CandidatesParamR[iNew, ]
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
if (inherits(FUN_MOD, "hysteresis")) {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param, IsHyst = TRUE)
} else {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
}
##Calibration_criterion_computation
OutputsCrit <- ErrorCrit(InputsCrit, OutputsModel, verbose = FALSE)
if (!is.na(OutputsCrit$CritValue)) {
......@@ -343,7 +348,11 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
for (iNew in 1:nrow(CandidatesParamR)) {
##Model_run
Param <- CandidatesParamR[iNew, ]
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
if (inherits(FUN_MOD, "hysteresis")) {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param, IsHyst = TRUE)
} else {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
}
##Calibration_criterion_computation
OutputsCrit <- ErrorCrit(InputsCrit, OutputsModel, verbose = FALSE)
if (!is.na(OutputsCrit$CritValue)) {
......@@ -404,7 +413,11 @@ Calibration_Michel <- function(InputsModel, RunOptions, InputsCrit, CalibOptions
CandidatesParamR <- FUN_TRANSFO(CandidatesParamT, "TR")
##Model_run
Param <- CandidatesParamR[iNew, ]
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
if (inherits(FUN_MOD, "hysteresis")) {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param, IsHyst = TRUE)
} else {
OutputsModel <- FUN_MOD(InputsModel, RunOptions, Param)
}
##Calibration_criterion_computation
OutputsCrit <- ErrorCrit(InputsCrit, OutputsModel, verbose = FALSE)
if (OutputsCrit$CritValue * OutputsCrit$Multiplier < CritOptim) {
......
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