Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mlcape if parcel_start_pressure != bottom #3147

Merged
merged 4 commits into from
Nov 15, 2023
Merged

fix mlcape if parcel_start_pressure != bottom #3147

merged 4 commits into from
Nov 15, 2023

Conversation

wx4stg
Copy link
Contributor

@wx4stg wx4stg commented Aug 10, 2023

If a user calls mixed_layer_cape_cin and provides a parcel_start_pressure kwarg where the pressure provided is not the surface, then when the pressure of the mixed layer parcel gets appended to the pressure array, pressure is no longer monotonically decreasing. This raises an exception when computing the LCL.

This PR trims out any area beneath the provided start pressure, since it isn't used in the CAPE/CIN calculation anyway, and this prevents the pressure from increasing-then-decreasing.

  • There is no issue open on this
  • Tests added
  • This PR matches the expected behavior in the documentation, so no changes there.

@wx4stg wx4stg requested a review from a team as a code owner August 10, 2023 23:11
@wx4stg wx4stg requested review from dcamron and removed request for a team August 10, 2023 23:11
@dopplershift dopplershift added this to the September 2023 milestone Aug 30, 2023
@kgoebber
Copy link
Collaborator

This all looks good to me.

Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor change and I'm happy for this to go in.

tests/calc/test_thermo.py Show resolved Hide resolved
@dopplershift dopplershift added Type: Bug Something is not working like it should Area: Calc Pertains to calculations labels Nov 8, 2023
@dopplershift dopplershift enabled auto-merge (squash) November 15, 2023 00:24
@dopplershift dopplershift merged commit 64faccb into Unidata:main Nov 15, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Calc Pertains to calculations Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants