Re: counting grid point on applying condition

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 26 2013 - 00:38:18 MDT

Sangeeta

The problem is that your are subsetting the array 'value' in your
'where()' function; you're adding a scalar 'value' to a multidimensional
array var_mm(3,0,:,:)

Anyway, if all you want is the number of values in this range, this is not
the simplest way or most efficient way; the num() function would be much
better.

> value = num(var_mn(3,0,:,:).ge.100..and.var_mn(3,0,:,:).le.200.)

http://www.ncl.ucar.edu/Document/Functions/Built-in/num.shtml

Will

On 26/04/13 4:30 PM, "sangeeta maharjan" <sangeetamaharjan@gmail.com>
wrote:

>Dear NCL user,
>I have a variable named "var_mm". It's type is float and dimension and
>sizes is [12]x[3]x[51]x[51].
>I want to count those grid points having values in the range 100-200.
>For this I did as follows
>
>value=0;;;;variable which will count the particular grid point
>satisfying applied condition.
>value=value+where(var_mm(3,0,:,:) .ge.100 .and. var_mm(3,0,:,:).le.
>200,1,0)
>
>while executing the script I got error msg as "Number of dimension on
>right hand side donot match number of dimension in left hand side"
>
>I also tried to replace where() by if statement by it also generated
>eroor msgas "conditional statment require SCALAR logical values."
>
>Any help regrading on it will be appreciated.
>Sangeeta Maharjan
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 26 00:38:30 2013

This archive was generated by hypermail 2.1.8 : Fri Apr 26 2013 - 17:10:25 MDT