A couple handy GrADS scripts

You know something useful, tips&tricks, have some unofficial documentation...? Please share your knowledge with us in this section of EMS forum. * * * Please DON'T open topics with questions in this section! * * *
Post Reply
chilimac
Posts: 10
Joined: Mon Aug 15, 2011 12:54 pm

A couple handy GrADS scripts

Post by chilimac » Mon Oct 31, 2011 9:58 am

I call this script animall.gs. It's a general purpose animation routine that will work for any variable and any number of forecast cycles. The .ctl filename, # cycles, and desired display variable are entered via responses to prompts. The forecast cycles frames are displayed at 2-second intervals. No big deal.

Code: Select all

prompt 'Enter filename: '
pull filex
say filex

prompt 'Enter # of cycles to display: '
pull times
say times

prompt 'Enter name of variable to display: '
pull vdisp
say vdisp

'open 'filex' '

'set mpdset hires'

'q time'
res = subwrd(result,3)
vtime = substr(res,1,12)

*loop through all times

it=1

'set dbuff on'

while (it <=times)
 'set t 'it
 'set grads off'
 'display 'vdisp' '
 'draw title 'vtime' 'vdisp' FCST HR ' it-1''


 'swap'

 '!sleep 2'

*increment the counter
 it=it+1

endwhile

A slight modification of animall.gs, called animtemp-F.gs, does the same thing but displays the temps in Deg F, for those of us who will never get used to thinking in Celsius.

Code: Select all

prompt 'Enter filename: '
pull filex
say filex

prompt 'Enter # of cycles to display: '
pull times
say times

prompt 'Enter name of variable to display: '
pull vdisp
say vdisp

'open 'filex' '

'set mpdset hires'

'q time'
res = subwrd(result,3)
vtime = substr(res,1,12)


*loop through all times

it=1

'set dbuff on'

while (it <=times)
 'set t 'it
 'set grads off'
 'display ('vdisp'-273)*1.8+32'
 'draw title 'vtime' 'vdisp' FCST HR ' it-1''

 'swap'

 '!sleep 2'

*increment the counter
 it=it+1

endwhile

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest