Skip to content

Commit ed7ad6e

Browse files
committed
I had introduced some type instability by mistake
1 parent 326716e commit ed7ad6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/potentialintensity.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function get_buoyancy_of_lifted_parcel(tparcel, rparcel, pparcel, t, r, p, ptop=
1111
p = p[begin:n_valid_levels]
1212
t = t[begin:n_valid_levels]
1313
r = r[begin:n_valid_levels]
14-
tvirtual_diff_parcel_env = similar(t)
14+
tvirtual_diff_parcel_env = zero(t)
1515
parcel_sat_vapor_pressure = get_saturation_vapor_pressure(tparcel)
1616
parcel_vapor_pressure = get_partial_vapor_pressure(rparcel,pparcel)
1717
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=
4141
end
4242

4343
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(1u"K" * tparcel , 1u"kg/kg" * rparcel ,1u"hPa" * pparcel, 1u"K" .* t , 1u"kg/kg" .* r, 1u"hPa" .* p, 1u"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 ))
4545
end
4646

4747

@@ -128,7 +128,7 @@ function get_potential_intensity_of_tropical_cyclone(sea_surface_temperature,sea
128128
end
129129

130130
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(1u"K" * sea_surface_temperature, 1u"hPa" * sea_surface_pressure, 1u"hPa" .* pressure, 1u"K" .* temperature, 1u"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))
132132
end
133133

134134
"""
@@ -140,7 +140,7 @@ end
140140
p Array{<: Real}, ptop=50u"hPa")
141141
Compute cape, outflow temperature and index of neutral buoyancy from thermodynamic profiles.
142142
"""
143-
function get_cape_and_outflow_temp_from_sounding(tparcel, rparcel, pparcel, t, r, p, ptop=50u"hPa")
143+
function get_cape_and_outflow_temp_from_sounding(tparcel, rparcel, pparcel, t, r, p, ptop=59u"hPa")
144144
buoyancy_profile = get_buoyancy_of_lifted_parcel(tparcel,rparcel,pparcel,t,r,p,ptop)
145145
negative_area=0.0*unit(buoyancy_profile[1]*Dryair.R)
146146
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
166166
end
167167

168168

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(1u"K" * tparcel,1u"kg/kg" * rparcel,1u"hPa" * pparcel, 1u"K" .* t, 1u"kg/kg" .*r,1u"hPa" .* p,1u"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))
171171
end

0 commit comments

Comments
 (0)