<div dir="ltr"><div><div><div><div>Hello Manda,<br><br></div>[1] The following 'cheat' should <b><span style="color:rgb(255,0,0)">not</span> </b>be used<b>.  </b>Depending on your grid, this could lead to interpolation issues. Maybe that is the source of your problem!?!<br><br>  lon2d   = f->gridlon_0<br>  lat = lat2d(:,0)                    ; <=== left edge of grid<br>  lon = lon2d(0,:)                  ; <=== bottom edge of grd<br>===============<br><br></div>[2] I am not very familiar with 'ruc' files. I assume you are calculating the potential temperatures at each level because they are not available on the file. Correct? <br><br></div><div>   %> ncl_filedump   ruc....grb   | less<br></div><div>===============<br><br></div>[3] Cross section interpolation:<br><br></div><div>      [a] Use gc_latlon with the beginning and end locations to get the total distance. [ie: No do loop']<br><pre>GCDIST = <strong>gc_latlon</strong>(lat_cx(0),lon_cx(0),lat_cx(npts-1),lon_cx(npts-1),2,4) <br>print(GCDIST)  ; total great circle distance between beginning and end<br><br></pre><pre>   [b] Generate the lat and lon locations along the great cicle path.<br><br>gcdist = gc_latlon(lat_cx,lon_cx, lat_cx,lon_cx ,3,4)<br><br></pre><pre>print(gcdist)   ; *LOOK* at the output<br></pre><pre><br><b><strong>print</strong> </b>(gcdist@gclat+"  "+gcdist@gclon )   ; print the 'npts' [ cx ] locations<br><br></pre><pre>The gclat and gclon attributes are the locations to which you want to interpolate.<br></pre><pre>[4]  Although 'slow', use 'r<b>cm2points_Wrap</b>' to perform the interpolation to the desired cross-section locations.<br></pre></div><div><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml">https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml</a><br><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> <br></div><pre>   cx = <strong>rcm2points</strong> (lat2d, lon2d, x, gcdist@gclat, gcdist@gclon, 0)<br>   printVarSummary(cx)<br>   printMinMax(cx,0)<br><br></pre><pre>WHen you plot you will get locations like<br>  <b><a href="https://www.ncl.ucar.edu/Applications/Images/narr_5_3_lg.png">https://www.ncl.ucar.edu/Applications/Images/narr_5_3_lg.png</a></b><br></pre><pre><br>====================<b><br>***NOTE***<br></b></pre><pre><b>Sadly, there will be no lat/lon coordinate variables for the cross-section :-(<br>Happily, the byproduct will be that you will get the correct results!  :-)<br></b>=====================<b><br></b></pre><pre>There are other approaches. <br><br>For example, you could use ESMF regridding to interpolate the curvilinear RUC grid<br>to a rectilinear grid and then use 'ininnt2_points_Wrap'<br><br><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml">https://www.ncl.ucar.edu/Applications/ESMF.shtml</a><br><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml#ex30">https://www.ncl.ucar.edu/Applications/ESMF.shtml#ex30</a><br><br><a href="https://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml">https://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml</a><br><br><a href="https://www.ncl.ucar.edu/Applications/narr.shtml">https://www.ncl.ucar.edu/Applications/narr.shtml</a><br>See examples 5 and 6<br></pre><pre><br></pre><pre>Good luck<br></pre><div><div><div><br><div><br><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 29, 2017 at 9:04 AM, Chasteen, Manda B. <span dir="ltr"><<a href="mailto:manda.chasteen@ou.edu" target="_blank">manda.chasteen@ou.edu</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">
<div id="m_-3651816688407802956divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Adam,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thank you for the quick response. I checked what you suggested and the latitude and longitude arrays are of the same format. The issue is that the values seem to increase upon interpolation for whatever reason.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Manda</p><span class="">
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_-3651816688407802956Signature">
<div id="m_-3651816688407802956divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><b><span style="font-size:10pt">______________________________<wbr>______________________</span></b></p>
<p><b><span style="font-size:10pt">Manda Chasteen</span></b></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">Graduate Research Assistant</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">Cooperative Institute for Mesoscale Meteorological Studies</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">School of Meteorology</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">University of Oklahoma</span></p>
<span style="font-size:10pt"></span>
<p><u><span style="font-size:10pt"><a href="mailto:manda.chasteen@ou.edu" target="_blank">manda.chasteen@ou.edu</a></span></u></p>
<span style="font-size:10pt"></span>
<p><u><span style="font-size:10pt"><a href="mailto:manda.chasteen@noaa.gov" target="_blank">manda.chasteen@noaa.gov</a></span></u></p>
</div>
</div>
</span></div>
<hr style="display:inline-block;width:98%">
<div id="m_-3651816688407802956divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Adam Phillips <<a href="mailto:asphilli@ucar.edu" target="_blank">asphilli@ucar.edu</a>><br>
<b>Sent:</b> Wednesday, November 29, 2017 9:52:10 AM<br>
<b>To:</b> Chasteen, Manda B.<br>
<b>Cc:</b> <a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
<b>Subject:</b> Re: [ncl-talk] Issue using linint2_points</font>
<div> </div>
</div><div><div class="h5">
<div>
<div dir="ltr">Hi Manda,
<div>Make sure that the range of your lon/lat arrays match the range of your lon_cx/lat_cx arrays. Specifically, you are specifying -95 and -87 for your longitudes that go into lon_cx. When you call linint2_points:</div>
<div>rhint = linint2_points_Wrap(lon,lat,<wbr>rh,False,lon_cx,lat_cx,2)</div>
<div>you need to make sure that lon contains negative longitudes as well. (Similarly, you need to make sure the latitudes specified in lat_cx are within the range of latitudes in your lat array.)</div>
<div><br>
</div>
<div>Hope that helps. If not, or if you have any further questions please respond to the ncl-talk email list.</div>
<div>Adam</div>
</div>
<div class="m_-3651816688407802956x_gmail_extra"><br>
<div class="m_-3651816688407802956x_gmail_quote">On Tue, Nov 28, 2017 at 11:57 PM, Chasteen, Manda B. <span dir="ltr">
<<a href="mailto:manda.chasteen@ou.edu" target="_blank">manda.chasteen@ou.edu</a>></span> wrote:<br>
<blockquote class="m_-3651816688407802956x_gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-3651816688407802956x_m_404135538780652861divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0;margin-bottom:0">Hello,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am using the linint2_points_Wrap function in NCL version 6.4.0 to interpolate RUC data to a cross-section of lat/lons. The function is working; however, the values aren't quite right. I am wondering if you know why
 this may be and have a fix for this issue. </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I have attached the script, an example cross section plot, and screen shots of the printed values at the inflow point from the raw potential temperature field and that interpolated to this cross section (black contours). </p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_-3651816688407802956x_m_404135538780652861Signature">
<div id="m_-3651816688407802956x_m_404135538780652861divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif">
<p><b><span style="font-size:10pt">______________________________<wbr>______________________</span></b></p>
<p><b><span style="font-size:10pt">Manda Chasteen</span></b></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">Graduate Research Assistant</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">Cooperative Institute for Mesoscale Meteorological Studies</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">School of Meteorology</span></p>
<span style="font-size:10pt"></span>
<p><span style="font-size:10pt">University of Oklahoma</span></p>
<span style="font-size:10pt"></span>
<p><u><span style="font-size:10pt"><a href="mailto:manda.chasteen@ou.edu" target="_blank">manda.chasteen@ou.edu</a></span></u></p>
<span style="font-size:10pt"></span>
<p><u><span style="font-size:10pt"><a href="mailto:manda.chasteen@noaa.gov" target="_blank">manda.chasteen@noaa.gov</a></span></u></p>
</div>
</div>
</div>
</div>
<br>
______________________________<wbr>_________________<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="https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=OT__ZeTERsSHknu29rw_oqBkpfZqQbt7Y28v3NtReqg&e=" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_-3651816688407802956x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>
<div><span><font color="#888888">Adam Phillips <br>
</font></span></div>
<span><font color="#888888">Associate Scientist,  </font></span><span><font color="#888888">Climate and Global Dynamics Laboratory, NCAR<br>
</font></span></div>
</div>
<div><span><font color="#888888"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cgd.ucar.edu_staff_asphilli_&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=64dHcmEDeZlwmEuT8rIP-BYt_CFFuw9ralbyNY52jXw&e=" target="_blank">www.cgd.ucar.edu/staff/<wbr>asphilli/</a>  
</font></span><span><font color="#888888"><a href="tel:(303)%20497-1726" value="+13034971726" target="_blank">303-497-1726</a> </font></span></div>
<span><font color="#888888"></font></span>
<div>
<div><span><font color="#888888"><br>
</font></span>
<div><span><font color="#888888"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cgd.ucar.edu_staff_asphilli&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=Z6eoLXoa6FxwtAVQCHyCQ0Sa0U-ZCF_MVxT5_3HDW34&e=" target="_blank"></a></font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</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>