Subtracting running mean

From: Abhik Santra <abhiksantra_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 05 2013 - 11:22:53 MDT

Dear NCL-users,

I am subtracting previous 120-day running mean from an array (ntim x nlat x mlon).
My script is as follows:

dimx = dimsizes( work )
ntim = dimx(0)
data = new((/ntim-120,nlat,mlon/),typeof(work),getFillValue(work))

do i=120,ntim-1
    data(i,:,:) = work(time|i,lat|:,lon|:)-dim_avg_n_Wrap(work(time|i-120:i-1,lat|:,lon|:),0)
end do

This line is giving an error as:
fatal:Subscript out of range, error in subscript #0

Where is the error in this code sequence?
Can you please let me know?
Thanks in advance.


Abhik Santra
CSIR Research Fellow,
Indian Institute of Tropical Meteorology,
Pune - 411008.
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Fri Jul 5 11:38:53 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 05 2013 - 13:06:49 MDT