[ncl-talk] Error with loop
Ipshita Majhi
ipmajhi at alaska.edu
Mon Jul 28 14:55:37 MDT 2014
I am writing a loop to calculate mean every 10 indices and there is an
error towards the end of the loop. It would be great if you could help me
sort it out
;This is to create decadal mean
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
ncol = 12
nrows=134
air=readAsciiTable("~/Documents/PhD_June_2015/Data_AIR/air.txt", ncol,
"integer",2)
ya = dim_avg_n(air,1) ;yearly average
i=0
j=0
k=0
da=new(5,"float")
do while (i.le.133)
if (i/1.eq.1+j) then
da=dim_avg_n(ya(k:i),1)
k=k+10
j=j+1
continue
end if
i=i+1
end do
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140728/48280bd4/attachment.html
More information about the ncl-talk
mailing list