Tuesday, March 10, 2009

GrADS code to plot Rainfall slp and zonal wind of Northeast monsoon over southern peninsular India

Prompt 'Enter the folder name: '
pull fld
'!mkdir ../'fld

yyyy=1951
while(yyyy<=2003)

'reinit'
'set grads off'

'set vpage 0 8 0 11 '
'set parea .5 8 8.5 10'
'set mproj scaled'
'sdfopen slp.nc'
'set lat 10'
'set lon 75'
'set time 01Oct'yyyy' 31Dec'yyyy
'define ap=aave(slp,lon=65,lon=75,lat=5,lat=15)'
'define pentp=ave(ap,t-2,t+2)'
'define meanp=ave(ap,time=01Oct'yyyy',time=31Dec'yyyy')'
'd pentp'
'd meanp'
'draw title slp lon=65,lon=75,lat=5,lat=15 'yyyy' '
'close 1'
'undefine ap'
'undefine pentp'
'undefine meanp'

'set vpage 0 8 0 11 '
'set parea .5 8 6.5 8'
'set mproj scaled'
'open u850.ctl'
'set lat 10'
'set lon 75'
'set time 01Oct'yyyy' 31Dec'yyyy
'define au=aave(u,lon=70,lon=80,lat=13,lat=15)'
'define pentu=ave(au,t-2,t+2)'
'define meanu=ave(au,time=01Oct'yyyy',time=31Dec'yyyy')'
'd pentu'
'd meanu'
'draw title u850 lon=70,lon=80,lat=13,lat=15 'yyyy' '
'close 1'
'undefine au'
'undefine pentu'
'undefine meanu'


'set vpage 0 8 0 11'
'set parea .5 8 4.5 6'
'set mproj scaled'
'open rf_5103.ctl'
'set lat 10'
'set lon 75'
'set time 01Oct'yyyy' 31Dec'yyyy
'define r=aave(rf,lon=70,lon=80,lat=8,lat=13)'
'define pentr=ave(r,t-2,t+2)'
'define meanr=ave(r,time=01Oct'yyyy',time=31Dec'yyyy')'
'd pentr'
'd meanr'
'draw title Rain lon=70,lon=80,lat=8,lat=13 'yyyy' '
'close 1'
'undefine r'
'undefine pentr'
'undefine meanr'

'set vpage 0 8 0 11 '
'set parea .5 8 2.5 4'
'set mproj scaled'
'open u850.ctl'
'set lat 10'
'set lon 75'
'set time 01Oct'yyyy' 31Dec'yyyy
'define au=aave(u,lon=70,lon=80,lat=8,lat=13)'
'define pentu=ave(au,t-2,t+2)'
'define meanu=ave(au,time=01Oct'yyyy',time=31Dec'yyyy')'
'd pentu'
'd meanu'
'draw title u850 lon=70,lon=80,lat=8,lat=13 'yyyy' '
'close 1'
'undefine au'
'undefine pentu'
'undefine meanu'

'set vpage 0 8 0 11 '
'set parea .5 8 0.5 2'
'set mproj scaled'
'sdfopen slp.nc'
'set lat 10'
'set lon 75'
'set time 01Oct'yyyy' 31Dec'yyyy
'define ap=aave(slp,lon=80,lon=90,lat=5,lat=15)'
'define pentp=ave(ap,t-2,t+2)'
'define meanp=ave(ap,time=01Oct'yyyy',time=31Dec'yyyy')'
'd pentp'
'd meanp'
'draw title slp lon=80,lon=90,lat=5,lat=15 'yyyy' '
'close 1'
'undefine ap'
'undefine pentp'
'undefine meanp'

'printim ../'fld'/wind'yyyy'.jpg white'

yyyy=yyyy+1
endwhile

No comments: