*
* Adapted from code posted to the GrADS Listserv:
*
* Subject: Re: Writing the o/p (1D) in ASCII
* From: "J. Matias Mendez Perez" <matias@TROPOSFERA.ATMOSFCU.UNAM.MX>
* Date: Tue, 21 Sep 2004 14:57:24 -0500
* To:GRADSUSR@LIST.CINECA.IT
*

'open tseries.ctl'
'set x 1'
'set y 1'
'set z 1'

'!rm tseries.asc'
fvt2= '%7.2f'
fnamet = 'tseries.asc'

  tt = 1
while(tt<=100)
  'set t 'tt
  'd var1'
  val1 = subwrd(result,4)
  val1 = math_format(fvt2,val1)
  cad=tt'  'val1
  rc = write(fnamet,cad,append)
  tt=tt+1
endwhile

