Skip to content

Commit

Permalink
LFC calc: if EL is above top of sounding, use top of sounding as EL
Browse files Browse the repository at this point in the history
  • Loading branch information
wx4stg committed Jul 28, 2023
1 parent 81f8d57 commit 01bdec9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/metpy/calc/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ def lfc(pressure, temperature, dewpoint, parcel_temperature_profile=None, dewpoi
el_pressure, _ = find_intersections(pressure[1:], parcel_temperature_profile[1:],
temperature[1:], direction='decreasing',
log_x=True)
if len(el_pressure) == 0:
el_pressure = pressure[-1]
if np.min(el_pressure) > this_lcl[0]:
x = units.Quantity(np.nan, pressure.units)
y = units.Quantity(np.nan, temperature.units)
Expand Down

0 comments on commit 01bdec9

Please sign in to comment.