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

Snow glacier melt #444

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
routing](@ref) for a short description.
- Local inertial routing to `sbm_gwf` model type.
- Water demand and allocation computations for model types `sbm` and `sbm_gwf`.
- Support direct output of melt from snow and glaciers.

## v0.7.3 - 2024-01-12

Expand Down
4 changes: 3 additions & 1 deletion docs/src/model_docs/params_vertical.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ profile `kv` is used and `z_layered` is required as input.
| `actleakage` | actual leakage from saturated store | mm Δt``^{-1}`` | - |
| `snow` | snow storage | mm | - |
| `snowwater` | liquid water content in the snow pack | mm | - |
| `rainfallplusmelt` | snowmelt + precipitation as rainfall | mm Δt``^{-1}`` | - |
| `snowmelt` | melt from now | mm Δt``^{-1}`` | - |
| `glaciermelt` | melt from glaciers | mm Δt``^{-1}`` | - |
| `rainfallplusmelt` | snowmelt (and glaciers) + precipitation as rainfall | mm Δt``^{-1}`` | - |
| `tsoil` | top soil temperature | ᵒC | - |
| **`leaf_area_index`** | leaf area index | m``^2`` m``{-2}`` | - |
| `waterlevel_land` | water level land | mm | - |
Expand Down
4 changes: 2 additions & 2 deletions server/test/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ end

@testset "model information functions" begin
@test request((fn = "get_component_name",)) == Dict("component_name" => "sbm")
@test request((fn = "get_input_item_count",)) == Dict("input_item_count" => 207)
@test request((fn = "get_output_item_count",)) == Dict("output_item_count" => 207)
@test request((fn = "get_input_item_count",)) == Dict("input_item_count" => 209)
@test request((fn = "get_output_item_count",)) == Dict("output_item_count" => 209)
to_check = [
"vertical.nlayers",
"vertical.theta_r",
Expand Down
8 changes: 8 additions & 0 deletions src/sbm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@
snow::Vector{T} | "mm"
# Liquid water content in the snow pack [mm]
snowwater::Vector{T} | "mm"
# Snow melt [mm]
snowmelt::Vector{T} | "mm"
# Glacier melt [mm]
glaciermelt::Vector{T} | "mm"
# Snow melt + precipitation as rainfall [mm]
rainfallplusmelt::Vector{T} | "mm"
# Threshold temperature for snowfall above glacier [ᵒC]
Expand Down Expand Up @@ -737,6 +741,8 @@ function initialize_sbm(nc, config, riverfrac, inds)
cf_soil = cf_soil,
snow = zeros(Float, n),
snowwater = zeros(Float, n),
snowmelt = fill(mv, n),
glaciermelt = fill(mv, n),
rainfallplusmelt = fill(mv, n),
tsoil = fill(Float(10.0), n),
# glacier parameters
Expand Down Expand Up @@ -844,6 +850,7 @@ function update_until_snow(sbm::SBM, config)
if modelsnow
sbm.snow[i] = snow
sbm.snowwater[i] = snowwater
sbm.snowmelt[i] = snowmelt
sbm.tsoil[i] = tsoil
sbm.rainfallplusmelt[i] = rainfallplusmelt
end
Expand Down Expand Up @@ -1207,6 +1214,7 @@ function update_until_recharge(sbm::SBM, config)
if modelsnow
if modelglacier
sbm.snow[i] = snow
sbm.glaciermelt[i] = glaciermelt
sbm.glacierstore[i] = glacierstore
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/bmi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ tomlpath = joinpath(@__DIR__, "sbm_config.toml")

@testset "model information functions" begin
@test BMI.get_component_name(model) == "sbm"
@test BMI.get_input_item_count(model) == 207
@test BMI.get_output_item_count(model) == 207
@test BMI.get_input_item_count(model) == 209
@test BMI.get_output_item_count(model) == 209
to_check = [
"vertical.nlayers",
"vertical.theta_r",
Expand Down
Loading