<div dir="ltr"><div><div><div><div><div><div><div><div>Here are the details of my code:-<br></div>1) I am writing a code to calculate decadal monthly mean from the matrix called air(all india rainfall) and it is a 133 X 12 matrix<br>
</div><br></div>***********************************************************<br>The errors are as follows:-<br><br></div>fatal:Subscript out of range/error in subscript #0<br></div>fatal:["Excute.c":8128]:Execute :Error occurred at or near line 39 in file decadal_mean_air.ncl<br>
<br>*************************************************************<br><br></div>Here is the program:-<br><br>;Calculating decadal mean<br><br>;This is to read in the all india rainfall and to plot them<br><br><br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
<br>ncol = 12<br>nrows=133<br><br>air=readAsciiTable("~/Documents/PhD_June_2015/Data_AIR/air.txt", ncol, "integer",2)<br>y=dimsizes(air)<br>print(y)<br><br>;ya = dim_avg_n(air,1) ;yearly average <br>
<br><br>;This is for yearly decadal mean<br><br>yearly_decadal = new( dimsizes(ya)/10, float) ;;; assumes ya%10 is 0. if not end indices will be ignored.<br><br><br>ct = 0<br>do i=0, dimsizes(ya)-10, 10 ; loop from 0 to max length of array and step by 10<br>
yearly_decadal(ct) = avg( ya(i:i+9) )<br>ct = ct+1<br>end do<br>print(yearly_decadal)<br><br>;This is for monthly decadal mean<br>;This is a two dimensional matrix<br><br>mda=new((/13,12/),"float"); mda=monthly decadal average<br>
<br>do i=0, 133-10,10 <br><br>do j=0,11<br><br>re(i,j)=dim_avg_n(air(i:i+9,j),0)<br><br>end do<br>end do<br>********************************************************************<br><br></div>Can you help me with this<br><br>
Thanking you in advance<br></div>Best Regards<br>Ipshita<br><div><div><br><br><div><br></div></div></div></div>