Commit 2ae49608 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.3.6 style(RunModel_LAG): minor typo revisions

Refs #34
parent 6c2eb581
Pipeline #16637 passed with stages
in 11 minutes and 6 seconds
Package: airGR
Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.3.5
Version: 1.6.3.6
Date: 2020-10-14
Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
## Release History of the airGR Package
### 1.6.3.5 Release Notes (2020-10-14)
### 1.6.3.6 Release Notes (2020-10-14)
#### New features
......
......@@ -44,13 +44,13 @@ RunModel_LAG <- function(InputsModel, RunOptions, Param) {
NbUpBasins <- length(InputsModel$LengthHydro)
LengthTs <- length(OutputsModel$QsimDown)
OutputsModel$Qsim <- OutputsModel$QsimDown * InputsModel$BasinAreas[length(InputsModel$BasinAreas)] * 1E3
OutputsModel$Qsim <- OutputsModel$QsimDown * InputsModel$BasinAreas[length(InputsModel$BasinAreas)] * 1e3
for (upstream_basin in seq_len(NbUpBasins)) {
Qupstream <- InputsModel$Qupstream[RunOptions$IndPeriod_Run, upstream_basin]
if (!is.na(InputsModel$BasinAreas[upstream_basin])) {
# Upstream flow with area needs to be converted to m3 by time step
Qupstream <- Qupstream * InputsModel$BasinAreas[upstream_basin] * 1E3
Qupstream <- Qupstream * InputsModel$BasinAreas[upstream_basin] * 1e3
}
OutputsModel$Qsim <- OutputsModel$Qsim +
c(rep(0, floor(PT[upstream_basin])),
......@@ -66,6 +66,6 @@ RunModel_LAG <- function(InputsModel, RunOptions, Param) {
OutputsModel$Qsim[OutputsModel$Qsim < 0] <- 0
}
# Convert back Qsim to mm
OutputsModel$Qsim <- OutputsModel$Qsim / sum(InputsModel$BasinAreas, na.rm = TRUE) / 1E3
OutputsModel$Qsim <- OutputsModel$Qsim / sum(InputsModel$BasinAreas, na.rm = TRUE) / 1e3
return(OutputsModel)
}
\ No newline at end of file
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