<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ocotal.iarc.uaf.edu/index.php?action=history&amp;feed=atom&amp;title=Relative_Humidity_Calculator_Routine</id>
	<title>Relative Humidity Calculator Routine - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ocotal.iarc.uaf.edu/index.php?action=history&amp;feed=atom&amp;title=Relative_Humidity_Calculator_Routine"/>
	<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Relative_Humidity_Calculator_Routine&amp;action=history"/>
	<updated>2026-08-13T07:56:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://ocotal.iarc.uaf.edu/index.php?title=Relative_Humidity_Calculator_Routine&amp;diff=1642&amp;oldid=prev</id>
		<title>137.229.92.251 at 20:57, 28 November 2011</title>
		<link rel="alternate" type="text/html" href="http://ocotal.iarc.uaf.edu/index.php?title=Relative_Humidity_Calculator_Routine&amp;diff=1642&amp;oldid=prev"/>
		<updated>2011-11-28T20:57:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Use this shorty program to compute relative humidity from dry bulb air temperature and dew point.  Potential workflow and reason for usage would be something like this:&lt;br /&gt;
Have hourly air temperature &amp;amp; relative humidity data... would like to compute mean daily or mean monthly values for RH but you can't apply a simple average to RH.  So...&lt;br /&gt;
1) Use the dew point calculator program to compute dew point from hourly time series of AT &amp;amp; RH&lt;br /&gt;
2) Use the calculate mean daily or mean monthly subroutine to find mean air temperature and dew point&lt;br /&gt;
3) Use this subroutine to calculate RH from air temperature and dew point.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Sub RH_Calcs()&lt;br /&gt;
&lt;br /&gt;
'' This subroutine runs through a worksheet and calculates relative humidity from dew point and air temperature&lt;br /&gt;
'' as per the Dingman book appendix.&lt;br /&gt;
&lt;br /&gt;
    Dim inputrow As Long&lt;br /&gt;
    Dim outputrow As Long&lt;br /&gt;
    Dim inputdatecol As Integer&lt;br /&gt;
    Dim inputtempcol As Integer&lt;br /&gt;
    Dim inputdpcol As Integer&lt;br /&gt;
    Dim outputrhcol As Integer&lt;br /&gt;
    Dim inputWS As Integer&lt;br /&gt;
    Dim outputWS As Integer&lt;br /&gt;
    Dim es As Double&lt;br /&gt;
    Dim temperature As Double&lt;br /&gt;
    Dim Wa As Double&lt;br /&gt;
    Dim e As Double&lt;br /&gt;
    Dim dewpoint As Double&lt;br /&gt;
    &lt;br /&gt;
    inputdatecol = 1&lt;br /&gt;
    inputWS = 1&lt;br /&gt;
    inputrow = 15&lt;br /&gt;
    outputWS = inputWS&lt;br /&gt;
    outputrow = inputrow&lt;br /&gt;
    &lt;br /&gt;
    inputdpcol = 14&lt;br /&gt;
    inputtempcol = 15&lt;br /&gt;
    outputrhcol = 16&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    Do While Worksheets(inputWS).Cells(inputrow, inputdatecol).Value &amp;lt;&amp;gt; &amp;quot;&amp;quot;&lt;br /&gt;
        '' #1 Read in the values&lt;br /&gt;
        If Abs(Worksheets(inputWS).Cells(inputrow, inputtempcol).Value) &amp;lt;&amp;gt; 6999 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputtempcol).Value) &amp;lt;&amp;gt; 7777 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputtempcol).Value) &amp;lt;&amp;gt; 9999 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputtempcol).Value) &amp;lt;&amp;gt; 9999.9 And _&lt;br /&gt;
                Worksheets(inputWS).Cells(inputrow, inputtempcol).Value &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
            temperature = Worksheets(inputWS).Cells(inputrow, inputtempcol).Value&lt;br /&gt;
        Else:&lt;br /&gt;
          temperature = 6999&lt;br /&gt;
        End If&lt;br /&gt;
        If Abs(Worksheets(inputWS).Cells(inputrow, inputdpcol).Value) &amp;lt;&amp;gt; 6999 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputdpcol).Value) &amp;lt;&amp;gt; 7777 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputdpcol).Value) &amp;lt;&amp;gt; 9999 And _&lt;br /&gt;
                Abs(Worksheets(inputWS).Cells(inputrow, inputdpcol).Value) &amp;lt;&amp;gt; 9999.9 And _&lt;br /&gt;
                Worksheets(inputWS).Cells(inputrow, inputdpcol).Value &amp;lt;&amp;gt; &amp;quot;&amp;quot; Then&lt;br /&gt;
            dewpoint = Worksheets(inputWS).Cells(inputrow, inputdpcol).Value&lt;br /&gt;
        Else:&lt;br /&gt;
            dewpoint = 6999&lt;br /&gt;
        End If&lt;br /&gt;
        If temperature &amp;lt;&amp;gt; 6999 And dewpoint &amp;lt;&amp;gt; 6999 Then&lt;br /&gt;
            es = 0.611 * Exp((17.3 * temperature) / (temperature + 237.3))&lt;br /&gt;
            e = 0.611 * Exp((17.3 * dewpoint) / (dewpoint + 237.3))&lt;br /&gt;
            Wa = e / es * 100&lt;br /&gt;
        Else:&lt;br /&gt;
            Wa = 6999&lt;br /&gt;
        End If&lt;br /&gt;
        If Wa &amp;lt;&amp;gt; 6999 Then&lt;br /&gt;
            Worksheets(outputWS).Cells(outputrow, outputrhcol).Value = Wa&lt;br /&gt;
        End If&lt;br /&gt;
        outputrow = outputrow + 1&lt;br /&gt;
        inputrow = inputrow + 1&lt;br /&gt;
    Loop&lt;br /&gt;
    Range(&amp;quot;A12&amp;quot;).Select&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>137.229.92.251</name></author>
		
	</entry>
</feed>