Re: conditional expession yeilds a missing value

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 08 2010 - 08:34:12 MST

Hi Jonathan,

The error is telling you that you have a conditional statement that
is trying to operate on a missing value.

For example, if you have the code:

   i = new(1,integer) ; at this point, "i" is a missing value
   if(i.eq.0) then
     print("i is 0")
   end if

then the above code will fail with:

   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 4

Check any conditional statements near line 104 in your code and make
sure you are not passing missing values to them.

Here's how you might test for a missing value so it doesn't fail:

   if(.not.ismissing(i).and.i.eq.0) then
     print("i is 0")
   end if

If "i" is an array, and every value in "i" could potentially be
missing, then to test for this you need:

   if(.not.all(ismissing(i)).and.any(i.eq.0)) then
     print("One or more i's are 0")
   end if

The above code snippets are just examples to illustrate the issue. I
wouldn't normally code things this way.
The important thing is to determine if missing values should ever be
reaching your conditional statement.
If not, then there may be in an error earlier in the code. If so,
then you'll need to deal with the missing values
in an appropriate fashion.

--Mary

On Jan 7, 2010, at 10:57 AM, jwsmith@ucar.edu wrote:

> Hello ncl-talk
> My model domain has 66 grid boxes in the N-S (j) direction. I can do a
> vertical cross section in ncl with boxes 0 to 34 and 52 to 66 but not
> 35 to 51. The 35 to 51 range includes the 5 N latitude line that I
> need.
>
> I get the error below no matter what wrfout file varible I use:
> (0) Working on time: 2006-05-25_00:00:00
> 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 104 in file
> vert_xsec_latitudinal_o3_5N.ncl
>
> Has anyone run into the error above and how did you solve it?
>
> Thanks
>
>
> Jonathan Wynn Smith
>
> Doctoral Student in Howard University
> Program in Atmospheric Sciences (HUPAS)
> 2008 ASP Graduate Student Visitor
> 2006 ASP Summer Colloquium Participant
>
> 408 Thirkield Building
> 2355 6th St. NW
> Washington, DC 20059
>
> E-mail: jw_smith@howard.edu or jwsmith9@gmail.com
> Cell Phone: 336-601-4563
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> _______________________________________________
> 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 Jan 8 08:34:53 2010

This archive was generated by hypermail 2.1.8 : Tue Jan 12 2010 - 15:38:20 MST