Re: counting grid point on applying condition

From: sangeeta maharjan <sangeetamaharjan_at_nyahnyahspammersnyahnyah>
Date: Sun Apr 28 2013 - 08:43:09 MDT

Hi Will,
Thanks for your help. It worked for me.

Sangeeta Maharjan.

On 4/26/13, Will Hobbs <Will.Hobbs@utas.edu.au> wrote:
> 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 Sun Apr 28 08:43:20 2013

This archive was generated by hypermail 2.1.8 : Thu May 02 2013 - 11:16:45 MDT