-
Notifications
You must be signed in to change notification settings - Fork 416
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
Analytic Saturation Vapor Pressure #3726
base: main
Are you sure you want to change the base?
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
latent_heat = water_latent_heat_vaporization._nounit(temperature) | ||
heat_power = (mpconsts.nounit.Cp_l - mpconsts.nounit.Cp_v) / mpconsts.nounit.Rv | ||
exp_term = ((mpconsts.nounit.Lv / mpconsts.nounit.T0 - latent_heat / temperature) | ||
/ mpconsts.nounit.Rv) | ||
|
||
return ( | ||
mpconsts.nounit.sat_pressure_0c | ||
* (mpconsts.nounit.T0 / temperature) ** heat_power | ||
* np.exp(exp_term) | ||
) |
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.
This looks like it matches the paper and I don't see any better ways to approach the array math, so I'd say we're good to go here.
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_sensitive_sounding
test_lfc_ml
test_el
and its extensionstest_dewpoint_specific_humidity_xarray
(I reduced the precision instead of redefining the test data)test_equivalent_potential_temperature_masked
worked before. The calculations work on the individual masked array elements but for some reason it blows up on the full array.numpy.ma.exp
offered 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.
I'll include an implementation and tests for the saturation vapor pressure over ice in this PR as well.
Happy holidays! 🎅