Don't know the structure of your variable(s) but you must add a level
loop
     do nf=0,nfil-1
[snip]
       do lev=0,nlev-1
          bin_sum(gbin(lev,:,:),gknt(lev,:,:),lon,lat   \
               ,ndtooned(lon2d), ndtooned(lat2d),ndtooned(x) )
       end do
On 05/08/2012 01:38 AM, Abhik Santra wrote:
>
>    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,
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May  8 11:27:35 2012
This archive was generated by hypermail 2.1.8 : Thu May 10 2012 - 16:57:50 MDT