Yearavg.gs Script
 
*calculates longterm average from gpcp8796.dat
*since the 1987 data does not begin until july, it is excluded.
*
******************Modification Box*********************
indata = 'gpcp8799.ctl'
outplot = '../gpcpdir/maps/year.gmf'
outfile = 'files/gpcyavg.fil'
datname = 'GPCP'
var = 'p'
endmonth = '156'
endyear = '99'
**********************************************************
*
'reinit'
'open 'indata
'set gxout shaded'
'set grads off'
'set parea .8 10.8 1.25 7.5'
'run color' 
*
*for web page display:
 'set clevs 1 2 3 4 5 6 7 8 9 10 11 12 13 14'
 'set ccols 53 55 4 11 5 13 3 38 10 7 12 8 27 2 6'
*
'set lat -60 60'
'set lon -180 180'
*
 'enable print 'outplot
    'define yavg=ave(maskout('var','var'),t=13,t='endmonth',1)'
      'd yavg'
      'run cbar'
  'draw title Annual Average 'datname' Precipitation (mm/day): 1987-'endyear
 'print'
*'clear'
*
*write to data file
'set fwrite 'outfile
'set gxout fwrite'
'd yavg'