Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.21k stars 408 forks source link

Update saturation_vapor_pressure #508

Open dopplershift opened 6 years ago

dopplershift commented 6 years ago

Found this paper which describes how to properly use Clausius-Clapyron to calculate saturation vapor pressure. Should update our calculations to:

tjwixtrom commented 6 years ago

I have conducted testing on this version of e_s, comparing the original MetPy implementation, the implementation in the Koutsoyiannis 2012, the Koutsoyiannis 2012 using MetPy constants, and Koutsoyiannis 2012 using MetPy constants and a variable Lv to the WMO accepted fit. The differences between these can be seen in the attached plots e_s_methods diff The WMO formula (which is a statistical fit) can be found here: wmo_188e.pdf

Based on my testing, it looks like we should change to either the WMO fit (which is not bad to code) or the Koutsoyiannis equation with current MetPy constants (changing the constants has no significant effect). Is there another source beside WMO that we could compare to?

For reference, changing the e_s equation will cause 15 tests to break.

tjwixtrom commented 6 years ago

Per request from @jrleeman, here are additional plots with percent change from WMO. percent_change_2 percent_change

dopplershift commented 6 years ago

These resources are also relevant, since they reproduce some text book material.

emanuel-reproduction.tar.gz

sgdecker commented 6 years ago

There are some alternatives to Koutsoyiannis: 1) Huang (2018) 2) Eqs. (4), (6-9), (11-12) from Romps (2017) 3) Flatau et al. (1992)

I'll try to code these up for comparison with the above, including a comparison of computational efficiency.

sgdecker commented 6 years ago

I coded more than the above, and the Flatau algorithm is the fastest, and also the most accurate for many input temperatures, or at least within the uncertainty of the reference datasets otherwise. For my "truth" I averaged the Goff, Wexler, Murphy and Koop, and Wagner and Pruss reference values. apxabsdif apxreldif

The code used to generate these figures and other diagnostics is at https://gist.github.com/sgdecker/12811e797b4a1df267a7be7cce8201ba

jrleeman commented 6 years ago

Thanks for doing this @sgdecker! I've got a reference dataset I'll compare to and we'll figure out what direction to head here.

deeplycloudy commented 5 years ago

I'm the party responsible for emanuel-reproduction.tar.gz. At the time I sent it to @dopplershift, I hadn't been able to sort out how Emanuel got his numbers. It turns out that the texbook uses variable latent heat of fusion but a constant specific heat of liquid water c_L. At cold temperatures, c_L increases quite rapidly, leading to large errors in Emanuel's calculations at those cold temperatures. Updated notebook attached, showing the reproduction of the incorrect table. Moist processes Fal18.ipynb.zip