[gradsusr] if test in grads script going awol

Jennifer Adams jma at cola.iges.org
Tue Oct 26 12:05:48 EDT 2010


Bernd,
Get rid of the 'then' in your 'if' statement -- it is not part of the  
'if' clause syntax.
--Jennifer

On Oct 26, 2010, at 10:06 AM, Becker, Bernd wrote:

>
> dear all,
> what is wrong with this?
>
>
> ignore=(20101021)
>
> in=0
> while ( in < 1 )
>   in= in   +1
>
> * check current date against list of dates to be ignored:
>   dimfx       = subwrd(ignore, in)
>   say rc' 'valnum(dimfx)
>   dimfx       = math_format('%10.2f', dimfx  )
>   ifxdate     = math_format('%10.2f', fxdate )
>   skip=(ifxdate-dimfx)/1.
> * this is zero to trigger skip
>   say rc' 'dimfx' 'ifxdate' 'skip        ' 'valnum(skip)
>   if ( skip = int(0)      )    then
>       say 'skip 'dimfx                 ' 'fxdate
>   else
>       say 'not skip 'dimfx             ' 'fxdate
>
>
> for the life of it, skip is always true! even if skip is anything but
> zero!
>
> What can I do to skip if skip =0?
>
> Cheers,
> Bernd.
>
> --
> Bernd Becker   Climate Impacts Product Development
> Met Office Hadley Centre    FitzRoy Road  Exeter   Devon EX1 3PB   
> United
> Kingdom
> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
> E-mail:bernd.becker at metoffice.gov.uk -
> http://www.metoffice.gov.uk/research/our-scientists/seasonal-to-decadal/
> bernd-becker
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20101026/810a4f0e/attachment-0003.html 


More information about the gradsusr mailing list