[gradsusr] Generating Climatology Average Using Fwrite and NCEP/NCAR Data

Perry, Aaron Aaron.Perry at lsc.vsc.edu
Fri Oct 30 14:20:43 EDT 2015


Good Afternoon Users,


I have a grib1 file that contains 500mb heights from 1985 to 2014, using the NCEP/NCAR Reanalysis Dataset. I am trying to create an averaged climatology file to create monthly anomalies with. I've written a small GrADS script to try and create this climo file but, I'm not having much luck with it. The script outputs a .grib1 file but, no control file, as advertised.


What am I doing wrong?


Script Code:


function pull (args)

'reinit'

rc = gsfallow('on')

currdate = subwrd(args,1)
curr_run = subwrd(args,2)
regions = subwrd(args,3)
month = subwrd(args,4)
date = sublin(currdate,1)
mon = substr(date,5,2)
day = substr(date,7,2)
yr = substr(date,1,4)

path1 = '/mnt/homes/perrya/'
path2 = 'new.climate.atlas/'
model = ncep_reanal

var = hgt500

'open 'path1''path2'hgt500.mon.1985.2014.grib.ctl'

count = 0
rec = 360
incr = 1; t = 0
fhr = 0
inc = 1

'set gxout fwrite'
'set fwrite 'path1''path2'hgt500.1985.2014.mean.grib'

while(count<=rec)

'set t 't

say t

'set lon -320 40'
'set lat -30 90'

'define hgt500 = (hgt500mb.1/100)'

'define climo=ave(hgt500,t=0,t='t',1mo)'

'd climo'

count = count + incr
t = t + incr
fhr = fhr + inc

endwhile

'quit'



Aaron D. Perry
Class of 2016
Lyndon State College
Lyndonville, VT
Twitter: <https://twitter.com/AaronPerryLSC> <https://www.twitter.com/AaronPerryLSC> @AaronPerryLSC<https://twitter.com/AaronPerryLSC>
Mobile: 617-780-4312
Web: shearanalytics.net<http://shearanalytics.net/>
Email: Aaron.Perry at lyndonstate.edu<http://Aaron.Perry@lyndonstate.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20151030/7bed06d5/attachment-0001.html 


More information about the gradsusr mailing list