loops questions

From: astroqing <astroqing_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 08 2013 - 01:11:21 MDT


I am trying to use a simple loop with NCL sentences as followed:

  indices = ind_resolve(ind(dbz11D.gt.40),dsizes_dbz1)
  cs(indices(:,0),indices(:,1)) = 1

With "printVarSummary(indices)", it shows that 25098 points in indices, but after "cs(indices(:,0),indices(:,1)) = 1", 202211 points has changed with 1. It is wrong.

But when I try to use the following sentences,

  indices = ind_resolve(ind(dbz11D.gt.40),dsizes_dbz1)
  Nind = dimsizes(indices)
  do i = 0,Nind(0)-1
   cs(indices(i,0),indices(i,1)) = 1
  end do

The NCL does right, with 25908 points same with indices changed with 1.

Because in my ncl script there are so many loops, so I want to save time with using less loops as possible.

Could you help me and tell me how to solve this problem? Thanks a lot



ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Mon Apr 8 01:05:32 2013

This archive was generated by hypermail 2.1.8 : Mon Apr 15 2013 - 20:12:25 MDT