Skip to content

FIX: Use actual parcel temperature for LCL determination in lfc/el - #4176

Closed
thaliamontreux wants to merge 1 commit into
Unidata:mainfrom
thaliamontreux:fix-lfc-el-virtual-temp
Closed

thaliamontreux wants to merge 1 commit into
Unidata:mainfrom
thaliamontreux:fix-lfc-el-virtual-temp

Conversation

@thaliamontreux

Copy link
Copy Markdown
Contributor

Description

Fixes #3857. cape_cin converts the parcel and environment profiles to virtual temperature, then passes them to lfc/el, which computed the LCL from that virtual temperature as though it were air temperature. Since Tv >= T, the LCL came out at too low a pressure (too high an altitude), which could in turn push the LFC and EL too high.

Adds an optional keyword-only parcel_temperature_start parameter to both lfc and el (paired with the existing dewpoint_start), used only for the LCL determination; defaults preserve existing behavior (parcel_temperature_profile[0] for lfc, temperature[0] for el). cape_cin now passes the parcel's true starting temperature, keeping the buoyancy comparisons in virtual-temperature space while constraining the LCL correctly.

On the #1190 regression sounding this corrects the LCL/LFC from 866.9 to 900.1 hPa and CAPE from 2161.9 to 2206.7 J/kg. The one updated expected value (test_cape_cin_value_error) was verified against the physical mechanism.

Checklist

cape_cin converts the parcel and environment profiles to virtual
temperature, then passes them to lfc/el, which computed the LCL from
the virtual temperature as though it were air temperature. Virtual
temperature is always >= actual temperature, so the LCL came out too
low in pressure (too high in altitude), which could push the LFC/EL
too high as well.

Adds an optional parcel_temperature_start keyword (paired with the
existing dewpoint_start) to both lfc and el, used only for the LCL
determination. cape_cin now passes the parcel's true starting
temperature, keeping the buoyancy comparisons in virtual-temperature
space while constraining the LCL with real thermodynamic quantities.

On the Unidata#1190 regression sounding this corrects the LCL/LFC from
866.9 to 900.1 hPa and CAPE from 2161.9 to 2206.7 J/kg.
@thaliamontreux
thaliamontreux requested a review from a team as a code owner October 20, 2026 09:39
@thaliamontreux
thaliamontreux requested review from dcamron and removed request for a team October 20, 2026 09:39
@thaliamontreux

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #4067, which fixes #3857 via a different approach (lcl_pressure/lcl_temperature kwargs passed from cape_cin) and predates this PR. For what it's worth, I verified the underlying mechanism independently: on the #1190 regression sounding the virtual-temperature LCL comes out at 866.9 hPa vs the true 900.1 hPa, so the fix direction is confirmed either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Virtual temperature being incorrectly used in lfc and el functions

1 participant