<div dir="ltr">Hi Sri,<div>The error message is telling you what the issue is: </div><div><span style="font-size:12.8px">fatal:linint2: The rightmost dimensions of fi must be nyi x nxi, where nyi and nxi are the lengths of yi and xi respectively</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">fi is your input array, and the error message is saying that the rightmost dimensions of fi must be equal to the sizes of the lon and lat arrays that you pass in. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thus, if you pass in your t2mw array to linint2 like this:</span></div><div><span style="font-size:12.8px">fo = linint2(t2mw&lon,t2mw&lat,t2mw, True, LON, LAT, 0)</span></div><div><span style="font-size:12.8px">should work as lon and lat are the 2 rightmost dimensions of t2mw. However, if you pass in your airw array:</span></div><div><span style="font-size:12.8px">fo = linint2(airw&lon,airw&lat,airw, True, LON, LAT, 0)</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">You will get the referenced error message as time is the rightmost dimension in airw. The solution is to reorder the dimensions in airw:</span></div><div><span style="font-size:12.8px">fo = linint2(airw&lon,airw&lat,airw(time|:,lat|:,lon|:), True, LON, LAT, 0)</span><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Hope that helps. If you have any further questions please respond to the ncl-talk email list and not to me personally.</span></div><div><span style="font-size:12.8px">Adam</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 28, 2017 at 8:43 AM, Sri Nandini <span dir="ltr"><<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Thank you<br><br>So i have cleaned out the commented statements, and the errors i am getting are these:<br><br>fatal:linint2: The rightmost dimensions of fi must be nyi x nxi, where nyi and nxi are the lengths of yi and xi respectively<br><br><div> printVarSummary(t2mw)<br>Dimensions and sizes: [time | 100] x [lat | 192] x [lon | 288]<br></div><div> printVarSummary(airw)<br>Dimensions and sizes: [lat | 62] x [lon | 162] x [time | 100]<br></div><div>It stops at the interpolation stage before even coming to the correlation section. <br></div>Basically i am unsure of my interpolation method between observations and model output data.<br><br>On Feb 24, 2017 4:28:11 PM, Dennis Shea wrote:
<br><blockquote class="m_-4630897593412996578felamimail-body-blockquote"><div dir="ltr"><div><div><div><div><div><div>I started to look at your code. However, it has lots of commented statements and, to me, it is not clear what is happening. Really, you should send only clean scripts. We like to help but we don't have the time to <span class="m_-4630897593412996578gmail-st">decipher codes.</span><br><br></div>The commented<br><br> ;cor1 = dim_avg_n_Wrap(pattern_cor( t2mw, airw, clat, 0), 0)<br><br></div>contains <br> <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/pattern_cor.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Document/Functions/<wbr>Contributed/pattern_cor.shtml</a><br><br>What is wrong with the following:<br><br></div><div> printVarSummary(t2mw)<br></div><div> printVarSummary(airw)<br></div><div><br> pcor = pattern_cor( t2mw, airw, clat, 0)<br></div><div> print(pcor)<br></div><div> <br></div></div></div></div><div> <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 23, 2017 at 9:03 AM, Sri Nandini <span dir="ltr"><<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>></span> wrote:<br><blockquote class="m_-4630897593412996578felamimail-body-blockquote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Dear NCL community,<br>Greetings!<br><br>I am trying to plot seasonal (DJF) Taylor diagrams and have errors in interpolation my datasets on same grid.<br>(a) read 2 data sets with different resolutions and regrid
(modelled and obs temperature for a test)<br>(b) calculate a pattern correlation
<br><br>My script is attached below ::<br><br>;=============================<div>==============================<wbr>=======<br>;Taylor diagram calculations<br>;=============================<wbr>=== interpolation onto common grid (of observational data)<br>;ncl pattern_cor between different size arrays<br> t2mw = f->t2mw(0,0,:,{0:360}); remove cyclic point<br> lon = f->lon({0:360})<br>;*****************************<wbr>*******************<br>; interpolate to new grid<br>;*****************************<wbr>******************<br> newlat = fspan(-60.,60,24)<br> newlon = fspan(0.,355.,72)<br><br> newt2mw = linint2_Wrap(lon,t2mw&lat,<wbr>t2mw,True,newlon,newlat,0)</div><br> newt2mw!0 ="lat"<br> newt2mw!1 = "lon"<br> newt2mw&lat = newlat<br> newt2mw&lon = newlon<br>;=============================<div>==============================<wbr>===========centered Pattern correlation (coslat weighting has been done previously above)<br>re=escorc(airw,newt2mw)<br> ;cor1 = dim_avg_n_Wrap(pattern_cor( t2mw, airw, clat, 0), 0);rc = pattern_cor(x, y,gw, 0) ; gaussian weighting, centered<br> mmd= (/cor1/)<br> printVarSummary(mmd)<br>;=============================<wbr>===Standard deviation ;=============================<wbr>===<br><br>;pre0_Std = dim_avg_n_Wrap( dim_stddev_n_Wrap( t2mw, (/1,2/)), 0)<br> ;std1 = dim_rmsd_Wrap(airw,t2mw, 0);computes rootmean square difference<br>;std1 = dim_rmsd_n(t2mw, airw, 0);<br> std1 = dim_rmsd( t2mw(lat|:,lon|:,time|:), airw(lat|:,lon|:,time|:) ) ; ==> rmsdTime(nlat,nlon)<br><br> ;rmsdTime = dim_rmsd_n( x, y, 0 ) <wbr> ; ==> no reordering needed<br>==============================<wbr>==============================<wbr>====<br></div>I had a look at other interpolation functions for correlations between different grids such a s:<br><p>
Assume <em>fi</em> is a 4D array dimensioned <em>ntim</em> x
<em>nlvl</em> x <em>nlat</em> x <em>mlon</em> (<em>ntim</em>=50,
<em>nlvl</em>=30, <em>nlat</em>=64, <em>mlon</em>=128), and that
the
rightmost dimension is to be treated as cyclic (the user should
not
add a cyclic point for the rightmost dimension).</p>
<p>
All times and levels will be interpolated and returned in a new
array
<em>fo</em> dimensioned <em>ntim</em> x <em>nlvl</em> x <em>73</em>
x
<em>144</em>:
</p>
<pre> lon = (0., 2.8125, .... , 357,0125)
lat = (-87.8638, ... ,87.8638)
LON = (0., 2.5, ... , 357.5) ; length 144
LAT = (-90.,87.5,...90.) ; length 73
fo = <strong>linint2_Wrap</strong> (lon,lat,fi, True, LON,LAT, 0)
</pre>Error: <br><br style="clear:both">Deeply appreciated<br></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="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br><br></blockquote></div><br></div>
</blockquote><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><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a> </font></span><span><font color="#888888">303-497-1726 </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="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></font></span></div></div></div></div></div></div></div></div></div></div></div>
</div>