<div dir="ltr"><div>I think wrote that example...... a LONG time ago.<br></div><div><br></div><div>Deep Background: Virtually all NCL examples were created based on user specified needs and files. What was done for one user may/may-not be ideal for another user. <br></div><div><br></div><div>[1]<br></div><div>The example you referenced used a <b>pre-existing ESMF weights file </b>created created via ESMF This weights file interpolated variables on NARR's curvilinear grid to a rectilinear grid. Subsequent use of existing weight file is extremely fast. [Basically, a sparse matrix multiply is used.]. <br></div><div><br></div><div><pre>;
;-[2] Interpolate to a rectilinear grid using existing weight file
; This returns lon=[150..358.5] because the original weight file returned this orientation.
;
var_regrid = <a href="http://www.ncl.ucar.edu/Document/Functions/ESMF/ESMF_regrid_with_weights.shtml" target="_blank"><b>ESMF_regrid_with_weights</b></a>(VarHgt,narrWgtPath,False)</pre></div><div><br></div><div>In this case, it was more convenient to create the rectilinear grid and the use <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml" target="_blank"><b><font size="2"><span style="font-family:arial,sans-serif">linint2_points_Wrap</span></font></b></a></div><div><br></div><div>====</div><div>[2] <br></div><div>A more direct approach would be <br></div><div><b> </b>(a) Open/read the NARR file [grib, netCDF, .... NCL does not care]</div><div> (b) Specify desired location(s)</div><div> (c) Use <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml" target="_blank"><b>rcm2points</b></a><br></div><div> (d) write text [ascii, CSV] file</div><div><br></div><div>Unfortunately, <b>rcm2points</b> is brute force. It is a bit slow and the crude search <b>must be repeated for each variable</b>.</div><div><br></div><div>[3] <br></div><div>You could use <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/region_ind.shtml"><b>region_ind</b></a> to isolate a region around your specified location(s) <br></div><div>and then pass the subregion to <b>rcm2points </b>. Likely, this could be <b>MUCH </b>faster than [2].</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 2, 2019 at 10:46 AM Jennifer Krauel via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'm new to NCL and have been studying all the reference material I can find. There are plenty of sample scripts, but many of them raise more questions than they answer. I'm hoping this is the best place to go for some answers.</div><div><br></div><div>I need to access data from NARR, but only from a single lat/long point. I need temperature and wind (U,V) at 100m intervals from 50m up to 3000m, which I'll export to a csv file. This sample script is close to what I need, except I need many more vertical points:<br></div><div><br></div><div><a href="https://www.ncl.ucar.edu/Applications/Scripts/narr_7.ncl" target="_blank">https://www.ncl.ucar.edu/Applications/Scripts/narr_7.ncl<font size="2"><span style="font-family:arial,sans-serif"><br></span></font></a></div><div><font size="2"><span style="font-family:arial,sans-serif"><br></span></font></div><div><font size="2"><span style="font-family:arial,sans-serif">The script first interpolates vertically (int2p_n_Wrap), then curvilinear to rectilinear (ESMF_regrid_with_weights), then to specific points (linint2_points_Wrap). <br></span></font></div><div><font size="2"><span style="font-family:arial,sans-serif"><br></span></font></div><div><font size="2"><span style="font-family:arial,sans-serif">Is there a reason for this order? Won’t it take a long time to do vertical interpolation on the whole file if I just want one point? I will need these data from the 3h intervals over about 9 months, so efficiency is going to matter. I found some information about using masks with ESMF weight files to reduce the area for regridding, so why not do that first and mask out all but an area around the desired point? And how big of an area would I need? I haven't found any actual scripts that do this explicitly for geographic subsetting, so I am not sure if it is a good idea. <br></span></font></div><div><font size="2"><span style="font-family:arial,sans-serif">
<span><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml" style="color:blue;text-decoration:underline" target="_blank">https://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br></span></span></font></div><div><br></div><div><font size="2"><span style="font-family:arial,sans-serif"><span></span>
</span></font></div><div>Thanks for any advice you can give me!</div><div>Jennifer<br></div><div><font size="2"><span style="font-family:arial,sans-serif"></span></font><span></span>
</div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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></blockquote></div>