*
*  Note, I used the technique outlined below in a GrADS script
*  /net/cjs/damascus/precip.gs  for putting time series of several
*  variables into a single fwrite file.  Further, the time series
*  were constructed from individual data points, writing each point
*  into the fwrite file in the appropriate location so GrADS could,
*  for display purposes, find the individual points and construct
*  vectors of data belonging to the variables.
*

Hi Senhor Gomes,

 Try the following script. Run as follows:

UNIX>grads -blc "run script.gs"

script.gs looks like this: (# indicates comments)

******cut here
'open file 1'
'open file 2'
'open file *'
'open ...'

'set gxout fwrite'
'set fwrite outfile.bin'

# initialize and set the area of interest
t=1
z=1
'set lat low_lat high_lat'
'set lon low_lon high_lon'

# start time loop

while t<=Max_time
'set t 't
say 'Now at t= 't
'set dfile 1'
'd var1'
'set dfile 2'
'd var2'
'set dfile 3'
'd var3'
'set file *'
'd var*'
# increment time
t=t+1
endwhile

'disable fwrite'
say 'Job is over.... quiting'
#close files, be sure to close that last opened file first
'close 3'
'close 2'
'close 3'

'quit'

*****cut here******

  I hope this will do the job.

Regards

Alvarinho J. Luis, Ph. D.
Post Doc. Res.
Tohoku University
Sendai, Japan.
********************************************
Pedro Tildes Gomes wrote:

> Dear grads users:
>
> Does anyone have a script to write a file with several variables that came
> from several different files?
> Example:
> file#1 - slp.1983.nc
> file#2 - pr_wtr.eatm.1983.nc
> file#3 - air.1983.nc
>
> The ctl file will look something like this:
> DSET   ^surface.1983.bin
> UNDEF  .....
> options little_endian
> TITLE  Surface data in the North Atlantic
> XDEF  29 LINEAR -40 2.5
> YDEF  13 LINEAR 25 2.5
> ZDEF  1 LEVELS 0
> TDEF  1 LINEAR 01JAN1983 1dy
> VARS 3
> slp     0 99     Sea Level Pressure
> prwtr   0 99     Precipitable Water
> air 0 99 Air temperature
> ENDVARS
>
> The problem here is that I have to write a grid for each time step (e.g. for
> t=1, t=2,t=3,etc). It will take a very long time!!!
>
> Thanks in advance
>
> Pedro Tildes Gomes
> -

