Skip to content

Commit 4f47867

Browse files
committed
Use parcel temperature
Use parcel temperature (parcel_profile) instead of environmental temperature (temperature) for parcel_mixing_ratio derivation. This makes a difference if you have a very high temperature point in the stratosphere.
1 parent b55773f commit 4f47867

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/metpy/calc/thermo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ def cape_cin(pressure, temperature, dewpoint, parcel_profile, which_lfc='bottom'
26722672
# The mixing ratio of the parcel comes from the dewpoint below the LCL, is saturated
26732673
# based on the temperature above the LCL
26742674
parcel_mixing_ratio = np.where(below_lcl, saturation_mixing_ratio(pressure, dewpoint),
2675-
saturation_mixing_ratio(pressure, temperature))
2675+
saturation_mixing_ratio(pressure, parcel_profile))
26762676

26772677
# Convert the temperature/parcel profile to virtual temperature
26782678
temperature = virtual_temperature_from_dewpoint(pressure, temperature, dewpoint)

0 commit comments

Comments
 (0)