<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Mary <br>
</p>
<p><br>
</p>
<p>Many thanks for your reply. Kindly see the code I use now to get 2m temperature at one location. The problem is that I am unable to get the corresponding times in the ascii file. Also is there a way to use 15 locations in line
<br>
</p>
<p><span>loc = wrf_user_ll_to_ij(a, 103.78538333,1.44386667, True)</span> instead of just one.<br>
</p>
<p><br>
</p>
<p></p>
<div>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl&quot;<br>
load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl&quot;<br>
;***********************************************<br>
begin<br>
;***********************************************<br>
<br>
DATADir = &quot;./&quot;<br>
&nbsp; FILES = systemfunc (&quot; ls -1 &quot; &#43; DATADir &#43; &quot;wrfout_d05* &quot;)<br>
a = addfiles(FILES&#43;&quot;.nc&quot;,&quot;r&quot;)<br>
<br>
times = wrf_user_list_times(a)<br>
ntimes = dimsizes(times)<br>
<br>
do it = 0,ntimes-1<br>
ntimes = dimsizes(times)<br>
T2= new(ntimes,&quot;string&quot;)<br>
time = it<br>
<br>
loc = wrf_user_ll_to_ij(a, 103.78538333,1.44386667, True)<br>
mx = loc(0) - 1 ; array pointers in NCL space<br>
ny = loc(1)-1<br>
lat1&nbsp; = a[0]-&gt;XLAT(0,ny,mx)&nbsp;&nbsp;&nbsp; ; the is the nearest grid point<br>
</div>
<div>lon1&nbsp; = a[0]-&gt;XLONG(0,ny,mx)<br>
tc2 = wrf_user_getvar(a,&quot;T2&quot;,it)&nbsp;&nbsp;&nbsp;&nbsp; ; T2 in Kelvin<br>
tc2 = tc2-273.16&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; T2 in C<br>
&nbsp;end do<br>
asciiwrite(&quot;2mtemperature.csv&quot;,tc2)<br>
end<br>
</div>
<br>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri,Arial,Helvetica,sans-serif,&quot;EmojiFont&quot;,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,NotoColorEmoji,&quot;Segoe UI Symbol&quot;,&quot;Android Emoji&quot;,EmojiSymbols;">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><b><br>
</b></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:11pt">Muhammad Omer Mughal</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:11pt">MSc&nbsp;BSc&nbsp;Mechanical Engineering</span></font><font color="#1F497D" size="1" face="Arial,sans-serif"><span style="font-size:8pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">PhD&nbsp;&nbsp;Research&nbsp;Scholar</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Remote Sensing and Satellite Research Group</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Department of Imaging and Applied Physics</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt"><br>
Curtin University</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt"><br>
</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><br>
</span></font><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:9pt">Curtin University</span></font><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:9pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Tel |</span></font><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:9pt">&nbsp;</span></font><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt">&#43;61
 8 9266 7962</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt">&nbsp;</span></font><font color="#1F497D" size="1" face="Calibri,sans-serif"><span style="font-size:7pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Fax |</span></font><font color="#1F497D" size="2" face="Arial Bold"><span style="font-size:9pt">&nbsp;</span></font><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt">&#43;61
 8 9266 2377</span></font><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Mobile |</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt">&nbsp;</span></font><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt">0470&nbsp;237&nbsp;525</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt">&nbsp;&nbsp;</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt"><br>
</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Email |</span></font><font color="#1F497D" size="2" face="Calibri,sans-serif"><span style="font-size:9pt">&nbsp;</span></font><a href="mailto:m.lynch@curtin.edu.au" target="_blank" id="LPNoLP"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">m.mughal1@postgrad.curtin.edu.au</span></font></a><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt">&nbsp;</span></font><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font color="#AB8303" size="2" face="Arial Bold"><span style="font-size:9pt">Web |</span></font><font color="#AB8303" size="2" face="Calibri,sans-serif"><span style="font-size:9pt">&nbsp;</span></font><a href="http://curtin.edu.au/" target="_blank" id="LPNoLP"><font size="2" face="Calibri,sans-serif"><span style="font-size:11pt"><font size="2" face="Arial,sans-serif"><span style="font-size:9pt">http://curtin.edu.au</span></font></span></font></a><font color="#1F497D" size="2" face="Arial,sans-serif"><span style="font-size:9pt"><br>
</span></font><font color="#1F497D" size="1" face="Calibri,sans-serif"><span style="font-size:7pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font color="#1F497D" size="1" face="Calibri,sans-serif"><span style="font-size:6pt"></span></font><font color="#1F497D" size="1" face="Arial,sans-serif"><span style="font-size:6pt">Curtin University is a trademark of Curtin University of Technology.&nbsp;</span></font><br>
</div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#1F497D" size="1" face="Arial,sans-serif"><span style="font-size:6pt">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#1F497D" size="1" face="Arial,sans-serif"><span style="font-size:6pt"><br>
</span></font></span></font></div>
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,'Segoe UI','Segoe WP',Tahoma,Arial,sans-serif; font-size:15.4545450210571px; margin:0px; background-color:rgb(255,255,255)">
<font size="3" face="Times New Roman,serif"><span style="font-size:12pt"><font color="#1F497D" size="1" face="Arial,sans-serif"><span style="font-size:6pt"><br>
</span></font></span></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mary Haley &lt;haley@ucar.edu&gt;<br>
<b>Sent:</b> Friday, 14 July 2017 10:44:04 PM<br>
<b>To:</b> Muhammad Omer Mughal<br>
<b>Subject:</b> Re: [ncl-talk] Wrf output at multiple mast locations</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:small">Muhammad,</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">For plotting WRF data, I recommend visiting this page:</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/wrf.shtml">http://www.ncl.ucar.edu/Applications/wrf.shtml</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">As that first box points, out, you can use wrf_user_getvar:</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml">http://www.ncl.ucar.edu/Document/Functions/WRF_arw/wrf_user_getvar.shtml</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">to calculate various diagnostics and/or read variables.&nbsp; It has some examples, including how to read 2m temperature (in degK):</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">&nbsp; t2 = wrf_user_getvar(f,&quot;T2&quot;,-1) &nbsp; &nbsp;; read 2m temp across all time steps</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">In order to compare observational data with data that's on a WRF grid, you need to regrid or place the obs data on the WRF grid.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">To regrid the data using ESMF, this involves interpolation, which you may or may not want.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">See example ESMF_regrid_20.ncl at:</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex20">http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex20</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">This goes from a WRF grid to another WRF grid, but the main change you need to make is to the &quot;lat_src&quot; and &quot;lon_src&quot; variables, which represent your source grid. These will need to be set the observational lat/lon 1D arrays in your
 case.&nbsp;</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">If you don't want to interpolate the data, then you can try triple2grid2d, which we don't have any examples for, but the documentation has some code snippets for:</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/triple2grid2d.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/triple2grid2d.shtml</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Finally, you may also want to visit the &quot;gridding random data&quot; page:</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default"><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/triple2grid2d.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/triple2grid2d.shtml</a><br>
</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">I'm not sure this is your best set of examples, but I think it's worth looking at all these different methods to see which one best fits your purpose.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">If you have problems with this and are able to provide us with your script and data, then we can help you out and maybe create a new example for our examples page so other users can benefit.</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Good luck,</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">--Mary</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">
<p class="gmail-p2"><span class="gmail-s1"><br>
</span></p>
</div>
<div class="gmail_default"><br>
</div>
<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Jul 12, 2017 at 6:50 PM, Muhammad Omer Mughal <span dir="ltr">
&lt;<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.au</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi<br>
<br>
Is it possible in NCL to grab 2m temperature time series data at multiple locations in a single Wrf output file . I have about 15 stations and I want to compare the temperature at those locations with Wrf simulated temperature at 2m. Is there any example script
 that I can look at ?<br>
Also I would like to compare 2m temperature at single time from Wrf and observations&nbsp; and plot the difference.please direct me to the relevant example.<br>
Thanks<br>
<br>
<br>
​<br>
Muhammad Omer Mughal<br>
MSc BSc Mechanical Engineering<br>
PhD&nbsp; Research Scholar<br>
Remote Sensing and Satellite Research Group<br>
Department of Imaging and Applied Physics<br>
Curtin University<br>
<br>
Curtin University<br>
Tel | <a href="tel:&#43;61%208%209266%207962" value="&#43;61892667962" target="_blank">&#43;61 8 9266 7962</a><br>
Fax | <a href="tel:&#43;61%208%209266%202377" value="&#43;61892662377" target="_blank">&#43;61 8 9266 2377</a><br>
Mobile | 0470 237 525<br>
<br>
Email | <a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.<wbr>au</a><br>
Web | <a href="http://curtin.edu.au" target="_blank">http://curtin.edu.au</a><br>
<br>
​ Curtin University is a trademark of Curtin University of Technology.<br>
CRICOS Provider Code 00301J (WA), 02637B (NSW)<br>
<br>
​<br>
</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>
</div>
</body>
</html>