computing bivariate frequencies

From: <jmcphee_at_nyahnyahspammersnyahnyah>
Date: Mon, 07 Aug 2006 20:10:31 -0400

Hi All,

I'm trying to compute the joint pdf of two variables C and V stored in
arrays sized (ntime x nlat x nlon). In order to obtain the absolute
frequencies, I need to count the number of grid cells that fall within
arbitralily defined bins for each variable. Right now I'm attempting
this using a nested do loop, like:

   do ic=0,nbin_c-1

     do iv=0,nbin_v-1
             count_c_v(ic,iv)=num(ind(c.ge.c_bin(ic).and.c.lt.c_bin(ic+1).and.
                                   v.ge.v_bin(iv).and.v.lt.v_bin(iv+1)))
     end do

   end do

I was wondering if anybody would know how to code this more
efficiently on ncl, in order to avoid the nested loop.

Many thanks on advance,

James

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 07 2006 - 18:10:31 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 09 2006 - 08:25:35 MDT