-
Notifications
You must be signed in to change notification settings - Fork 0
/
Soares.jl
51 lines (50 loc) · 3.31 KB
/
Soares.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
""" [Soares2004](@cite) """
Soares_q_tot(::Type{FT}) where {FT} = z -> if z <= 1350.0
FT(5.0e-3) - FT(3.7e-4) * z / 1000
else
FT(5.0e-3) - FT(3.7e-4) * FT(1.35) - FT(9.4e-4) * (z - 1350) / 1000
end
""" [Soares2004](@cite) """
Soares_θ_liq_ice(::Type{FT}) where {FT} = z -> if z <= 1350.0
FT(300.0)
else
FT(300) + 2 * (z - 1350) / 1000
end
""" [Soares2004](@cite) """
Soares_u(::Type{FT}) where {FT} = z -> FT(0.01)
""" [Soares2004](@cite) """
Soares_tke(::Type{FT}) where {FT} = z -> if z <= 1600.0
FT(0.1) * FT(1.46) * FT(1.46) * (1 - z / 1600)
else
FT(0)
end
""" TMP TKE profile for testing """
function Soares_tke_prescribed(::Type{FT}) where {FT}
z_in = FT[12.5, 37.5, 62.5, 87.5, 112.5, 137.5, 162.5, 187.5, 212.5, 237.5, 262.5, 287.5, 312.5, 337.5,
362.5, 387.5, 412.5, 437.5, 462.5, 487.5, 512.5, 537.5, 562.5, 587.5, 612.5, 637.5, 662.5, 687.5,
712.5, 737.5, 762.5, 787.5, 812.5, 837.5, 862.5, 887.5, 912.5, 937.5, 962.5, 987.5, 1012.5, 1037.5,
1062.5, 1087.5, 1112.5, 1137.5, 1162.5, 1187.5, 1212.5, 1237.5, 1262.5, 1287.5, 1312.5, 1337.5,
1362.5, 1387.5, 1412.5, 1437.5, 1462.5, 1487.5, 1512.5, 1537.5, 1562.5, 1587.5, 1612.5, 1637.5,
1662.5, 1687.5, 1712.5, 1737.5, 1762.5, 1787.5, 1812.5, 1837.5, 1862.5, 1887.5, 1912.5, 1937.5,
1962.5, 1987.5, 2012.5, 2037.5, 2062.5, 2087.5, 2112.5, 2137.5, 2162.5, 2187.5, 2212.5, 2237.5,
2262.5, 2287.5, 2312.5, 2337.5, 2362.5, 2387.5, 2412.5, 2437.5, 2462.5, 2487.5, 2512.5, 2537.5,
2562.5, 2587.5, 2612.5, 2637.5, 2662.5, 2687.5, 2712.5, 2737.5, 2762.5, 2787.5, 2812.5, 2837.5,
2862.5, 2887.5, 2912.5, 2937.5, 2962.5, 2987.5, 3012.5, 3037.5, 3062.5, 3087.5, 3112.5, 3137.5,
3162.5, 3187.5, 3212.5, 3237.5, 3262.5, 3287.5, 3312.5, 3337.5, 3362.5, 3387.5, 3412.5, 3437.5,
3462.5, 3487.5, 3512.5, 3537.5, 3562.5, 3587.5, 3612.5, 3637.5, 3662.5, 3687.5, 3712.5, 3737.5]
tke_in = FT[0.1909, 1.2210, 1.6242, 1.8691, 2.0420, 2.1735, 2.2781, 2.3638, 2.4353, 2.4959,
2.5477, 2.5922, 2.6307, 2.6641, 2.6929, 2.7178, 2.7393, 2.7577, 2.7732, 2.7863,
2.7971, 2.8057, 2.8125, 2.8176, 2.8210, 2.8230, 2.8236, 2.8231, 2.8213, 2.8186,
2.8150, 2.8104, 2.8051, 2.7991, 2.7924, 2.7851, 2.7773, 2.7688, 2.7598, 2.7503,
2.7403, 2.7297, 2.7185, 2.7068, 2.6946, 2.6821, 2.6695, 2.6569, 2.6435, 2.6268,
2.6039, 2.5734, 2.5357, 2.4907, 2.4382, 2.3781, 2.3099, 2.2334, 2.1481, 2.0536,
1.9496, 1.8356, 1.7113, 1.5765, 1.4310, 1.2756, 1.1118, 0.9437, 0.7788, 0.6293,
0.5090, 0.4253, 0.3732, 0.3397, 0.3135, 0.2889, 0.2638, 0.2377, 0.2106, 0.1828,
0.1543, 0.1251, 0.0954, 0.0660, 0.0393, 0.0185, 0.0029, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
not_type_stable_spline = Dierckx.Spline1D(z_in, tke_in; k = 1)
return x -> FT(not_type_stable_spline(x))
end