<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> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I’m using this formula from Vaissala, see below<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It’s in Perl<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">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"># Compute Relative humidity & 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> </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"> push(@subindent,$indent);<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"> my $Q = 0; # Vapour content Kg/kg<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $T = 0; # Temperature K<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>my $P = 0; # Pressure (Pa)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> ($Q, $T, $P) = @_;<o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US">my $subname = (caller(0))[3];<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ($debug1) && print "@subindent>$subname\n";<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"> # Constant parameters<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C1 = -7.85951783;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C2 = 1.84408259 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C3 = -11.7866497;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C4 = 22.6807411 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C5 = -15.9618719;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $C6 = 1.80122502 ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $Pc = 22064000; # Critical Pressure Pa<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $Tc = 647.096; # Critical temperature K<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $B = 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"> my $A = 611.6441; #Pa<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $m = 7.591386; # -<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $Tn = 240.7263; # ?<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"> my $Pw; # Water vapour pressure (Pa)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $Pws; # Saturation water vapour pressure (Pa)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $RH ; # relative Humidity percentage<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> my $TD_C ; # Dew point temperature °C<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"> my $T_C = $T - $KELVIN_TO_CELSIUS;<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"> # my $tt = 1 - $T/$TC;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> # $Pws = $Pc * exp(($Tc/$T)*($C1*$tt + $C2*$tt**1.5 + $C3*$tt**3 + $C4*$tt**3.5 + $C5*$tt**4 + $C6*$tt**7.5));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> </span>$Pws = $A * 10**(($m*$T_C)/($T_C+$Tn));<o:p></o:p></p>
<p class="MsoNormal"> $Pw = $P * ($Q / ($Q + $B));<o:p></o:p></p>
<p class="MsoNormal"> $RH = $Pw/$Pws*100.;<o:p></o:p></p>
<p class="MsoNormal"> <span lang="EN-US">($RH > 100) && ($RH = 100);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ($RH < 0) && ($RH = 0);<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"> $TD_C = $Tn/(($m*log(10))/(log($Pw/$A)) - 1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> ($TD_C > $T_C) && ($TD_C = $T_C); # some times TD is > T when we have saturation<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"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> pop(@subindent);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> 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> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#3366FF;mso-fareast-language:FR">Thierry HEDDE</span></i></b><b><span style="font-size:8.0pt;font-family:"Arial","sans-serif";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:"Arial","sans-serif";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 : 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:"Arial","sans-serif";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’Environnement</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";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:"Arial","sans-serif";color:#3366FF;mso-fareast-language:FR">SIRET : 775 685 019 00587<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#3366FF;mso-fareast-language:FR">Bât 727 P102</span><span style="font-size:12.0pt;font-family:"Times New Roman","serif";mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Arial","sans-serif";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> </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:"Arial","sans-serif";color:#3366FF;mso-fareast-language:FR">43.6877°N 5.7611°E
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;mso-fareast-language:FR"> </span><span style="font-size:10.0pt;color:#3366FF;mso-fareast-language:FR"> <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> </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:"Arial","sans-serif";color:#3366FF;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>