[ncl-talk] If statements and Fill_Values

Karin Meier-Fleischer meier-fleischer at dkrz.de
Fri Jan 10 01:25:52 MST 2020


Hi,

what about

if(all(ismissing(ratio_hr))) then
    continue
end if

-Karin

Am 10.01.20 um 09:17 schrieb Barry Lynn via ncl-talk:
> Hi:
>
> I will give it a try.
>
> In the meantime, I am wondering why you suggest the ne, rather than 
> the equal to with a continue and an else?
>
> On Fri, Jan 10, 2020 at 9:52 AM Beáta Szabó-Takács 
> <szabo.b at czechglobe.cz <mailto:szabo.b at czechglobe.cz>> wrote:
>
>     Dear Barry,
>
>     The continue will proceed directly to the next iteration. Try to
>     skip the _FillValues by:
>
>     if(max(ratio_hr).ne.ratio_hr at _FillValue.and.
>     min(ratio_hr).ne.ratio_hr at _FillValue)then
>
>     statement(s)
>
>     end if
>
>     I hope it solves your issue.
>
>     Kind regards,
>
>     Beata
>
>     *From:*ncl-talk [mailto:ncl-talk-bounces at ucar.edu
>     <mailto:ncl-talk-bounces at ucar.edu>] *On Behalf Of *Barry Lynn via
>     ncl-talk
>     *Sent:* Friday, January 10, 2020 7:40 AM
>     *To:* ncl-talk <ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>>
>     *Subject:* [ncl-talk] If statements and Fill_Values
>
>     Hi:
>
>     I am trying to skip a loop where all the numbers (min/max) are
>     _FillValues.
>
>     min=9.96921e+36 max=9.96921e+36
>
>     However, I get this error, even though my if statement is checking
>     this.
>
>     fatal:The result of the conditional expression yields a missing
>     value. NCL can not determine branch, see ismissing function
>
>     if
>     (max(ratio_hr).eq.ratio_hr at _FillValue.and.min(ratio_hr).eq.ratio_hr at _FillValue)then
>     <mailto:.eq.ratio_hr at _FillValue.and.min(ratio_hr).eq.ratio_hr at _FillValue)then>
>
>     continue
>
>     else
>
>     Is there someway around this?
>
>     Thank you
>
>     -- 
>
>     Barry H. Lynn, Ph.D
>
>     Senior Associate Scientist, Lecturer,
>
>     The Institute of the Earth Science,
>     The Hebrew University of Jerusalem,
>     Givat Ram, Jerusalem 91904, Israel
>
>     Tel: 972 547 231 170
>     Fax: (972)-25662581
>
>     C.E.O, Weather It Is, LTD
>     Weather and Climate Focus
>     http://weather-it-is.com
>     Jerusalem, Israel
>     Local: 02 930 9525
>     Cell: 054 7 231 170
>     Int-IS: x972 2 930 9525
>
>
>
> -- 
> Barry H. Lynn, Ph.D
> Senior Associate Scientist, Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200110/e8899962/attachment.html>


More information about the ncl-talk mailing list