picking off negative values

From: Matt Fearon (matthew.fearon AT XXXXXX)
Date: Fri Aug 24 2001 - 12:38:59 MDT

  • Next message: Dennis Shea: "Re: picking off negative values"

    Dear NCL users

    If I have an array;

    nd=100
    a=new((/nd/),"float",-999.)

    that is made up of negative and positive values, how can I isolate
    the only negative values and make them zero ? Here is my current
    procedure for doing this;

    do id=0,nd-1
        if(a(id).lt.0.) then
           a(id) = 0.
        end if
    end do

    However when I try running this I get the following error message;

    fatal:The result of the conditional expression yields a missing value.
    NCL can not determine branch, see ismissing function
    fatal:Execute: Error occurred at or near line 231

    I thought since I set a _FillValue of -999. in the new statement that
    missing values are ignored. I am not sure why NCL keeps encountering
    a missing value. Any suggestions would be greatly appreciated.

    Thank you,
    Matt



    This archive was generated by hypermail 2b29 : Fri Aug 24 2001 - 11:52:26 MDT