Commit cc7433c3 authored by Delaigue Olivier's avatar Delaigue Olivier Committed by Dorchies David

v1.6.1.4 UPDATE: variables are renamed in RunModel #34

parent d3114b06
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.1.3
Version: 1.6.1.4
Date: 2020-04-05
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -2,7 +2,7 @@
### 1.6.1.3 Release Notes (2020-04-05)
### 1.6.1.4 Release Notes (2020-04-05)
#### New features
......
RunModel <- function (InputsModel, RunOptions, Param, FUN_MOD) {
FUN_MOD <- match.fun(FUN_MOD)
if (inherits(InputsModel, "SD")) {
Outputs_down <- FUN_MOD(InputsModel = InputsModel, RunOptions = RunOptions,
OutputsModelDown <- FUN_MOD(InputsModel = InputsModel, RunOptions = RunOptions,
Param = Param[-length(Param)])
Outputs_down$Qdown <- Outputs_down$Qsim
OutputsModelDown$QsimDown <- OutputsModelDown$Qsim
if (inherits(InputsModel, "daily")) {
TimeStep <- 60 * 60 * 24
}
if (inherits(InputsModel, "hourly")) {
TimeStep <- 60 * 60
}
surf_tot <- sum(InputsModel$BasinAreas)
Outputs_down$Qsim <- Outputs_down$Qdown * InputsModel$BasinAreas[length(InputsModel$BasinAreas)] / surf_tot +
AreaTot <- sum(InputsModel$BasinAreas)
OutputsModelDown$Qsim <- OutputsModelDown$QsimDown * InputsModel$BasinAreas[length(InputsModel$BasinAreas)] / AreaTot +
1000 / Param[-length(Param)] / TimeStep *
InputsModel$QobsUpstr %*% (InputsModel$LengthHydro[1, ] * InputsModel$BasinAreas[1:length(InputsModel$LengthHydro)])
} else {
Outputs_down <- FUN_MOD(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
OutputsModelDown <- FUN_MOD(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param)
}
return(Outputs_down)
return(OutputsModelDown)
}
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