[gradsusr] Generating Climatology Average Using Fwrite and NCEP/NCAR Data
Perry, Aaron
Aaron.Perry at lsc.vsc.edu
Tue Nov 10 16:15:09 EST 2015
Hi Wesley,
I have tried and implemented this method and have not been able to generate the correct (any actually) climatology to generate the anomalies. I've attached my working script to this email for you to review if you have a spare second to perhaps be able to see what I'm doing wrong.
Talk soon,
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>
________________________________
From: gradsusr-bounces at gradsusr.org <gradsusr-bounces at gradsusr.org> on behalf of Wesley Ebisuzaki - NOAA Federal <wesley.ebisuzaki at noaa.gov>
Sent: Friday, October 30, 2015 3:21 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] Generating Climatology Average Using Fwrite and NCEP/NCAR Data
Perry,
There is an example on how to generate a climatology
http://www.iges.org/grads/gadoc/gradcomdmodify.html
'set t 1 12'
'define sstclim = ave(sst, t+0, t=600, 12)'
The fwrite command can write big/little endian ieee data files.
http://www.iges.org/grads/gadoc/gradcomdsetfwrite.html
After you have used fwrite to save the climo, you can then
write a GrADS ctl file for it. (google and you shall find)
Welsye
On Fri, Oct 30, 2015 at 2:20 PM, Perry, Aaron <Aaron.Perry at lsc.vsc.edu<mailto:Aaron.Perry at lsc.vsc.edu>> wrote:
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<tel:617-780-4312>
Web: shearanalytics.net<http://shearanalytics.net/>
Email: Aaron.Perry at lyndonstate.edu<http://Aaron.Perry@lyndonstate.edu>
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20151110/f2665fc9/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: export_clim.gs
Type: application/octet-stream
Size: 2564 bytes
Desc: export_clim.gs
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20151110/f2665fc9/attachment-0001.obj
More information about the gradsusr
mailing list