<div dir="ltr"><div>Dear all,<br><br></div>I want to calculate running correlation for All India Rainfall and I am not able to use run_cor because the time dimension does not make sense for me. I wrote a loop but I get the same value for all the period. There is no error in the code output. I am not sure where i am going wrong. It will be great if someone can help<br><br><div><div><br><br>;This is to get a 15 and 20 year running correlation for JJAS<br><br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl&quot;<br>load &quot;$NCARG_ROOT/lib/ncarg/nclscripts/contrib/run_cor.ncl&quot;<br><br><br>ncol = 12<br>nrows=133<br><br>;Reading in the data from 1871 to 2012<br><br>air=readAsciiTable(&quot;~/Documents/PhD_June_2015/Data_AIR/air_1871_2012.txt&quot;, ncol, &quot;integer&quot;,2)<br><br>;Extracting Indian summer monsoon months<br><br>JJAS=air(:,7:10)<br><br>JJAS_avg=dim_avg_n(JJAS,1) <br>;print(dimsizes(JJAS_avg))<br><br>years=air(:,1)<br><br><br>;This is running correlation for 15 years<br><br>  yrStrt  = 1871     <br>  yrLast  = 2012<br><br>  nmos    = 12<br>  nyrs    = yrLast-yrStrt+1<br>  n_15 = nyrs/15 <br><br>  running_correlation_15=new(n_15,&quot;float&quot;)<br><br>    do nyr=0,(15*n_15)-1,15<br>     nyrStrt = nyr         ; clarity<br>     nyrLast = nyrStrt+14<br>     running_correlation_15(nyr/15) = escorc(years,JJAS_avg )<br>   <br>  end do<br>print(running_correlation_15)<br><br><br></div></div></div>