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 q_vector units w/ default static stability #3690

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dopplershift
Copy link
Member

There's no reason the units should change in this case, just assign proper units to the default unity value of static stability.

Description Of Changes

Checklist

@dopplershift dopplershift added Type: Bug Something is not working like it should Area: Calc Pertains to calculations labels Nov 14, 2024
@dopplershift dopplershift added this to the 1.7.0 milestone Nov 14, 2024
@dopplershift dopplershift requested a review from a team as a code owner November 14, 2024 00:01
@dopplershift dopplershift requested review from dcamron and removed request for a team November 14, 2024 00:01
@jthielen
Copy link
Collaborator

jthielen commented Nov 14, 2024

There's no reason the units should change in this case, just assign proper units to the default unity value of static stability.

There unfortunately is, as Holton (2013) does not include the 1/sigma factor, which was unfortunately the (undocumented except in the issue tracker) intended behavior when it was originally written. Though, I'm not sure if that difference of definition is enough to stick with the old behavior or not!

EDIT: See #3689 (comment) for a much better discussion on this. Based on this insight, I would concur that the best move is likely moving away from the prior behavior and do something like this PR.

There's no reason the units should change in this case, just assign
proper units to the default unity value of static stability.
Comment on lines +1329 to +1330
The static stability at the pressure level. Defaults to 1 J/ kg / Pa^2 if not given
to calculate the Q-vector without factoring in static stability.
Copy link
Collaborator

Choose a reason for hiding this comment

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

With the insight of @kgoebber's comment here, I think it would be helpful to include a bit more detail here (or elsewhere in the docstring) on how static stability is important for this calculation, and perhaps recommend, when possible, to not rely on this default?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's reasonable, and I'm also inclined to at least pick a default that has a sensible scale, even if it does change results.

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.

Q_Vector returns wrong units
2 participants