[gradsusr] if test in grads script going awol

Becker, Bernd bernd.becker at metoffice.gov.uk
Wed Oct 27 05:55:46 EDT 2010


oops! (Will Smith flying an alien space ship in Indepenance Day)
 
Thanks!
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



 

________________________________

From: gradsusr-bounces at gradsusr.org
[mailto:gradsusr-bounces at gradsusr.org] On Behalf Of Jennifer Adams
Sent: 26 October 2010 17:06
To: GrADS Users Forum
Subject: Re: [gradsusr] if test in grads script going awol


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/20101027/e76721b7/attachment-0003.html 


More information about the gradsusr mailing list