speed up maxind loop?

From: Axel Seifert <Axel.Seifert_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 17 2010 - 07:57:57 MST

Hi NCL folks:

I am using maxind and minind to measure cloud depth in CRM data. This
works fine, but it is kind of slow. Unfortunately, maxind and minind do
not support multidimensional arrays. There is no dim_maxind_n available,
is there?

This is the loop that I want to speed up (I have some TB of data to analyze):

      print(" calculate convective cloud depth (please be patient, this can be slow)")
      do i=0,xdim-1
        do j=0,ydim-1

; find maximum of vertical velocity in the updraft
          kwmax(j,i) = maxind(w(:,j,i))

          if (.not.ismissing(kwmax(j,i))) then
; find cloud top and cloud base starting from max updraft position
            ktop(j,i) = kwmax(j,i) - minind(cwc(kwmax(j,i):0,j,i) - 1e-6)
            kbase(j,i) = kwmax(j,i) + minind(cwc(kwmax(j,i):,j,i) - 1e-6)

; store geometric height of cloud base, top and depth
            zctop(j,i) = (/ z(ktop(j,i),j,i) /)
            zcbase(j,i) = (/ z(kbase(j,i),j,i) /)
            zcdepth(j,i) = (/ zctop(j,i) - zcbase(j,i) /)
          end if

        end do
      end do

Cheers, Axel

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 17 07:58:10 2010

This archive was generated by hypermail 2.1.8 : Wed Dec 22 2010 - 16:10:23 MST