Skip to content

Commit

Permalink
Add DryBubble updraft profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Feb 11, 2022
1 parent 358a95b commit ada53e6
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/src/plot_profiles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function units(var::String)
var == "tke" && return "[m^2/s^2]"
var == "dTdt" && return "[K/s]"
var == "dqtdt" && return "[kg/(kg s)]"
var == "area" && return "[1]"
var == "w" && return "[m/s]"
var == "RH" && return "[%?]"
var == "subsidence" && return "[?]"
error("No units found for variable $var")
Expand Down Expand Up @@ -123,6 +125,10 @@ z_profiles = [
(; func = APL.SP_geostrophic_v , kwargs = (;z_range = zr_lo, xlabel = "vg")),

(; func = APL.DryBubble_θ_liq_ice , kwargs = (;z_range = zr_lo, xlabel = "θ_liq_ice")),
(; func = APL.DryBubble_updrafts_θ_liq_ice , kwargs = (;z_range = zr_lo, xlabel = "θ_liq_ice")),
(; func = APL.DryBubble_updrafts_area , kwargs = (;z_range = zr_lo, xlabel = "area")),
(; func = APL.DryBubble_updrafts_w , kwargs = (;z_range = zr_lo, xlabel = "w")),
(; func = APL.DryBubble_updrafts_T , kwargs = (;z_range = zr_lo, xlabel = "T")),


]
Expand Down
92 changes: 92 additions & 0 deletions src/profiles/DryBubble.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,95 @@ function DryBubble_θ_liq_ice(::Type{FT}) where {FT}
profile = Dierckx.Spline1D(z_in, θ_liq_ice_in; k = 1)
return profile
end

""" :( """
function DryBubble_updrafts_z(::Type{FT}) where {FT}
z_in = FT[
75., 125., 175., 225., 275., 325., 375., 425., 475.,
525., 575., 625., 675., 725., 775., 825., 875., 925.,
975., 1025., 1075., 1125., 1175., 1225., 1275., 1325., 1375.,
1425., 1475., 1525., 1575., 1625., 1675., 1725., 1775., 1825.,
1875., 1925., 1975., 2025., 2075., 2125., 2175., 2225., 2275.,
2325., 2375., 2425., 2475., 2525., 2575., 2625., 2675., 2725.,
2775., 2825., 2875., 2925., 2975., 3025., 3075., 3125., 3175.,
3225., 3275., 3325., 3375., 3425., 3475., 3525., 3575., 3625.,
3675., 3725., 3775., 3825., 3875., 3925.]
return z_in
end

""" :( """
function DryBubble_updrafts_θ_liq_ice(::Type{FT}) where {FT}
z_in = DryBubble_updrafts_z(FT)
θ_liq_in = FT[
299.9882, 299.996 , 300.0063, 300.0205, 300.04 , 300.0594,
300.0848, 300.1131, 300.1438, 300.1766, 300.2198, 300.2567,
300.2946, 300.3452, 300.3849, 300.4245, 300.4791, 300.5182,
300.574 , 300.6305, 300.6668, 300.7222, 300.7771, 300.8074,
300.8591, 300.9092, 300.9574, 300.9758, 301.0182, 301.0579,
301.0944, 301.1276, 301.1572, 301.1515, 301.1729, 301.1902,
301.2033, 301.2122, 301.2167, 301.2169, 301.2127, 301.2041,
301.1913, 301.1743, 301.1533, 301.1593, 301.1299, 301.097 ,
301.0606, 301.0212, 300.9788, 300.9607, 300.9125, 300.8625,
300.8108, 300.7806, 300.7256, 300.6701, 300.6338, 300.5772,
300.5212, 300.482 , 300.4272, 300.3875, 300.3354, 300.2968,
300.2587, 300.2216, 300.1782, 300.1452, 300.1143, 300.0859,
300.0603, 300.0408, 300.0211, 300.0067, 299.9963, 299.9884]
profile = Dierckx.Spline1D(z_in, θ_liq_in; k = 1)
return profile
end

""" :( """
function DryBubble_updrafts_area(::Type{FT}) where {FT}
z_in = DryBubble_updrafts_z(FT)
Area_in = FT[
0.04 , 0.055, 0.07 , 0.08 , 0.085, 0.095, 0.1 , 0.105, 0.11 ,
0.115, 0.115, 0.12 , 0.125, 0.125, 0.13 , 0.135, 0.135, 0.14 ,
0.14 , 0.14 , 0.145, 0.145, 0.145, 0.15 , 0.15 , 0.15 , 0.15 ,
0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.16 , 0.16 , 0.16 ,
0.16 , 0.16 , 0.16 , 0.16 , 0.16 , 0.16 , 0.16 , 0.16 , 0.16 ,
0.155, 0.155, 0.155, 0.155, 0.155, 0.155, 0.15 , 0.15 , 0.15 ,
0.15 , 0.145, 0.145, 0.145, 0.14 , 0.14 , 0.14 , 0.135, 0.135,
0.13 , 0.13 , 0.125, 0.12 , 0.115, 0.115, 0.11 , 0.105, 0.1 ,
0.095, 0.085, 0.08 , 0.07 , 0.055, 0.04]
profile = Dierckx.Spline1D(z_in, Area_in; k = 1)
return profile
end

""" :( """
function DryBubble_updrafts_w(::Type{FT}) where {FT}
z_in = DryBubble_updrafts_z(FT)
W_in = FT[
0.017 , 0.0266, 0.0344, 0.0417, 0.0495, 0.0546, 0.061 , 0.0668,
0.0721, 0.0768, 0.0849, 0.0887, 0.092 , 0.0996, 0.1019, 0.1037,
0.1106, 0.1114, 0.1179, 0.1243, 0.1238, 0.1297, 0.1355, 0.1335,
0.1387, 0.1437, 0.1485, 0.1448, 0.1489, 0.1527, 0.1564, 0.1597,
0.1628, 0.1565, 0.1588, 0.1609, 0.1626, 0.1641, 0.1652, 0.166 ,
0.1665, 0.1667, 0.1666, 0.1662, 0.1655, 0.1736, 0.1722, 0.1706,
0.1686, 0.1664, 0.1639, 0.1698, 0.1667, 0.1634, 0.1599, 0.1641,
0.1601, 0.1559, 0.1589, 0.1543, 0.1496, 0.1514, 0.1464, 0.1475,
0.1422, 0.1425, 0.1424, 0.1419, 0.1361, 0.135 , 0.1335, 0.1316,
0.1294, 0.1302, 0.1271, 0.1264, 0.1269, 0.1256]
profile = Dierckx.Spline1D(z_in, W_in; k = 1)
return profile
end

""" :( """
function DryBubble_updrafts_T(::Type{FT}) where {FT}
z_in = DryBubble_updrafts_z(FT)
T_in = FT[
299.2557, 298.775 , 298.2969, 297.8227, 297.3536, 296.8843,
296.421 , 295.9603, 295.502 , 295.0456, 294.5994, 294.1468,
293.6951, 293.2556, 292.8054, 292.3549, 291.9188, 291.4677,
291.0325, 290.5978, 290.1434, 289.7073, 289.2706, 288.81 ,
288.3698, 287.928 , 287.4842, 287.0118, 286.5622, 286.1099,
285.6544, 285.1957, 284.7335, 284.2379, 283.7677, 283.2937,
282.8157, 282.3337, 281.8476, 281.3574, 280.8631, 280.3649,
279.8626, 279.3565, 278.8467, 278.362 , 277.8447, 277.3241,
276.8006, 276.2742, 275.7454, 275.2388, 274.705 , 274.1694,
273.6327, 273.1155, 272.576 , 272.0363, 271.514 , 270.9736,
270.4339, 269.9094, 269.3711, 268.8465, 268.311 , 267.7877,
267.2649, 266.7432, 266.2159, 265.698 , 265.1821, 264.6685,
264.1574, 263.6518, 263.1461, 262.6451, 262.1476, 261.6524]
profile = Dierckx.Spline1D(z_in, T_in; k = 1)
return profile
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ iscallable(f) = !isempty(methods(f))
name == :GATE_III_z && continue # returns an array for other profiles
name == :GATE_III_z_in && continue # returns an array for other profiles
name == :ARM_SGP_time && continue # returns an array for other profiles
name == :DryBubble_updrafts_z && continue # returns an array for other profiles
name == :eval && continue
name == :include && continue
prof = getproperty(AtmosphericProfilesLibrary, name)
Expand Down

0 comments on commit ada53e6

Please sign in to comment.