[Thread Prev][Thread Next][Index]

Re: line too long



On Thu, 6 Mar 2003, Steve Knox wrote:
> I tried using \ to make the line more readable but am still getting
> "line too long". I seem to be well under the limit of 2048 chars.
> 
> let cover2 = IF cover eq 1 \
>  or cover eq 2 \
>  or cover eq 3 \
>  or cover eq 5 \
>  or cover eq 7 \
>  or cover eq 8 \
>  or cover eq 9 \
>  or cover eq 12 \
>  ...
>  or cover eq 33 then cover
>  **ERROR: expression too complex:A
> 
> So I'm wondering if the problem is not line length but too many
> conditional expressions??

Hi Steve,

If you have a free axis (e.g. if your data is XYT, then Z is free),
there's a concise way to mask even if your values are unevenly spaced.  
Here's a demo:

use coads_climatology
let cover = int(sst)            !an integer XYT variable (like yours?)
let mask_vals = zsequence({20,21,24,25,26,29})   !orthogonal mask values
let integrand = IF cover NE mask_vals THEN cover !missing where masked
let cover_masked = IF integrand[k=@nbd] EQ 0 THEN cover !count the missing
shade/l=1 cover_masked

Cheers,

Andrew

+------------------------------------------------------------+
| Andrew Wittenberg        | Mailing address:                |
| GFDL Room 357            | US DOC/GFDL                     |
| Email: atw@gfdl.noaa.gov | Attn: Andrew Wittenberg         |
| Voice: (609) 987-5064    | Forrestal Campus, US Route 1    |
|   Fax: (609) 987-5063    | Princeton, NJ 08542             |
+------------------------------------------------------------+



[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement