Problems with num function

From: Katie Holman <kdholman_at_nyahnyahspammersnyahnyah>
Date: Tue, 12 May 2009 16:08:59 -0500

Hi All,

I would like to bring attention to a simple problem I am encountering
with the num function. I have a script written that is summing up the
number of individual months in my data file. The total number of time
elements is 240 - so there are 20 Jan., 20 Feb., etc.

The command below produces a list of twenty values.

print(ind(month.eq.1))

(0) 0
(1) 12
(2) 24
(3) 36
(4) 48
(5) 60
(6) 72
(7) 84
(8) 96
(9) 108
(10) 120
(11) 132
(12) 144
(13) 156
(14) 168
(15) 180
(16) 192
(17) 204
(18) 216
(19) 228

When I count the number of times a month number of 1 occurs, the
function num only catches 19 of them. The command line is below.

print(num(ind(month.eq.1)))

(0) 19

I have gotten around the problem by instead using dimsizes, but I
thought everyone should be aware of the issue.

Thank you,

  Katie Holman
  UW-Madison
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 12 2009 - 15:08:59 MDT

This archive was generated by hypermail 2.2.0 : Wed May 13 2009 - 08:40:16 MDT