Re: maximum and minimum

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 21 2011 - 15:29:55 MDT

Hi,

You can use the "where" statement:

   a = where(a.lt.0.,0.,a)

You can also use:

a = a > 0

I find the "where" statement to be easier to remember and understand.

--Mary

On Oct 21, 2011, at 3:04 PM, Xiaoyan Ma wrote:

> Hi
>
> I want to set a minimum in NCL if some values of an array are out of normal range. I was trying to use the conditional command as below, but failed. The message shows that "fatal:Conditional statements (if and do while) require SCALAR logical values, see all and any functions
> fatal:Execute: Error occurred at or near line 31 in file". how to set minimum in NCL? thanks
>
> a= new( (/46,72/), float)
> ..
> if (a.lt.0) then
> a = 0.
> end if
>
> _______________________________________________
> 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 Oct 21 15:30:02 2011

This archive was generated by hypermail 2.1.8 : Mon Oct 24 2011 - 09:29:35 MDT