Water Vapor Calculators

I have written several programs to help understand the problems computing relative humidity. These programs implement 30 equations (algorithms) to compute saturated water vapor based only on the provided temperature.

Background | mcSaturationVaporPressure.js | Saturation_vapor_pressure.html percent_difference | Water_Vapor.html | Numeric Fields


Background

When studying the IR absorption of the atmosphere, the number of molecules of water vapor in a column of air is required. Another program I wrote allows you to enter the water vapor mixing ratio which is used to compute the number of molecules in the column.

The problem was that I had no idea if the values made any sense. Therefore, I added a computation to find the relative humidity (%RH) associated with that mixing ratio. I was surprised to learn that the mixing ratio for 60%RH at the surface (15C) would be over 2,000%RH at -30C. I was also concerned that the "over water" equation would provide the wrong value at -30C. (Not much liquid at that temperature.) It was while investigating the "over ice" algorithm that I discovered that there were many models to compute the saturation vapor pressure.

In addition, I found the following very confusing - when discussing the RH over ice formulations

At the time, it wasn't clear what that meant - I assumed that when a radio sounde reports a dew point suppression, that means that the frost point has already been converted to a dew point - but that was really just a guess. According to the Alduchov_Eskridge 1996 Introduction, with respect to the United States data In other words - this is a mess. And they say nothing about the rest of the world. In order to compare old data with new data, you need to know how the data was collected and how the measured values were converted to the reported values. Since the accuracy of the algorithms has changed over time, and since the definition of temperature has also changed, it is important to have sufficient metadata .. otherwise there is basically no way to get a good comparison of old and new data.

These programs were written to

It turned out that the difficult part was determining the saturation vapor pressure - the rest of the code is simple and very straight forward.

In the following programs (calculators) the temperature values are limited to display only 2 decimal places. To use additional precision, type the value into the Kelvin field. The only time I have needed this is when checking the *new* boiling point of water at 1 atm - the old standard was 100C and the new value is 99.974C .. because the standard temperature scale was redefined in 1990!


mcSaturationVaporPressure.js

The equations used to compute the saturation vapor pressures are implemented in mcSaturationVaporPressure.js.
Placing these algorithms in a separate module simplifies reusing them in various programs and guarantees that the computations will be the same.

For temperatures below 145 K (-128°C), the partial pressures are so low that they might as well be zero. Also, some of the algorithms produce errors with lower temperatures. As a result, the program just returns a partial pressure of zero for temperatures below 145 K.


Saturation_vapor_pressure.html

There are many equations to compute the saturation water vapor pressure depending on the temperature. Saturation_vapor_pressure.html shows the results of 30 algorithms for easy comparison - just set the temperature. (All 3 temperature fields are linked - just pick one.)

From Review of the vapour pressures of ice and supercooled water for atmospheric applications by D. M. Murphy and T. Koop, 29 Dec 2006

This program shows that many algorithms don't intersect with this.

The second calibration point is a problem - ref

Perhaps 2 of the formulations have been modified to take this into account

Otherwise, as far as I can tell, none of the other saturation vapor pressure algorithms have been modified to take this into account. (It's been 24 years and counting.) Maybe it does not really matter since most of the algorithms don't intersect either boiling point.

By the way, there is no requirement that a good algorithm has to intersect one, or both, calibration points (though it would be nice). "Improved Magnus` form approximation of saturation vapor pressure" argues that a formulation that produces the smallest maximum error may be "better" than the algorithm with the smallest overall error (determined by, for example, a least squares fit) if the tail values are off by a large amount.

Various hints and notes are displayed in the status bar when the mouse is placed over certain fields.


Saturation_vapor_pressure_percent_difference.html

Saturation_vapor_pressure_percent_difference.html extends the capability of Saturation_vapor_pressure.html by To use the extra columns, first click on one of the Over Water values - it will be used as the "compare" value .. indicated with a light yellow background. The difference and percent difference will be computed for all the other Over Water formulations.

The initial threshold is ± 0.5% (which you can change) - values outside that range are colored light red. A checkbox will disable the color.

The basic Magnus equation (1844) is used in many programs, online calculators, and journal papers. However, there are many sets of coefficients! Way too many to include them all in a general calculator. (My programs implement 4.) For example, the purpose of Review of the vapour pressures of ice and supercooled water for atmospheric applications by D. M. Murphy and T. Koop, 29 Dec 2006, was to find new Magnus coefficients, and several sets were found. At any rate, I have provided a way for you to compare the odd stuff to the 19 over liquid water formulations provided. Note that the temperature used is in degrees-C and that some formulations use Kelvin in a way that simply subtracting 273.15 will not produce the expected result. For example, for the MagnusTetens formulation, you need to subtract 273.16 and add 0.01 to the C parameter. Here are a few Other Formulas (Careful - A, B, C are in a different order).


Water_Vapor.html

Originally, I just wanted to investigate the relation between Dew Point, Relative Humidity, and the Mixing Ratio - the value needed to compute IR absorption and emission. I had no idea there were so many formulations - especially since most references simply imply that their equation is the only one!

Once I had code to compute the saturation vapor pressure - the rest of the code was simple and very straight forward.

Water_Vapor.html was written to

Assuming the RH is known

Assuming the mixing ratio is known The saturation mixing ratio (ppm) is simply the saturation partial pressure (based only on temperature) divided by the actual pressure and multiplied by one million. Well, those are the formulas I use, but they are not strictly "correct". The mixing ratio is usually specified for "dry air". As a result, some adjustment is necessary .. somewhere. The books I have are not very clear on this.

The temperature inputs are rounded to 2 decimal points. Most other fields are rounded to 5. As a result, some numbers may not match exactly.

The program computes the dew point and the frost point - the temperatures where RH reaches 100%. Obviously, frost points above freezing are of no value. However, dew points below freezing are useful - they could indicate the possibility of a freezing rain event, a condition where super cooled liquid water freezes on impact - and occur on a regular basis.

When the mouse is over a temperature, pressure, or altitude control (other than the temperature selector), appropriate conversions will be displayed in the status bar.

The fields with white backgrounds can be edited by the user. Those with grey backgrounds are readonly computed values - they can be copied to the clipboard .. but you can not enter new data.

On the form, several parameters are tightly linked - radio buttons are provided to select which one to hold constant as other values are changed.

Temperatures are limited to those below the critical temperature - 647.096 K - and above 140 K.


Numeric Fields

All the numeric data entry fields have associated spin buttons. In addition to typing in new values, you can use the buttons or use the mouse wheel. Use (press and hold) the Shift, Ctrl, and Alt keys to control the increment size.

Some of the fields have hard limits (degrees-K won't go below zero) and others will turn red outside the expected range (0 < %RH < 150).


Versions

All major software changes. Spelling and format changes are not listed.


Author: Robert Clemenzi
URL: http:// mc-computing.com / Science_Facts / Water_Vapor / Water_Vapor_Calculators.html