*Last Updated:* May 02, 1999

[ Algorithms Index | Index | Feedback ]

**Calculating Heat Index & Wind Chill Index****Calculating Humidity Properties****Calculations With Humidity Properties****Unit Conversions**

function calcWithDp(drybulb, dewpoint, pressure) { var result = new Object(); var havePress = (pressure != 0); result.rh = calcRelHumidity(e, es); // Use variable names familiar to meteorologists. // Feel combine these four assignments into two var es = calcVaporPressure(drybulb); var e = calcVaporPressure(dewpoint); result.saturvp = es; result.actualvp = e; result.abshum = calcAbsHumidity(e, drybulb); if (!havePress) return; result.wetbulb = calcWetbulb(pressure, drybulb, dewpoint); result.mixratio = calcMixingRatio(e, pressure); result.spechum = calcSpecHumidity(e, pressure); return result; }

`drybulb` is the drybulb in Celsius.

`dewpoint` is the dewpoint in Celsius.

`pressure` is the pressure in millibars or 0 if no pressure is to be assumed.

An object with these properties:

`rh`is the relative humidity`saturvp`is the vapor pressure in millibars from the drybulb temperature.`actualvp`is the vapor pressure in millibars from the dewpoint termperature.`abshum`is the absolute humidity in grams per cubed meter.- If pressure is non-zero,
`wetbulb`is the wetbulb estimate in degrees Celsius. - If pressure is non-zero,
`mixratio`is the mixing ratio in grams per kilogram. - If pressure is non-zero,
`spechum`is the specific humidity in grams per kilogram.

function calcWithRh(drybulb, rh, pressure) { var result = new Object(); var havePress = (pressure != 0); // Calculate drybulb vapor pressure var es = calcVaporPressure(drybulb); // Calculate dewpoint vapor pressure var e = es * rh / 100; result.dewpoint = calcTcFromVaporPressure(e); if (rh == 100) result.wetbulb = dewpoint; result.saturvp = es; result.actualvp = e; result.abshum = calcAbsHumidity(e, drybulb); // Assume a reasonable default if (!havePress) pressure = 1013; if (rh != 100) result.wetbulb = calcWetbulb(pressure, drybulb, dewpoint); result.mixratio = calcMixingRatio(e, pressure); result.spechum = calcSpecHumidity(e, pressure); return result; }

`drybulb` is the drybulb in Celsius.

`rh` is the relative humidity in decimal.

`pressure` is the pressure in millibars or 0 if no pressure is to be assumed.

An object with these properties:

`dewpoint`is the dewpoint in degrees Celsius.`saturvp`is the vapor pressure in millibars from the drybulb temperature.`actualvp`is the vapor pressure in millibars from the dewpoint termperature.`abshum`is the absolute humidity in grams per cubed meter.- If pressure is non-zero,
`wetbulb`is the wetbulb estimate in degrees Celsius. - If pressure is non-zero,
`mixratio`is the mixing ratio in grams per kilogram. - If pressure is non-zero,
`spechum`is the specific humidity in grams per kilogram.

function calcWithWb(drybulb, wetbulb, pressure) { var result = new Object(); var es = calcVaporPressure(drybulb); var esw = calcVaporPressure(wetbulb); result.saturvp = es; // Make an assumption since wetbulb varies little with pressures likely to occur in the atmosphere if (pressure == 0) pressure = 1013; var e = esw - (0.00066 * (1 + 0.00155 * wetbulb) * press * (drybulb - wetbulb)); // If the wetbulb is too low, quit. Otherwise, incorrect values are the results. if (e < 0) return; result.actualvp = e; result.abshum = calcAbsHumidity(e, drybulb); result.dewpoint = calcTcFromVaporPressure(e); result.rh = calcRelHumidity(e,es); result.mixratio = calcMixingRatio(e, pressure); result.spechum = calcSpecHumidity(e, pressure); return result; }

`drybulb` is the drybulb in Celsius.

`wetbulb` is the wetbulb in Celsius.

`pressure` is the pressure in millibars or 0 if no pressure is to be assumed.

An object with these properties as long as the wetbulb is not too low:

`dewpoint`is the dewpoint in degrees Celsius.`rh`is the relative humidity.`saturvp`is the vapor pressure in millibars from the drybulb temperature.`actualvp`is the vapor pressure in millibars from the dewpoint termperature.`abshum`is the absolute humidity in grams per cubed meter.`mixratio`is the mixing ratio in grams per kilogram.`spechum`is the specific humidity in grams per kilogram.

[ Algorithms Index | Index | Feedback ]

Copyright © 1997-1999 by Mark E. All Rights Reserved.