regional average

From: <cluo_at_nyahnyahspammersnyahnyah>
Date: Mon, 13 Aug 2007 17:07:05 -0700 (PDT)

Dear NCLers,

I am trying to plot time series of regional average. I have three
dimensional data like data(ntim, nlat,nlon), and I want to do average from
region 30-40N and 150E-140W. I use the script like:

 data_time = new ((/ntim/),typeof(data), getFillValue(data))
 n = 0
 do ilat = 0, nlat-1
 do ilon = 0, mlon-1
 if (lat(ilat).ge.30.and.lat(ilat).le.40.) then
 if (lon(ilon).ge.150.and.lon(ilon).le.220.) then
 if (.not.ismissing(data(:,ilat,ilon))) then
 data_time(:) =data(:,ilat,ilon)
 n = n + 1
 end if
 end if
 end if
 end do
 end do
 data_time(:) =data_time(:)/n

This script runs too slow. I am wondering if there are some functions can
be used to do regional average.

Thanks for any information!

Chao

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 13 2007 - 18:07:05 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 16 2007 - 09:43:43 MDT