<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=utf-8">
<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:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
        {font-family:"Arial Bold";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
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
        {mso-style-priority:99;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.gmail-p2, li.gmail-p2, div.gmail-p2
        {mso-style-name:gmail-p2;
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.gmail-s1
        {mso-style-name:gmail-s1;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hi Muhammad and Mary,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Would rcm2points be suitable for this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml">https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Helen<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> ncl-talk-bounces@ucar.edu [mailto:ncl-talk-bounces@ucar.edu]
<b>On Behalf Of </b>Muhammad Omer Mughal<br>
<b>Sent:</b> 18 July 2017 01:55<br>
<b>To:</b> Mary Haley; ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] Wrf output at multiple mast locations<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div id="divtagdefaultwrapper">
<p><span style="font-family:"Calibri","sans-serif";color:black">Hi Mary <o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">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 <o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black">loc = wrf_user_ll_to_ij(a, 103.78538333,1.44386667, True) instead of just one.<o:p></o:p></span></p>
<p><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"<br>
;***********************************************<br>
begin<br>
;***********************************************<br>
<br>
DATADir = "./"<br>
FILES = systemfunc (" ls -1 " + DATADir + "wrfout_d05* ")<br>
a = addfiles(FILES+".nc","r")<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,"string")<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 = a[0]->XLAT(0,ny,mx) ; the is the nearest grid point<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black">lon1 = a[0]->XLONG(0,ny,mx)<br>
tc2 = wrf_user_getvar(a,"T2",it) ; T2 in Kelvin<br>
tc2 = tc2-273.16 ; T2 in C<br>
end do<br>
asciiwrite("2mtemperature.csv",tc2)<br>
end<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-family:"Calibri","sans-serif";color:black"><o:p> </o:p></span></p>
<div id="Signature">
<div id="divtagdefaultwrapper">
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:"Arial Bold","serif";color:#1F497D">Muhammad Omer Mughal</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.0pt;font-family:"Arial Bold","serif";color:#1F497D">MSc BSc Mechanical Engineering</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:#1F497D"><br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">PhD Research Scholar</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Remote Sensing and Satellite Research Group</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Department of Imaging and Applied Physics<br>
Curtin University<br>
</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#1F497D">Curtin University<br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Tel |</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#1F497D"> </span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#1F497D">+61
8 9266 7962</span><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><span style="font-size:7.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Fax |</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#1F497D"> </span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#1F497D">+61
8 9266 2377<br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Mobile |</span><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#1F497D">0470 237 525</span><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> <br>
<br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Email |</span><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><span style="color:#212121"><a href="mailto:m.lynch@curtin.edu.au" target="_blank" id="LPNoLP"><span style="font-size:9.0pt;font-family:"Arial","sans-serif"">m.mughal1@postgrad.curtin.edu.au</span></a></span><span style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#1F497D"> <br>
</span><span style="font-size:9.0pt;font-family:"Arial Bold","serif";color:#AB8303">Web |</span><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#AB8303"> </span><span style="color:#212121"><a href="http://curtin.edu.au/" target="_blank" id="LPNoLP"><span style="font-size:9.0pt;font-family:"Arial","sans-serif"">http://curtin.edu.au</span></a></span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:6.0pt;font-family:"Arial","sans-serif";color:#1F497D">Curtin University is a trademark of Curtin University of Technology. </span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:6.0pt;font-family:"Arial","sans-serif";color:#1F497D">CRICOS Provider Code 00301J (WA), 02637B (NSW)</span><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:11.5pt;font-family:"Segoe UI","sans-serif";color:#212121"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> Mary Haley <<a href="mailto:haley@ucar.edu">haley@ucar.edu</a>><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</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal">Muhammad,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">For plotting WRF data, I recommend visiting this page:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/wrf.shtml">http://www.ncl.ucar.edu/Applications/wrf.shtml</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">As that first box points, out, you can use wrf_user_getvar:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><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><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">to calculate various diagnostics and/or read variables. It has some examples, including how to read 2m temperature (in degK):<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> t2 = wrf_user_getvar(f,"T2",-1) ; read 2m temp across all time steps<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">To regrid the data using ESMF, this involves interpolation, which you may or may not want.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">See example ESMF_regrid_20.ncl at:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex20">http://www.ncl.ucar.edu/Applications/ESMF.shtml#ex20</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This goes from a WRF grid to another WRF grid, but the main change you need to make is to the "lat_src" and "lon_src" variables, which represent your source grid. These will need to be set the observational lat/lon 1D arrays in your case. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><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><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Finally, you may also want to visit the "gridding random data" page:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><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><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Good luck,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">--Mary<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="gmail-p2"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Jul 12, 2017 at 6:50 PM, Muhammad Omer Mughal <<a href="mailto:m.mughal1@postgrad.curtin.edu.au" target="_blank">m.mughal1@postgrad.curtin.edu.au</a>> wrote:<o:p></o:p></p>
<div>
<p class="MsoNormal">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 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 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:+61%208%209266%207962" target="_blank">+61 8 9266 7962</a><br>
Fax | <a href="tel:+61%208%209266%202377" target="_blank">+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.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>
<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><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" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<br clear="both">
**************************************************************************<BR>
The information contained in the EMail and any attachments is confidential and intended solely and for the attention and use of the named addressee(s). It may not be disclosed to any other person without the express authority of Public Health England, or the intended recipient, or both. If you are not the intended recipient, you must not disclose, copy, distribute or retain this message or any part of it. This footnote also confirms that this EMail has been swept for computer viruses by Symantec.Cloud, but please re-sweep any attachments before opening or saving. http://www.gov.uk/PHE<BR>
**************************************************************************<BR>
</body>
</html>