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

Use parcel prof for parcel mix ratio #3751

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ahijevyc
Copy link
Contributor

@ahijevyc ahijevyc commented Feb 6, 2025

This is a bug fix.

In metpy.calc.thermo.cape_cin, the parcel mixing ratio above the LCL is derived from the environment temperature temperature instead of the parcel temperature parcel_profile.

I noted this because this led to a negative mixing ratio when I worked with a test case sounding for CM1.

input_sounding_jordan_allmean: West Indies annual mean (Jordan, 1958, J. Meteor., p. 91)

in which the top level of the sounding is 40000 m, the potential temperature is 1095 K, the pressure is 10 hPa, and the temperature is 295 K. Plugging in 10 hPa and 295 K to metpy.calc.thermo.mixing_ratio, one gets a mixing ratio of -1.006 kg/kg. A negative mixing ratio is unphysical. Now I'm not sure if the mixing_ratio function has a bug also, but the problem goes away when you replace the environment temperature temperature with the much lower parcel temperature parcel_profile here link to code.

Description Of Changes

Change temperature to parcel_profile.

dependabot bot and others added 3 commits February 5, 2025 23:20
Bumps [scipy](https://github.com/scipy/scipy) from 1.14.1 to 1.15.1.
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](scipy/scipy@v1.14.1...v1.15.1)

---
updated-dependencies:
- dependency-name: scipy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
CI: (deps): Bump scipy from 1.14.1 to 1.15.1 in /ci
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.
@ahijevyc ahijevyc requested a review from a team as a code owner February 6, 2025 22:56
@ahijevyc ahijevyc requested review from dopplershift and removed request for a team February 6, 2025 22:56
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ dependabot[bot]
✅ ahijevyc
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants