-
Notifications
You must be signed in to change notification settings - Fork 0
/
ISDAC.jl
67 lines (58 loc) · 1.76 KB
/
ISDAC.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 825m: base of initial inversion
# 2045m: nominal domain top
""" [ovchinnikov_intercomparison_2014](@cite) """
function ISDAC_q_tot(::Type{FT}) where {FT}
z -> FT(if z < 400
1.5 - 0.00075 * (z - 400)
elseif 400 ≤ z < 825
1.5
elseif 825 ≤ z < 2045
1.2
else #2045 ≤ z
0.5 - 0.000075 * (z - 2045)
end / 1000) # kg/kg
end
""" [ovchinnikov_intercomparison_2014](@cite) """
function ISDAC_θ_liq_ice(::Type{FT}) where {FT}
z -> FT(if z < 400
265 + 0.004 * (z - 400)
elseif 400 ≤ z < 825
265
elseif 825 ≤ z < 2045
266 + (z - 825)^0.3
else #2045 ≤ z
271 + (z - 2000)^0.33
end) # K
end
""" [ovchinnikov_intercomparison_2014](@cite) """
ISDAC_u(::Type{FT}) where {FT} = z -> FT(-7) # m/s
""" [ovchinnikov_intercomparison_2014](@cite) """
ISDAC_v(::Type{FT}) where {FT} = z -> FT(-2 + 0.003z) # m/s
""" [ovchinnikov_intercomparison_2014](@cite) """
ISDAC_subsidence(::Type{FT}) where {FT} =
z -> FT(z < 825 ? -5e-6z : -0.4125e-2) # m/s
""" [ovchinnikov_intercomparison_2014](@cite) """
ISDAC_tke(::Type{FT}) where {FT} = z -> FT(0.1) # m²/s²
""" [ovchinnikov_intercomparison_2014](@cite) """
function ISDAC_inv_τ_scalar(::Type{FT}) where {FT}
z₁ = 1200 # m
z₂ = 1500 # m
hr = 3600 # s
z -> FT(if z < z₁
0
elseif z₁ ≤ z ≤ z₂
1 / hr * (1 - cos(π * (z - z₁) / (z₂ - z₁))) / 2
else #z > z₂
1 / hr
end) # s⁻¹
end
""" [ovchinnikov_intercomparison_2014](@cite) """
function ISDAC_inv_τ_wind(::Type{FT}) where {FT}
zᵤᵥ = 825 # m
hr = 3600 # s
z -> FT(if z ≤ zᵤᵥ
1 / 2hr * (1 - cos(π * z / zᵤᵥ)) / 2
else #z > zᵤᵥ
1 / 2hr
end) # s⁻¹
end