<div dir="ltr"><div>There are many things that just don&#39;t add up for me. The code you originally posted 100 time (?months?) steps. The model data shows 1800 months while the NCEP Reanalysis had 748  months. You said you wanted &quot;seasonal (DJF) Taylor diagrams&quot; ....  so 1800/12=150 years (150 DJF) and the NCEP has 742/12=62.3 years (62 DJS). I am no sure where you get 100 time steps.<br></div><div><br></div>The code you posted indicate<br><div><div><br>ncl 0&gt; f = addfile(&quot;T2M2.nc&quot;,&quot;r&quot;)<br>ncl 1&gt; T2 = f-&gt;TREFHT<br>ncl 2&gt; printVarSummary(T2)<br><br>Variable: T2<br>Dimensions and sizes:    [time | 1800] x [lat | 96] x [lon | 144]        ==&gt; #years= 1800/12=150 years ==&gt; 150 DJF<br>Coordinates: <br>            time: [  31..54750]<br>            lat: [ -90..  90]                   &lt;================ CAM: CESM   ... South-to-North<br>            lon: [   0..357.5]<br><br><br>ncl 5&gt; g = addfile(&quot;<a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a>&quot;,&quot;r&quot;)<br>ncl 6&gt; print(g)                      <wbr>     <br>ncl 7&gt; air = short2flt(g-&gt;air)<br>ncl 8&gt; printVarSummary(air)<br><br>Variable: air<br>Dimensions and sizes:    [time | 748] x [level | 17] x [lat | 73] x [lon | 144]    ==&gt; #years = 748/12=62.3  ==&gt; 62 DJF<br>Coordinates: <br>            time: [17067072..17612736]<br>            level: [1000..10]<br>            lat: [90..-90]                   &lt;============== NCEP: North-to-South<br>            lon: [ 0..357.5]<br><br>========================<br></div><div>Further, the linint2 documentation states &quot;...  <i>nyi</i>
subsection of <i>yi</i> must be monotonically increasing,&quot;. The &#39;yi&#39; are the latitudes. Again, the code you posted did not show that you made the NCEP Reanalysis increasing.<br><br></div><div>I have no idea why you you are interpolating to a 5 degree grid. Why not interpolate to the 2.5 grid<br><br><br> f = addfile(&quot;T2M2.nc&quot;,&quot;r&quot;)<br> T2 = f-&gt;TREFHT<br>  printVarSummary(T2)           <wbr>   ; 1800 time steps<br><br> g = addfile(&quot;<a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a>&quot;,&quot;r&quot;)<wbr>                           <br> air = short2flt(g-&gt;air(:,0,:,:)     <wbr>  ; 1000 mb only<br> printVarSummary(air)         <wbr>      ; **look** at &#39;lat&#39;   90 to -90   North-to_south<br> <br></div><div> air = air(:,::-1,:)                          ; make latitudes monotonically increasing (NCL syntax)<br></div><div> printVarSummary(air)         <wbr>      ; **look** at &#39;lat&#39;   -90 to 90  South-to-North<br></div><div>                              <wbr>                    ; you have 748 time steps<br><br>----<br></div><div><br></div><div>Note: These must have the same # of time steps *if* you have a time timension.<br><br></div><div>  t2 = linint2_Wrap(T2&amp;lon, T2&amp;lat, T2, True,  air&amp;lon, air&amp;lat, 0)<br></div><div>  printVarSummary(t2)           <wbr>    ; 1880 time steps<br></div><div>                              <wbr>                    <br><br></div><div>Goos Luck<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 1, 2017 at 11:57 PM, Sri Nandini <span dir="ltr">&lt;<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>The files are on the ftp server except <a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a><br><br>I get these errors when uploading:<br>local: <a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a> remote: <a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a><br>227 Entering Passive Mode (128,117,23,220,192,5).<br>553 Could not create file.<br>the file <a href="http://air.mon.mean.nc" target="_blank">air.mon.mean.nc</a> can be found here:<br><a href="https://www.esrl.noaa.gov/psd/data/gridded/data.ncep.reanalysis.derived.pressure.html" target="_blank">https://www.esrl.noaa.gov/psd/<wbr>data/gridded/data.ncep.<wbr>reanalysis.derived.pressure.<wbr>html</a><br><br>Thank you.<div><div class="h5"><br><br>On Mar 1, 2017 4:10:20 PM, Dennis Shea wrote:
<br><blockquote class="m_1570105363748306220felamimail-body-blockquote"><div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">re:<br>fo = linint2(airw&amp;lon,airw&amp;lat,<wbr>airw(time|:,lat|:,lon|:), True, LON, LAT, 0)<br></span>Which gives an error:<br>warning:linint2: xi, yi, xo, and yo must be monotonically increasing<br>====<br><br></span></div><span style="font-size:12.8px">In your 1st post you had<br><br></span><pre>  lon = (0., 2.8125, .... , 357,0125)   &lt;== ?typo?  357.0125  ??
  lat = (-87.8638, ... ,87.8638)

  LON = (0., 2.5, ... , 357.5)    ; length 144
  LAT = (-90.,87.5,...90.)        ; length 73</pre><br></div>If the <span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">print(airw&amp;lon) and  </span></span><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">print(airw&amp;lat) are increasing then I am not sure what the problem is.<br><br></span></span></div><div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">Really bi-linear interpolation is pretty simple.<br></span></span></div><div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im"><br>===<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">Why are you use &#39;escorc&#39; rather that &#39;pattern_cor&#39; ?<br><br>===<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">You can send a *minimal, clean script* and the necessary files to<br><br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">ftp <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a><br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">anonymous<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">your_email<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">cd incoming<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">put ...<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">put ...<br></span></span></div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im">quit<br></span></span><div><div><span style="font-size:12.8px"><span class="m_1570105363748306220m_-7371670227610761531gmail-im"><br></span></span></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 1, 2017 at 12:09 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="m_1570105363748306220felamimail-body-blockquote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>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"><span>fo = linint2(airw&amp;lon,airw&amp;lat,<wbr>airw(time|:,lat|:,lon|:), True, LON, LAT, 0)<br></span>Which gives an error:<br>warning:linint2: xi, yi, xo, and yo must be monotonically increasing<br><br>My airw= [100 360 720]  ;observed temp<br>My t2mw= [100 96 144]  &#39; 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> <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<div><div class="m_1570105363748306220h5"><br><br>On Feb 28, 2017 7:36:15 PM, Adam Phillips wrote:
<br><blockquote class="m_1570105363748306220felamimail-body-blockquote"><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&amp;lon,t2mw&amp;lat,<wbr>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,<wbr>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,<wbr>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="m_1570105363748306220felamimail-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>   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_1570105363748306220felamimail-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&#39;t have the time to <span class="m_1570105363748306220m_3563928672969537207m_-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">&lt;<a href="mailto:snandini@marum.de" target="_blank">snandini@marum.de</a>&gt;</span> wrote:<br><blockquote class="m_1570105363748306220felamimail-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-&gt;t2mw(0,0,:,{0:360}); remove cyclic point<br>  lon = f-&gt;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&amp;lat,<wbr>t2mw,True,newlon,newlat,0)</div><br>  newt2mw!0   =&quot;lat&quot;<br>  newt2mw!1   = &quot;lon&quot;<br>  newt2mw&amp;lat = newlat<br>  newt2mw&amp;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|:) )    ; ==&gt; rmsdTime(nlat,nlon)<br><br>    ;rmsdTime = dim_rmsd_n( x, y, 0 )                             <wbr>          ; ==&gt; 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" 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><br style="clear:both"><div><br></div>-- <br><div class="m_1570105363748306220m_3563928672969537207gmail_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,  </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/<wbr>asphilli/</a>   </span></span><span><span style="color:#888888"><a>303-497-1726</a> </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></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="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></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>