<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Webdings;
        panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Texte de bulles Car";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.TextedebullesCar
        {mso-style-name:"Texte de bulles Car";
        mso-style-priority:99;
        mso-style-link:"Texte de bulles";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I&#8217;m using this formula from Vaissala, see below<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It&#8217;s in Perl<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thierry<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">###############################################################################<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#&nbsp; Compute Relative humidity &amp; Dew point temperature<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"># http://www.vaisala.com/Vaisala%20Documents/Application%20notes/Humidity_Conversion_Formulas_B210973EN-F.pdf<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">sub ComputeRelativeHumidity{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; push(@subindent,$indent);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Q = 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Vapour content Kg/kg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $T = 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temperature K<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; </span>my $P = 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Pressure&nbsp; (Pa)<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">&nbsp; ($Q, $T, $P) = @_;<o:p></o:p></p>
<p class="MsoNormal">&nbsp; <span lang="EN-US">my $subname = (caller(0))[3];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; ($debug1) &amp;&amp; print&nbsp; &quot;@subindent&gt;$subname\n&quot;;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; # Constant parameters<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C1 = -7.85951783;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C2 = 1.84408259 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C3 = -11.7866497;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C4 = 22.6807411 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C5 = -15.9618719;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $C6 = 1.80122502 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Pc = 22064000;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Critical Pressure Pa<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Tc = 647.096;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Critical temperature K<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $B&nbsp; = 0.6219907; # kg/kg = Molecular mass of H2O/ Molecular mass of air<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $A&nbsp; = 611.6441;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Pa<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $m&nbsp; = 7.591386;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # -<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Tn = 240.7263;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Pw;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Water vapour pressure&nbsp; (Pa)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $Pws;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Saturation water vapour pressure&nbsp; (Pa)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $RH ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # relative Humidity percentage<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $TD_C ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dew point temperature °C<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; my $T_C = $T - $KELVIN_TO_CELSIUS;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; #&nbsp;&nbsp;&nbsp; my $tt = 1 - $T/$TC;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; #&nbsp;&nbsp;&nbsp; $Pws = $Pc * exp(($Tc/$T)*($C1*$tt &#43; $C2*$tt**1.5 &#43; $C3*$tt**3 &#43; $C4*$tt**3.5 &#43; $C5*$tt**4 &#43; $C6*$tt**7.5));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; </span>$Pws = $A * 10**(($m*$T_C)/($T_C&#43;$Tn));<o:p></o:p></p>
<p class="MsoNormal">&nbsp; $Pw&nbsp; = $P * ($Q / ($Q &#43; $B));<o:p></o:p></p>
<p class="MsoNormal">&nbsp; $RH = $Pw/$Pws*100.;<o:p></o:p></p>
<p class="MsoNormal">&nbsp; <span lang="EN-US">($RH &gt; 100) &amp;&amp; ($RH = 100);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; ($RH &lt;&nbsp;&nbsp; 0) &amp;&amp; ($RH =&nbsp;&nbsp; 0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; $TD_C = $Tn/(($m*log(10))/(log($Pw/$A)) - 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; ($TD_C &gt; $T_C) &amp;&amp; ($TD_C = $T_C); # some times TD is &gt; T when we have saturation<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; pop(@subindent);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">&nbsp; return ($RH, $TD_C);<o:p></o:p></span></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal">###############################################################################<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">Thierry HEDDE</span></i></b><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#33CCCC;mso-fareast-language:FR"><o:p></o:p></span></b></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="78" style="width:58.75pt;border:solid white 1.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><i><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#4A442A;mso-fareast-language:FR"><img width="77" height="63" id="Image_x005f_x005f_x005f_x0020_1" src="cid:image001.gif@01D14F6E.FC2FE850" alt="Description&nbsp;: cid:image001.png@01CD508D.94A56310"><o:p></o:p></span></i></p>
</td>
<td width="357" style="width:267.85pt;border:solid white 1.0pt;border-left:none;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR"><a href="http://www-cadarache.cea.fr/fr/activites/fission/dtn/Plateformes/Environnement/Plateforme_environnement.php">Laboratoire de Modélisation
 des Transferts dans l&#8217;Environnement</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">CEA/Cadarache<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">SIRET&nbsp;: 775&nbsp;685&nbsp;019 00587<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">Bât 727 P102</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">13108 Saint Paul lez Durance cedex<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:8.0pt;mso-fareast-language:FR"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-family:Webdings;mso-fareast-language:FR">ü</span><span style="mso-fareast-language:FR">
</span><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR">43.6877°N&nbsp; 5.7611°E&nbsp;&nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:FR">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size:10.0pt;color:#3366FF;mso-fareast-language:FR">&nbsp;<a href="http://geoportail.fr/url/7F7oz2">Géoportail</a></span><span style="mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><img border="0" width="153" height="47" id="Image_x0020_1" src="cid:image002.png@01D14F6E.FC2FE850"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><img border="0" width="179" height="21" id="Image_x0020_3" src="cid:image003.png@01D14F6E.FC2FE850"></span><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#3366FF;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>