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

Static stability parameters #2535

Open
ahmedshaaban1 opened this issue Jun 12, 2022 · 3 comments
Open

Static stability parameters #2535

ahmedshaaban1 opened this issue Jun 12, 2022 · 3 comments
Labels
Area: Calc Pertains to calculations Type: API Change Changes to how existing functionality works Type: Feature New functionality
Milestone

Comments

@ahmedshaaban1
Copy link
Contributor

ahmedshaaban1 commented Jun 12, 2022

What should we add?

All,
The static stability parameter used by MetPy here is different from the one used by NCL. The static stability parameter defined by MetPy is multiplied by R/P factor, where R is the universal gas constant and P is the pressure. I think that the static stability parameter defined without the R/P parameter is often used than the one multiplied with the R/P factor (e.g., Holton and Hakim text book fifth edition, equation (3.7)). Also, when budgeting temperature, the version of the static stability used is the one without the R/P factor. I am wondering if it possible to allow the users to choose the version of the static stability that they are interested in.
Thanks

Reference

1- Holton and Hakim, An Introduction to Dynamical Meteorology.
2- NCL https://www.ncl.ucar.edu/Document/Functions/Contributed/static_stability.shtml

@ahmedshaaban1 ahmedshaaban1 added the Type: Feature New functionality label Jun 12, 2022
@dopplershift dopplershift added the Area: Calc Pertains to calculations label Jun 12, 2022
@dopplershift
Copy link
Member

dopplershift commented Jun 12, 2022

I can see implementing this as either a flag on the static_stability function, or as a separate function (probably refactoring the original).

I don't like adding boolean flags that completely change behavior and at the same time, no clue what you could call the alternative calculation. I'm not sure what others think is the most sensible for users of the library.

@kgoebber
Copy link
Collaborator

In reviewing the Bluestein (1992) text, there are two closely related definitions for static stability and the static stability parameter (pg. 197). The use of the R/p factor is done "mathematical convenience" to give use the static stability parameter since the combination of R*T/p is the inverse of density or alpha. Later on in the text, when you get to the QG equations, depending on the exact formulation of advection used (thickness versus temperature) the change is in using the static stability versus the static stability parameter (pg. 329; eliminate R/p factor and use static stability in the thickness version and NOT the static stability parameter). Unfortunately, Bluestein (1992) uses the same greek letter (sigma) to refer to both quantities.

So currently we have implemented the static stability parameter. What we want implemented is the static stability. Martin (2006; pgs. 139-141) uses two different symbols to refer to these different equations. He uses the greek letter sigma to indicate the static stability parameter and Sp to indicate just plain old static stability.

So the question is whether to have two separate functions, the only difference being this factor of R/p. After elucidating this difference based on the Bluestein (1992) and Martin (2006) textbooks, I am slightly in favor of two separate functions static_stability_parameter and static_stability. Unfortunately, our currently implemented equation is called static_stability, but should in fact be static_stability_parameter.

@dopplershift
Copy link
Member

So while our current function is poorly named, it works as documented so there's not a bug per se.

My inclination is in 2.0 to rename/refactor to the functions as described above by @kgoebber, with some kind of migration warning when we approach that release at some point in the distant future.

For now, since I don't think there's a name that's both correct and doesn't saddle us with more future debt, I think the best path forward is to add a flag to static_stability, maybe scale_as_parameter (defaulting to None which means True), which does our current behavior. This option should note the future eventual change.

How does that sound to anyone interested?

@dopplershift dopplershift added the Type: API Change Changes to how existing functionality works label Sep 15, 2022
@dopplershift dopplershift added this to the 2.0 milestone Sep 15, 2022
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: API Change Changes to how existing functionality works Type: Feature New functionality
Projects
Status: No status
Development

No branches or pull requests

3 participants