Skip to content

Commit

Permalink
Use parcel temperature
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ahijevyc committed Feb 6, 2025
1 parent 63434d5 commit 3c7485f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2672,7 +2672,7 @@ def cape_cin(pressure, temperature, dewpoint, parcel_profile, which_lfc='bottom'
# The mixing ratio of the parcel comes from the dewpoint below the LCL, is saturated
# based on the temperature above the LCL
parcel_mixing_ratio = np.where(below_lcl, saturation_mixing_ratio(pressure, dewpoint),
saturation_mixing_ratio(pressure, temperature))
saturation_mixing_ratio(pressure, parcel_profile))

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

0 comments on commit 3c7485f

Please sign in to comment.