Re: Fwd: how to ignore missing values in if statement

From: H.Dang <danghy_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 07 2012 - 07:49:43 MST

Hi Dennis,

Sorry for re-submit the question. I remember I can receive my own email
after I send it to ncl-talk@ucar.edu, but I couldn't receive it last time.
 I thought I failed to send it out, so I just made another try. Sorry for
any inconvenience. I didn't mean it.

Thank you for your suggestion. I'll try it.

Have a good day.

Hongyan

On Fri, Dec 7, 2012 at 9:20 AM, Dennis Shea <shea@ucar.edu> wrote:

> [1] PLEASE ... do not submit the same question multiple times.
> ncl-talk is not a 7-day 24-hour service. People answer
> when they have time.
>
> [2] Maybe ...
>
> if (.not.all(ismissing(conc))) then ; only proceed if there are
> ; non-missing values
> do lev=0,35
> do i=0,11
> if (.not.(ismissing(conc(lev ,i,istations)) .and. \
> ismissing(conc(lev+1,i,**istations))).and. \
> conc(lev ,i,istations).lt.150 .and. \
> conc(lev+1,i,istations).gt.**150) then
>
> sonde_h(i,istations) = (plev_sonde(lev) +
> plev_sonde(lev+1))/2.
> end if
> end do
> end do
>
> end if
>
>
>
> On 12/7/12 7:12 AM, H.Dang wrote:
>
>> ---------- Forwarded message ----------
>> From: H.Dang <danghy@gmail.com>
>> Date: Thu, Dec 6, 2012 at 5:07 PM
>> Subject: how to ignore missing values in if statement
>> To: ncl-talk@ucar.edu
>>
>>
>> Hi dear all,
>>
>> My data includes lots of missing values, I just want to know how to ignore
>> these values in the following if judgements. My code is like:
>>
>> 74 do lev = 0,35
>> 75 do i = 0,11
>> 76 if
>> (.not.all(ismissing(conc)).**and.conc(lev,i,istations).lt.**
>> 150.and.conc(lev+1,i,**istations).gt.150)
>> then
>> 77 sonde_h(i,istations) = (plev_sonde(lev) +
>> plev_sonde(lev+1))/2.
>> 78 end if
>> 79 end do
>> 80 end do
>>
>> The error information is:
>>
>> fatal:The result of the conditional expression yields a missing value. NCL
>> can not determine branch, see ismissing function
>> fatal:["Execute.c":7556]:**Execute: Error occurred at or near line 78 in
>> file
>> testmissing.ncl
>>
>> Thank you!
>>
>> Hongyan
>>
>>
>>
>> ______________________________**_________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/**mailman/listinfo/ncl-talk<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 Dec 7 07:50:41 2012

This archive was generated by hypermail 2.1.8 : Fri Dec 07 2012 - 13:30:06 MST