Bug in where function?

From: Robert Schuster <rxschuster_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 20 2014 - 02:05:58 MST

Hello,

I have two arrays that I want to divide by each other, one of them contains zeros:

a = (/0,1/)
b = (/1,1/)

I tried to use the where function to avoid a divide by zero error:

c = where(a .gt. 0, b/a, 0)

But interestingly the divide operation is performed on the whole arrays and not only where the condition a .gt. 0 is true:

fatal:divide: Division by 0, Can't continue
fatal:Div: operator failed, can't continue

Is that the way the where function is supposed to work?

Robert
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 20 02:06:11 2014

This archive was generated by hypermail 2.1.8 : Tue Jan 21 2014 - 15:57:30 MST