<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">It's to do with whether they are calculated with respect to water (above 0C) or ice (below -20C) or some combination of the two. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Attached is a version of a water specific version relhum_water(). </div><div class="gmail_default" style="font-family:verdana,sans-serif">Dennis and myself put this together in follow up to my post below, this uses the same constants as mixhum_ptrh and should be consistently reversible. Whether you want RH wrt water is your decision though.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">example code:</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default"><font face="monospace, monospace">load "./relhum_water.ncl"</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">p = (/25132.156,27032.215,33876.102,39419.887/) ;Pa</font></div><div class="gmail_default"><font face="monospace, monospace">t = (/229.690,228.809,225.332,231.278/) ;K</font></div><div class="gmail_default"><font face="monospace, monospace">rh = (/2.008,1.884,62.117,103.124/) ;%</font></div><div class="gmail_default"><font face="monospace, monospace">q = mixhum_ptrh (todouble(p/100.), todouble(t), todouble(rh), 1)</font></div><div class="gmail_default"><font face="monospace, monospace">rh1 = relhum (t,q,p)</font></div><div class="gmail_default"><font face="monospace, monospace">rhw = relhum_water(t, q, p)</font></div><div class="gmail_default"><font face="monospace, monospace"><br></font></div><div class="gmail_default"><font face="monospace, monospace">print( " rh , relhum , relhum_water")</font></div><div class="gmail_default"><font face="monospace, monospace">print( sprintf("%9.3f",rh)+","+sprintf("%9.3f",rh1)+","+sprintf("%9.3f",rhw))</font></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Here's a link to the ncl talk post I made on this a while back. The resulting JIRA ticket was 2133, hopefully some extra functions will be in 6.3.1</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><a href="http://mailman.ucar.edu/pipermail/ncl-talk/2015-February/001850.html" target="_blank">http://mailman.ucar.edu/pipermail/ncl-talk/2015-February/001850.html</a><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">The basic text</div><div class="gmail_default" style="font-family:verdana,sans-serif">"</div><div class="gmail_default" style="font-family:verdana,sans-serif"><pre style="color:rgb(0,0,0)">Can the documentation for the relhum() function be more explicit that it is
calculating with respect to ice below -20C and a mix phase between 0 and
-20C. ( I checked the values in the lookup table against a textbook. )
Also that the other moisture functions mixhum... dewtemp... are not using
the same tables/formula. Even relhum_ttd() isn't. Therefore values from
relhum are not entirely compatible with the other functions. Given that
many of those functions require rh as an input I imagine a lot of people
are first using relhum to then use a follow up function. This could lead
to unexpected results given the lack of details in the documentation at the
moment.
</pre><div>"</div><div><br></div><div>Alan. </div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 28, 2015 at 7:03 PM, yang yang <span dir="ltr"><<a href="mailto:yang.yang816@gmail.com" target="_blank">yang.yang816@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div class="gmail_quote"><br><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div> Dear Sir/Madam:</div><div><br></div><div dir="ltr"><br></div><div dir="ltr">I have a few data of air T, P, and RH. I used mixhum_ptrh and relhum to recalculate RH again. Both the RH should be the same, however, large differences were found.</div><div dir="ltr"><br></div><div dir="ltr">Can you please tell me what is the reason? Thanks!</div><div dir="ltr"><br></div><div dir="ltr">Regards</div><div dir="ltr">ED</div><div dir="ltr"><br></div><div dir="ltr">The codes are:</div><div dir="ltr"><br></div><div dir="ltr">;*******************************************<br>begin<br>;*******************************************<br>p = (/25132.156,27032.215,33876.102,39419.887/) ;Pa<br>t = (/229.690,228.809,225.332,231.278/) ;K<br>rh = (/2.008,1.884,62.117,103.124/) ;%</div><div dir="ltr">q = mixhum_ptrh (todouble(p/100.), todouble(t), todouble(rh), 1)<br>rh1 = relhum (todouble(t),todouble(q),todouble(p))<br>print(rh1)<br>print(rh)<br>end</div><div dir="ltr"><br></div><div dir="ltr">After run the codes:</div><div dir="ltr"><br></div><div dir="ltr"> Copyright (C) 1995-2011 - All Rights Reserved<br> University Corporation for Atmospheric Research<br> NCAR Command Language Version 6.0.0<br> The use of this software is governed by a License Agreement.<br> See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> for more details.</div><div dir="ltr"><br>Variable: rh1<br>Type: double<br>Total Size: 32 bytes<br> 4 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [4]<br>Coordinates:<br>(0) 2.960429399791643<br>(1) 2.796223142965527<br>(2) 94.57799164378163<br>(3) 150.3954363205561</div><div dir="ltr"><br>Variable: rh<br>Type: float<br>Total Size: 16 bytes<br> 4 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [4]<br>Coordinates:<br>(0) 2.008<br>(1) 1.884<br>(2) 62.117<br>(3) 103.124<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div></div></div></div><br></div>
<br></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>