<div dir="ltr">Hi Mehdi,<div><br></div><div>First, you should use example 2 from that link if you are working with WRF-ARW data, since wrf_user_getvar handles all of the variable extraction for you and reduces the code to only a few lines. Since newer versions of NCL now implicitly load everything (no need for the load statements at the top), to get RH you just do:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">a = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" style="margin:0px;padding:0px;text-decoration-line:none;color:rgb(133,45,133);font-family:verdana,sans-serif"><strong style="margin:0px;padding:0px">addfile</strong></a>("your WRF file name","r")

time = 0
rh = <a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml" style="margin:0px;padding:0px;text-decoration-line:none;color:rgb(133,45,133);font-family:verdana,sans-serif"><strong style="margin:0px;padding:0px">wrf_user_getvar</strong></a>(a,"rh",time)  ; calculate RH</pre></blockquote><div><br></div><div>Replace the "your WRF file name" with the actual name of your WRF file.</div><div><br></div><div>Second, whether you use wrf_rh or wrf_user_getvar, the result returned is just an NCL variable. If you want this placed in to a new file, you need to do that yourself. In the example 1 that you used, it's only printing the variable summary for RH, which is what you've copied and pasted above. </div><div><br></div><div>The easiest way to write to a file is shown in this example:</div><div><br></div><div><a href="https://www.ncl.ucar.edu/Applications/method_1.shtml">https://www.ncl.ucar.edu/Applications/method_1.shtml</a><br></div><div><br></div><div>In reality, if you just want to compute RH and write it to a file, it's only a few lines of code:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">infile = </span><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" style="font-size:13.3333px;color:rgb(133,45,133);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif"><strong style="margin:0px;padding:0px">addfile</strong></a><span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">("your WRF file name","r")</span> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><pre style="margin-top:0px;margin-bottom:0px;padding:0px;font-size:13.3333px;line-height:12pt;font-family:courier;border-style:solid;border-width:0px 0px 15px;border-color:transparent;color:rgb(0,0,0)">outfile = <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/addfile.shtml" style="margin:0px;padding:0px;text-decoration-line:none;color:rgb(133,45,133);font-family:verdana,sans-serif"><strong style="margin:0px;padding:0px">addfile</strong></a>("<a href="http://rh_out.nc">rh_out.nc</a>" ,"c")  ; open output netCDF file</pre></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">time = 0</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">rh = </span><a href="https://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml" style="font-size:13.3333px;color:rgb(133,45,133);margin:0px;padding:0px;text-decoration-line:none;font-family:verdana,sans-serif"><strong style="margin:0px;padding:0px">wrf_user_getvar</strong></a><span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">(infile,"rh",time)  ; calculate RH</span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">outfile->RH = rh</blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  </blockquote><div><br></div><div>Hope this helps,</div><div><br></div><div>Bill </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 21, 2018 at 8:53 AM, mehdi darvishi <span dir="ltr"><<a href="mailto:mehdidarvishi@yahoo.com" target="_blank">mehdidarvishi@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:verdana,helvetica,sans-serif;font-size:16px"><div><div><font size="2"><i>Dear all,</i></font></div><div><font size="2"><i><br></i></font></div><div><font size="2"><i>I
 have recently installed ncl-6.3.0 and am not familair with weather 
software and data at all. For my work, I just need to calculate RH% from
 a wrfout file. After typing ncl in the command line, I followed the 
instructions in this link <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/wrf_rh.shtml" rel="nofollow" target="_blank">https://www.ncl.ucar.edu/<wbr>Document/Functions/Built-in/<wbr>wrf_rh.shtml</a></i></font></div><div><font size="2"><i><br></i></font></div><div><font size="2"><i>and then the following massage appeared:</i></font></div><div><font size="2"><i><br></i></font></div><div><font size="2"><i>Variable: RH<br>Type: float<br>Total Size: 114376 bytes<br>            28594 values<br>Number of Dimensions: 4<br>Dimensions and sizes:    [Time | 1] x [bottom_top | 29] x [south_north | 34] x [west_east | 29]<br>Coordinates: <br>Number Of Attributes: 2<br>  units :    %<br>  description :    Relative Humidity<br><br>Have
 I done it right? When I looked at the current working directory, I 
could not find any file related to the RH. I thought that maybe the RH 
file has been added to the wrfout file as a subsetdata with the RH 
variable, but it was not there. My question is that the RH file has been
 created or not? if so, where can I find it. Sorry for the 0-level 
question and thank you for your help.</i></font></div><div><font size="2"><i><br></i></font></div><div><font size="2"><i>Regards,</i></font></div><div><font size="2"><i><br></i></font></div><font size="2"><i>Mehdi</i></font><br></div></div></div><br>______________________________<wbr>_________________<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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>