<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title><style type="text/css">.felamimail-body-blockquote {margin: 5px 10px 0 3px;padding-left: 10px;border-left: 2px solid #000088;} </style></head><body>Hello<br><br>Thank you.<br><br>Im still at the interpolation stage of the script, what i wish to do is change the model temperature grid (lat,lon) same to my observational temperature.<br>To do that i followed:<br><div><span style="font-size:12.8px;">fo = linint2(airw&amp;lon,airw&amp;lat,airw(time|:,lat|:,lon|:), True, LON, LAT, 0)<br>Which gives an error:<br>warning:linint2: xi, yi, xo, and yo must be monotonically increasing<br><br>My airw= [100 360 720]&nbsp; ;observed temp<br>My t2mw= [100 96 144]&nbsp; ' cesm modelled temp<br><br>My fo= [100 360 720] but the error comes when i apply the corr for taylor diag:<br>error: fatal:escorc: The last dimension of x must be equal to the last dimension of y<br>&nbsp;<br>My code for corr is: re=escorc(airw,fo) where both datasets now have same grid.<br><br>Would anyone have a sample code to share if they were successful in running a taylor diagram after interpolating the datasets please? and applied centered corr and rsmd?<br></span><span style="font-size:12.8px;"></span></div>Deeply appreciated<br><br>On Feb 28, 2017 7:36:15 PM, Adam Phillips wrote:
<br><blockquote class="felamimail-body-blockquote"><div dir="ltr">Hi Sri,<div>The error message is telling you what the issue is:&nbsp;</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.&nbsp;</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&amp;lon,t2mw&amp;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&amp;lon,airw&amp;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&amp;lon,airw&amp;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">&lt;<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>&gt;</span> wrote:<br><blockquote class="felamimail-body-blockquote" 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>&nbsp;&nbsp; printVarSummary(t2mw)<br>Dimensions and sizes:&nbsp;&nbsp;&nbsp; [time | 100] x [lat | 192] x [lon | 288]<br></div><div>&nbsp;&nbsp; printVarSummary(airw)<br>Dimensions and sizes:&nbsp;&nbsp;&nbsp; [lat | 62] x [lon | 162] x [time | 100]<br></div><div>It stops at the interpolation stage before even coming to the correlation section. &nbsp; <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="felamimail-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,&nbsp; it is not clear what is happening. Really, you should send only clean scripts. We like to help but we&nbsp; don't have the time to <span class="m_-4630897593412996578gmail-st">decipher codes.</span><br><br></div>The commented<br><br>&nbsp; ;cor1 = dim_avg_n_Wrap(pattern_cor( t2mw, airw, clat, 0), 0)<br><br></div>contains <br>&nbsp;&nbsp; <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/pattern_cor.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Contributed/pattern_cor.shtml</a><br><br>What is wrong with the following:<br><br></div><div>&nbsp;&nbsp; printVarSummary(t2mw)<br></div><div>&nbsp;&nbsp; printVarSummary(airw)<br></div><div><br>&nbsp;&nbsp; pcor = pattern_cor( t2mw, airw, clat, 0)<br></div><div>&nbsp;&nbsp; print(pcor)<br></div><div>&nbsp; <br></div></div></div></div><div>&nbsp;&nbsp; <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">&lt;<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>&gt;</span> wrote:<br><blockquote class="felamimail-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&nbsp;
(modelled and obs temperature for a test)<br>(b) calculate a pattern correlation
<br><br>My script is attached below ::<br><br>;=============================<div>=====================================<br>;Taylor diagram calculations<br>;================================ interpolation onto common grid (of observational data)<br>;ncl pattern_cor between different size arrays<br>&nbsp;t2mw = f-&gt;t2mw(0,0,:,{0:360}); remove cyclic point<br>&nbsp; lon = f-&gt;lon({0:360})<br>;************************************************<br>; interpolate to new grid<br>;***********************************************<br>&nbsp; newlat = fspan(-60.,60,24)<br>&nbsp; newlon = fspan(0.,355.,72)<br><br>&nbsp;newt2mw = linint2_Wrap(lon,t2mw&amp;lat,t2mw,True,newlon,newlat,0)</div><br>&nbsp; newt2mw!0&nbsp;&nbsp; ="lat"<br>&nbsp; newt2mw!1&nbsp;&nbsp; = "lon"<br>&nbsp; newt2mw&amp;lat = newlat<br>&nbsp; newt2mw&amp;lon = newlon<br>;=============================<div>=========================================centered Pattern correlation (coslat weighting has been done previously above)<br>re=escorc(airw,newt2mw)<br>&nbsp;;cor1 = dim_avg_n_Wrap(pattern_cor( t2mw, airw, clat, 0), 0);rc = pattern_cor(x, y,gw, 0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; gaussian weighting, centered<br>&nbsp;mmd= (/cor1/)<br>&nbsp;printVarSummary(mmd)<br>;================================Standard deviation ;================================<br><br>;pre0_Std = dim_avg_n_Wrap( dim_stddev_n_Wrap( t2mw, (/1,2/)), 0)<br>&nbsp;;std1 = dim_rmsd_Wrap(airw,t2mw, 0);computes rootmean square difference<br>;std1 = dim_rmsd_n(t2mw, airw, 0);<br>&nbsp;&nbsp;&nbsp; std1 = dim_rmsd( t2mw(lat|:,lon|:,time|:), airw(lat|:,lon|:,time|:) )&nbsp;&nbsp;&nbsp; ; ==&gt; rmsdTime(nlat,nlon)<br><br>&nbsp;&nbsp;&nbsp; ;rmsdTime = dim_rmsd_n( x, y, 0 )&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; ==&gt; no reordering needed<br>================================================================<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>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br><br></blockquote></div><br></div>
</blockquote><br></div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br><br></blockquote></div><br><br style="clear:both;"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span><span style="color:#888888;">Adam Phillips <br></span></span></div><span><span style="color:#888888;">Associate Scientist,&nbsp; </span></span><span><span style="color:#888888;">Climate and Global Dynamics Laboratory, NCAR<br></span></span></div></div><div><span><span style="color:#888888;"><a href="http://www.cgd.ucar.edu/staff/asphilli/" target="_blank">www.cgd.ucar.edu/staff/asphilli/</a>&nbsp;&nbsp; </span></span><span><span style="color:#888888;">303-497-1726 </span></span></div><span><span style="color:#888888;"></span></span><div><div><span><span style="color:#888888;"><br></span></span><div><span><span style="color:#888888;"><a href="http://www.cgd.ucar.edu/staff/asphilli" target="_blank"></a></span></span></div></div></div></div></div></div></div></div></div></div></div>
</div>
</blockquote><br></body></html>