Skip to content

Commit 8ca9d64

Browse files
committed
add cal_snow_density
1 parent de29b7f commit 8ca9d64

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

Diff for: src/BEPS/Base/snow_densty.jl

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# LoTmpDnsTruncatedAnderson1976
2+
"""
3+
snow_density(Ta::Float64, U10::Float64=NaN; tfrz=0.0, method="LoTmpDnsSlater2017")
4+
5+
Calculate the density of new snow
6+
7+
"Snow fraction depends on the density of snow in CLM4. A 10 cm snowpack has f_snow=1 when density is low
8+
(50–100 kg m–3), such as may be found in fresh snow, and a smaller snow fraction (f_snow = 0.76)
9+
when density is high (400 kg m–3)" -- Bonan 2019, P148
10+
11+
Snow compacts over time, increasing to a density of 100–500 kg m–3.
12+
13+
# Reference
14+
15+
- van Kampenhout et al. 2017
16+
17+
- CLM5, <https://github.com/ESCOMP/CTSM/blob/07051e3758addf2f9753d520823be9ebcbfec0aa/src/biogeophys/SnowHydrologyMod.F90#L3729-L3747>
18+
19+
# Examples
20+
```julia
21+
Ta = -100.:50
22+
ρ_snow = snow_density.(Ta, 2.0)
23+
ρ_snow_chen = @. 67.9 + 51.3 * exp(Ta / 2.6)
24+
25+
# using Plots
26+
# plot(Ta, ρ_snow)
27+
# plot!(Ta, ρ_snow_chen)
28+
```
29+
"""
30+
function cal_snow_density(Ta::Float64, U10::Float64=NaN; tfrz=0.0, method="LoTmpDnsSlater2017")
31+
if Ta > tfrz + 2.0
32+
ρ_snow = 50.0 + 1.7 * (17.0)^1.5
33+
elseif Ta > tfrz - 15.0
34+
ρ_snow = 50.0 + 1.7 * (Ta - tfrz + 15.0)^1.5
35+
else
36+
if method == "LoTmpDnsTruncatedAnderson1976"
37+
ρ_snow = 50.0
38+
elseif method == "LoTmpDnsSlater2017"
39+
# ρ_snow = -3.833 * (Ta - tfrz) - 0.0333 * (Ta - tfrz)^2
40+
t_for_bifall_degC = Ta > tfrz - 57.55 ? (Ta - tfrz) : -57.55
41+
ρ_snow = -(50.0 / 15.0 + 0.0333 * 15.0) * t_for_bifall_degC - 0.0333 * t_for_bifall_degC^2
42+
end
43+
end
44+
45+
if U10 > 0.1
46+
ρ_snow = ρ_snow + (266.861 * ((1.0 + tanh(U10 / 2)) / 2.0)^8.8)
47+
end
48+
ρ_snow
49+
end

Diff for: src/BEPS/evaporation_soil.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Esoil: evaporation from soil
77
function evaporation_soil_jl(Tair::FT, Tg::FT, RH::FT, Rn_g::FT, Gheat_g::FT,
88
# perc_snow_g::Ref{FT},
99
perc_snow::Layer3{FT},
10-
depth_water, depth_snow,
10+
depth_water::FT, depth_snow::FT,
1111
# depth_water::Ref{FT}, depth_snow::Ref{FT},
1212
mass_water_g::FT, mass_snow::Layer3{FT},
1313
ρ_snow::FT, swc_g::FT, porosity_g::FT) where {FT<:Real}

0 commit comments

Comments
 (0)