@@ -11,7 +11,7 @@ function get_buoyancy_of_lifted_parcel(tparcel, rparcel, pparcel, t, r, p, ptop=
11
11
p = p[begin : n_valid_levels]
12
12
t = t[begin : n_valid_levels]
13
13
r = r[begin : n_valid_levels]
14
- tvirtual_diff_parcel_env = similar (t)
14
+ tvirtual_diff_parcel_env = zero (t)
15
15
parcel_sat_vapor_pressure = get_saturation_vapor_pressure (tparcel)
16
16
parcel_vapor_pressure = get_partial_vapor_pressure (rparcel,pparcel)
17
17
parcel_rh = min (parcel_vapor_pressure/ parcel_sat_vapor_pressure , 1.0 )
@@ -41,7 +41,7 @@ function get_buoyancy_of_lifted_parcel(tparcel, rparcel, pparcel, t, r, p, ptop=
41
41
end
42
42
43
43
function get_buoyancy_of_lifted_parcel (tparcel :: Real , rparcel :: Real ,pparcel :: Real , t :: Array{ <: Real} ,r :: Array{ <: Real} ,p :: Array{ <: Real} , ptop= 59 )
44
- ustrip .(get_buoyancy_of_lifted_parcel (1 u " K" * tparcel , 1 u " kg/kg" * rparcel ,1 u " hPa" * pparcel, 1 u " K" .* t , 1 u " kg/kg" .* r, 1 u " hPa" .* p, 1 u " hPa" * ptop ))
44
+ ustrip .(get_buoyancy_of_lifted_parcel (u " K" * tparcel , u " kg/kg" * rparcel ,u " hPa" * pparcel, u " K" .* t , u " kg/kg" .* r, u " hPa" .* p, u " hPa" * ptop ))
45
45
end
46
46
47
47
@@ -128,7 +128,7 @@ function get_potential_intensity_of_tropical_cyclone(sea_surface_temperature,sea
128
128
end
129
129
130
130
function get_potential_intensity_of_tropical_cyclone (sea_surface_temperature :: Real ,sea_surface_pressure :: Real , pressure :: Array{<: Real} , temperature :: Array{<: Real} , mixing_ratio :: Array{<: Real} ; ck_over_cd = 0.9 , reversible_ascent= true , dissipative_heating = true , vreduc = 0.8 )
131
- return ustrip .(get_potential_intensity_of_tropical_cyclone (1 u " K" * sea_surface_temperature, 1 u " hPa" * sea_surface_pressure, 1 u " hPa" .* pressure, 1 u " K" .* temperature, 1 u " kg/kg" .* mixing_ratio; ck_over_cd, reversible_ascent, dissipative_heating, vreduc))
131
+ return ustrip .(get_potential_intensity_of_tropical_cyclone (u " K" * sea_surface_temperature, u " hPa" * sea_surface_pressure, u " hPa" .* pressure, u " K" .* temperature, u " kg/kg" .* mixing_ratio; ck_over_cd, reversible_ascent, dissipative_heating, vreduc))
132
132
end
133
133
134
134
"""
140
140
p Array{<: Real}, ptop=50u"hPa")
141
141
Compute cape, outflow temperature and index of neutral buoyancy from thermodynamic profiles.
142
142
"""
143
- function get_cape_and_outflow_temp_from_sounding (tparcel, rparcel, pparcel, t, r, p, ptop= 50 u " hPa" )
143
+ function get_cape_and_outflow_temp_from_sounding (tparcel, rparcel, pparcel, t, r, p, ptop= 59 u " hPa" )
144
144
buoyancy_profile = get_buoyancy_of_lifted_parcel (tparcel,rparcel,pparcel,t,r,p,ptop)
145
145
negative_area= 0.0 * unit (buoyancy_profile[1 ]* Dryair. R)
146
146
positive_area= 0.0 * unit (buoyancy_profile[1 ]* Dryair. R)
@@ -166,6 +166,6 @@ function get_cape_and_outflow_temp_from_sounding(tparcel, rparcel, pparcel, t, r
166
166
end
167
167
168
168
169
- function get_cape_and_outflow_temp_from_sounding (tparcel :: Real ,rparcel :: Real ,pparcel :: Real ,t :: Array{<: Real} ,r :: Array{<: Real} ,p :: Array{<: Real} ,ptop= 50 )
170
- ustrip .(get_cape_and_outflow_temp_from_sounding (1 u " K" * tparcel,1 u " kg/kg" * rparcel,1 u " hPa" * pparcel, 1 u " K" .* t, 1 u " kg/kg" .* r,1 u " hPa" .* p,1 u " hPa" * ptop))
169
+ function get_cape_and_outflow_temp_from_sounding (tparcel :: Real ,rparcel :: Real ,pparcel :: Real ,t :: Array{<: Real} ,r :: Array{<: Real} ,p :: Array{<: Real} ,ptop= 59 )
170
+ ustrip .(get_cape_and_outflow_temp_from_sounding (u " K" * tparcel,u " kg/kg" * rparcel,u " hPa" * pparcel, u " K" .* t, u " kg/kg" .* r,u " hPa" .* p,u " hPa" * ptop))
171
171
end
0 commit comments