<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>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="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, 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="gmail-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/Document/Functions/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="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
(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> t2mw = f->t2mw(0,0,:,{0:360}); remove cyclic point<br> lon = f->lon({0:360})<br>;************************************************<br>; interpolate to new grid<br>;***********************************************<br> newlat = fspan(-60.,60,24)<br> newlon = fspan(0.,355.,72)<br><br> newt2mw = linint2_Wrap(lon,t2mw&lat,t2mw,True,newlon,newlat,0)</div><br> newt2mw!0 ="lat"<br> newt2mw!1 = "lon"<br> newt2mw&lat = newlat<br> newt2mw&lon = newlon<br>;=============================<div>=========================================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>;================================Standard deviation ;================================<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 ) ; ==> 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></body></html>