<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">The function “spcorr()” require arguments of the same size. From your description, the statements "sst = asciiread("sst",-1,"float") “ and "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 class=""><br class=""></div><div class="">Jack</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 12 Feb 2016, at 04:19, Jothi Ganesh Shanmuga Sundaram &lt;<a href="mailto:joshanmugasundaram@mix.wvu.edu" class="">joshanmugasundaram@mix.wvu.edu</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><div class="">Hello,<br class=""><br class="">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 class=""><br class=""><br class="">; 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 class="">sst = asciiread("sst",-1,"float") <br class=""><br class="">; gridded netcdf file - annual precipitation over globe for the period 1981-2010. which means every grid will have 30 time step<br class="">f = addfile("<a href="http://rf.nc/" class="">rf.nc</a>","r")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br class="">p = f-&gt;rf(:,{10:30},{60:81})&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Define precipitation variable<br class=""><br class="">; Calculate spearman correlation<br class="">cor =spcorr(p,sst)&nbsp; <br class=""><br class=""><br class=""></div>Thanks<br class=""></div>Jothi<br class=""></div>
_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></div></body></html>