From 2dfa845b968c853746a1ab8569eccacf5ebf181a Mon Sep 17 00:00:00 2001 From: JoostBuitink <44062204+JoostBuitink@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:45:48 +0100 Subject: [PATCH] fix flowing_fraction and volume calculation --- src/flow.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/flow.jl b/src/flow.jl index 594c32c5a..c30b1697b 100644 --- a/src/flow.jl +++ b/src/flow.jl @@ -254,6 +254,7 @@ function update(sf::SurfaceFlowLand, network, frac_toriver) flowing_fraction = 1.0 else flowing_fraction = (pond_volume_pot - threshold_volume) / pot_inflow + flowing_fraction = min(flowing_fraction, 1.0) end sf.q[v] = kinematic_wave( @@ -297,7 +298,7 @@ function update(sf::SurfaceFlowLand, network, frac_toriver) sf.q_av ./= its sf.h_av ./= its sf.to_river ./= its - sf.volume .= sf.dl .* sf.width .* sf.h + sf.volume .= sf.dl .* sf.width .* (sf.h .+ sf.pond_height) end function update(sf::SurfaceFlowRiver, network, doy)