Commit 43d13a94 authored by David's avatar David
Browse files

change(CreateInputsModel): change signe of Qupstream for Diverted flows

- Without consequence because diverted upstream flows are updated during simulation but it's more clear for InputsModel exploration prior to simulation

Refs #95
Showing with 9 additions and 0 deletions
+9 -0
......@@ -263,6 +263,15 @@ CreateOneGRiwrmInputsModel <- function(id, griwrm, ..., Qobs, Qmin) {
if(length(UpstreamNodeRows) > 0) {
# Sub-basin with hydraulic routing
Qupstream <- as.matrix(Qobs[ , griwrm$id[UpstreamNodeRows], drop=FALSE])
upstreamDiversion <- which(
sapply(griwrm$id[UpstreamNodeRows],
function(id) {
getNodeProperties(id, griwrm)$Diversion
})
)
if (length(upstreamDiversion) > 0) {
Qupstream[, upstreamDiversion] <- - Qupstream[, upstreamDiversion]
}
LengthHydro <- griwrm$length[UpstreamNodeRows]
names(LengthHydro) <- griwrm$id[UpstreamNodeRows]
BasinAreas <- c(
......
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