Commit 057d235c authored by Dorchies David's avatar Dorchies David
Browse files

fix(RunModel_LLR): correctly handle LengthHydro == 0

Refs HYCAR-Hydro/airgr#152, HYCAR-Hydro/airgr#153
parent 1b9865fa
No related merge requests found
Pipeline #37038 failed with stages
in 7 minutes and 8 seconds
Showing with 4 additions and 2 deletions
+4 -2
......@@ -70,9 +70,11 @@ RunModel_LLR <- function(InputsModel, RunOptions, Param, QcontribDown) {
## propagation time from upstream meshes to outlet
PT <- floor(InputsModel$LengthHydro * 1e3 / TParam / RunOptions$FeatFUN_MOD$TimeStep)
PK <- sqrt(InputsModel$LengthHydro/max(InputsModel$LengthHydro)) * KParam
PK <- ifelse(InputsModel$LengthHydro == 0,
0,
sqrt(InputsModel$LengthHydro/max(InputsModel$LengthHydro)) * KParam)
C0 <- exp(-1/PK)
C0 <- ifelse(PK ==0, 0, exp(-1/PK))
C1 <- ((PK/1) * (1-C0))-C0
C2 <- 1 - (PK/1) * (1-C0)
## Lag model computation
......
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