Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove lower limit of zero for sbm.runoff #373

Merged
merged 9 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
length `dl` at a ghost node should be set through the model parameter netCDF file
(`riverlength_bc`), providing this boundary condition through the `[model]` settings in
the TOML file (`model.riverlength_bc`) has been deprecated.
- Remove lower limit of zero for computation of `runoff` variable of `SBM` vertical concept
as it may result in water balance errors. As part of the `runoff` computation, actual open
water evaporation `ae_openw_l` is subtracted, which may result in negative `runoff`
values. This lower limit was implemented in the Python version of wflow\_sbm, to avoid a
very slow kinematic wave solution for surface flow computation (no distinction between a
kinematic wave for overland and river flow). When in the Python version of wflow_sbm the
kinematic wave for surface flow was split into a river and land component, the lower limit
was removed for river runoff, but not for land runoff.

### Added
- Total water storage as an export variable for `SBM` concept. This is the total water stored
Expand Down
2 changes: 1 addition & 1 deletion docs/src/model_docs/params_vertical.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ profile `kv` is used and `z_layered` is required as input.
| `exfiltustore` | water exfiltrating from unsaturated store because of change in water table | mm Δt``^{-1}`` | - |
| `excesswatersoil` | excess water for non-compacted fraction | mm Δt``^{-1}`` | - |
| `excesswaterpath` | excess water for compacted fraction | mm Δt``^{-1}`` | - |
| `runoff` | total surface runoff from infiltration and saturation excess | mm Δt``^{-1}`` | - |
| `runoff` | total surface runoff from infiltration, saturation excess and actual evaporation (`ae_openw_l`) | mm Δt``^{-1}`` | - |
| `vwc` | volumetric water content per soil layer (including θᵣ and saturated zone) | - | - |
| `vwc_perc` | volumetric water content per soil layer (including θᵣ and saturated zone) | % | - |
| `rootstore` | root water storage in unsaturated and saturated zone (excluding θᵣ) | mm| - |
Expand Down
8 changes: 3 additions & 5 deletions src/sbm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
excesswatersoil::Vector{T}
# Excess water for compacted fraction [mm Δt⁻¹]
excesswaterpath::Vector{T}
# Total surface runoff from infiltration and saturation excess [mm Δt⁻¹]
# Total surface runoff from infiltration, saturation excess and actual open water evaporation [mm Δt⁻¹]
runoff::Vector{T}
# Volumetric water content [-] per soil layer (including θᵣ and saturated zone)
vwc::Vector{SVector{N,T}} | "-"
Expand Down Expand Up @@ -1071,14 +1071,12 @@ function update_after_subsurfaceflow(sbm::SBM, zi, exfiltsatwater)

ustoredepth = sum(@view usld[1:n_usl])

runoff = max(
runoff =
exfiltustore +
exfiltsatwater[i] +
sbm.excesswater[i] +
sbm.runoff_land[i] +
sbm.infiltexcess[i] - sbm.ae_openw_l[i],
0.0,
)
sbm.infiltexcess[i] - sbm.ae_openw_l[i]

# volumetric water content per soil layer and root zone
vwc = sbm.vwc[i]
Expand Down
14 changes: 10 additions & 4 deletions test/run_sbm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ end

@test sbm.θₛ[50063] ≈ 0.48755401372909546f0
@test sbm.θᵣ[50063] ≈ 0.15943120419979095f0
@test sbm.runoff[50063] == 0.0
@test sbm.soilevap[50063] == 0.0
@test mean(sbm.runoff) ≈ 0.0416027711985709f0
@test mean(sbm.soilevap) ≈ 0.00616346765710303f0
@test mean(sbm.actevap) ≈ 0.5393128846181061f0
@test mean(sbm.actinfilt) ≈ 1.4860556930083888f0
@test sbm.snow[5] ≈ 3.592840840467347f0
@test mean(sbm.snow) ≈ 0.035197394854698104f0
@test sbm.total_storage[50063] ≈ 559.70849973344f0
@test sbm.total_storage[429] ≈ 597.4578475404879f0 # river cell
end
Expand All @@ -91,9 +94,12 @@ model = Wflow.run_timestep(model)
sbm = model.vertical
@test sbm.θₛ[50063] ≈ 0.48755401372909546f0
@test sbm.θᵣ[50063] ≈ 0.15943120419979095f0
@test sbm.runoff[50063] == 0.0
@test sbm.soilevap[50063] ≈ 0.006358004660566856f0
@test mean(sbm.runoff) ≈ 0.23657364759232993f0
@test mean(sbm.soilevap) ≈ 0.015275916086112940
@test mean(sbm.actevap) ≈ 0.29716147685525746f0
@test mean(sbm.actinfilt) ≈ 0.08829600284076534f0
@test sbm.snow[5] ≈ 3.667748983774868f0
@test mean(sbm.snow) ≈ 0.03209680141455693f0
@test sbm.total_storage[50063] ≈ 559.7935411649405f0
@test sbm.total_storage[429] ≈ 617.0062092646873f0 # river cell
end
Expand Down
Loading