cumulative sum

From: Sijikumar S <sijikumar_at_nyahnyahspammersnyahnyah>
Date: Thu, 15 Feb 2007 09:39:56 +0100

Hi,
Is there any function to calculate cumulative sum of variable. I would like
to avoid the following loop.

; loop to compute cumulative sum of number of days
tm=new(dimsizes(month),"integer")
a=0
do i=0,nmonth-1
    tm(i)=month(i)+a
    a=tm(i)
end do

Thanks,
Siji

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 15 2007 - 01:39:56 MST

This archive was generated by hypermail 2.2.0 : Thu Feb 22 2007 - 14:54:01 MST