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

v1.4.2.2 CLEAN: miror typo revisions of Imax fun #13

parent 8d7ef11e
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.4.2.1
Version: 1.4.2.2
Date: 2019-12-10
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
......@@ -2,7 +2,7 @@
### 1.4.2.1 Release Notes (2019-12-10)
### 1.4.2.2 Release Notes (2019-12-10)
#### New features
......
......@@ -10,7 +10,7 @@ Imax <- function(InputsModel,
if (!inherits(InputsModel, "hourly")) {
stop("'InputsModel' must be of class 'hourly'")
}
if (!(class(tested_values) == "numeric")){
if (!(class(tested_values) == "numeric")) {
stop("'tested_values' must be 'numeric'")
}
......@@ -45,12 +45,10 @@ Imax <- function(InputsModel,
C0 <- 0
cum_hourly <- 0
for (i in IndPeriod_Run) {
Ec <- min(InputsModel$PotEvap[i], InputsModel$Precip[i]+C0)
Pth <- max(0, InputsModel$Precip[i]-(Imax-C0)-Ec)
Ec <- min(InputsModel$PotEvap[i], InputsModel$Precip[i] + C0)
Pth <- max(0, InputsModel$Precip[i] - (Imax-C0)-Ec)
C0 <- C0 + InputsModel$Precip[i] - Ec - Pth
cum_hourly <- cum_hourly + Ec
}
differences[which(Imax == tested_values)] <- abs(cum_hourly - cum_daily)
}
......
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