-
Notifications
You must be signed in to change notification settings - Fork 443
Ambaum 2020 saturation vapor pressure + phase handling #3726
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
Conversation
a7c62db to
d1334f5
Compare
1a9b663 to
2e3383f
Compare
4ff23a1 to
6b436fe
Compare
|
I think it makes sense to do this by itself. I don't understand why the test is failing with overflow in EDIT: It's definitely overflowing, and we can just ignore in the test like we do on some others. In a notebook, it appears once and is then suppressed. |
6b436fe to
6243bfe
Compare
| .. math:: 6.112 e^\frac{17.67T}{T + 243.5} | ||
| """ | ||
| latent_heat = water_latent_heat_vaporization._nounit(temperature) | ||
| heat_power = (mpconsts.nounit.Cp_l - mpconsts.nounit.Cp_v) / mpconsts.nounit.Rv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading through section 5, I don't think we should rely on our constants here, but use the tuned value for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm open to the idea that we allow users to override this value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will attach a figure summary of constant differences here later to justify neglecting this.
6243bfe to
1390c71
Compare
9913aa0 to
448b5d9
Compare
11f85b0 to
bfc19be
Compare
|
At this point we arrive at green, though I'm adding a few tests for dependent calcs now. @dopplershift it looks like behavior tested in |
|
Ooof, that test looks like it's completely flaky given how many warning filters/xfails we have there. I think that was just checking that we enable some error catching/whatnot. Let's just go ahead and kill it. |
9e2d00b to
30d9aea
Compare
Particularly improving usefullness of RH at low temperatures See Unidata#2320
Update saturation vapor pressure to use simplified analytic expressions from Ambaum 2020. Allows for consistent assumptions across liquid and ice regimes and consistency for many modern downstream calculations: notably, incoming Romps LCL enhancement.
30d9aea to
da59eee
Compare
Build off drafted phase handling from community to calculate saturation vapor pressure over liquid, ice, or automatically across arrays based on freezing line. Add and test arbitrary kwarg validator for new phase kwarg. Add phase kwarg to calcs dependent on satvap, excluding dewpoint_from* calcs.
da59eee to
4e7f362
Compare
dopplershift
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Dependent on #3725.
In a Christmas Eve sprint, I implemented the analytic saturation vapor pressure from Ambaum 2020, per recommendations from #626. Lots of updated test values, and these may change further, but I wanted to get the changes out there quickly so we could evaluate their impacts, as well as get the changes into the full test matrix.
All departures are small in relative magnitude, but some callouts for potential scrutiny:
test_lfc_mltest_eland its extensionstest_dewpoint_specific_humidity_xarray(I reduced the precision instead of redefining the test data)Marked this test, not the first time we've run into it in other contexts.test_equivalent_potential_temperature_maskedworked before. The calculations work on the individual masked array elements but for some reason it blows up on the full array.numpy.ma.expoffered no help. If anyone has any insight here it had me pulling my hair out a bit.I'm not touching image tests until the other PR goes in and we tackle a review here, and maybe not even until LCL.Done.To support LCL validation and future support of automatic LCL/LDL/LFL handling, I've built on (and credited) some previous work to enhance certain moisture calcs to support
phasehandling. In this case,saturation_vapor_pressurenow supports water vapor equilibrium partial pressure over liquid and ice, and canautomatically do so across the triple point temperature. I've plumbed this into moisture quantity calculations that depend on saturation vapor pressure as well.I plan to follow up these changes with some tutorial and cookbook content in late Spring or early Summer.
Happy holidays! 🎅