Using bin_sum function for multiple level data

From: Abhik Santra <abhiksantra_at_nyahnyahspammersnyahnyah>
Date: Tue May 08 2012 - 01:38:40 MDT

  Hi,

      Can anybody suggest me the way to use the "bin_sum" function to sum the contributions of each swath having multiple levels. The output should also have (nlev,nlat,mlon) dimensions.

  I have initially started like this:

  gbin = new ( (/nlev,nlat,mlon/), float )
  gknt = new ( (/nlev,nlat,mlon/), integer)

  gbin = 0.0
  gknt = 0

  do nf=0,nfil-1
     print(nf+" "+fili(nf))
     f = addfile(diri+fili(nf), "r")
                                     ; read data
     x = f->$vNam$
     lat2d = short2flt( f-> geolocation(:,:,0) )
     lon2d = short2flt( f-> geolocation(:,:,1) )

     bin_sum(gbin,gknt,lon,lat \
            ,ndtooned(lon2d), ndtooned(lat2d),ndtooned(x) )

     delete(lat2d) ; may change for the next file
     delete(lon2d)
     delete( x )
  end do

  But "bin_sum" function considers lon and lat only, not the levels. How can I include that?
  
With regards,

-- 
Abhik Santra
CSIR Research Fellow,
Indian Institute of Tropical Meteorology,
Pune - 411008.
India
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 8 01:46:39 2012

This archive was generated by hypermail 2.1.8 : Thu May 10 2012 - 16:57:50 MDT