<div dir="ltr"><div><div>The previous response is correct.<br><br></div>However, I just added a &#39;workaround example ( Example 3 ) to <br><br><a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/spcorr_n.shtml">http://www.ncl.ucar.edu/Document/Functions/Built-in/spcorr_n.shtml</a><br><br></div>Please see if that addresses the issue.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 3:55 AM, Jack Ogaja <span dir="ltr">&lt;<a href="mailto:jack.ogaja@gmail.com" target="_blank">jack.ogaja@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">The function “spcorr()” require arguments of the same size. From your description, the statements &quot;sst = asciiread(&quot;sst&quot;,-1,&quot;float&quot;) “ and &quot;p = f-&gt;rf(:,{10:30},{60:81})” will give you arrays of sizes “d1” and “d1xd2xd3” (or 1-dimensional and 3-dimensional arrays) respectively.<div><br></div><div>Jack</div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On 12 Feb 2016, at 04:19, Jothi Ganesh Shanmuga Sundaram &lt;<a href="mailto:joshanmugasundaram@mix.wvu.edu" target="_blank">joshanmugasundaram@mix.wvu.edu</a>&gt; wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr"><div><div>Hello,<br><br>I would like to calculate spearman correlation between a variable in a text file (annual SST time series) with another variable in gridded netcdf file (annual rainfall time series). I want to calculate correlation for every grid in the rainfall data with the same time series of SST in a text file. I try something like below and not successful. Is this possible to do in NCL? Please advice.<br><br><br>; text file with SST time series - one column of data, for example annual SST 1981 to 2010, 30 time step - 30 rows in text file<br>sst = asciiread(&quot;sst&quot;,-1,&quot;float&quot;) <br><br>; gridded netcdf file - annual precipitation over globe for the period 1981-2010. which means every grid will have 30 time step<br>f = addfile(&quot;<a href="http://rf.nc/" target="_blank">rf.nc</a>&quot;,&quot;r&quot;)                <br>p = f-&gt;rf(:,{10:30},{60:81})            ; Define precipitation variable<br><br>; Calculate spearman correlation<br>cor =spcorr(p,sst)  <br><br><br></div>Thanks<br></div>Jothi<br></div></div></div>
_______________________________________________<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></div></blockquote></div><br></div></div><br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>