Friday, January 2, 2009

GrADS code for plot wind of Indian region

** Indian region *.'yyyy'.Jan
************************************

prompt 'Enter name for new folder: '
pull opf
'!mkdir 'opf
loop=y
while(loop=y)
prompt 'Enter level: '
pull lev

prompt 'Enter year: '
pull yyyy

prompt 'Enter month (three letters) : '
pull mmm


dd=1
while(dd<=31)

'reinit'
'sdfopen uwnd.'yyyy'.nc'
'q file'
'sdfopen vwnd.'yyyy'.nc'
'q file'
'set lat -15 40'
'set lon 40 120'
'set grads off'
'set time 'dd''mmm''yyyy''


'set lev 'lev

**********
'set gxout shaded'
'd uwnd'
'run cbarn'

'set gxout contour'
'd uwnd'

'draw title u wind m/s 'lev'mb\.'yyyy'.'mmm'.'dd''
'printim 'opf'/w.'lev'mb.uwnd.'yyyy'.'mmm'.'dd'.jpg white'

'c'
say 'Zonal Wind 'lev'mb\.'yyyy'.'mmm'.'dd' '
************

'set gxout shaded'
'd vwnd.2'
'run cbarn'

'set gxout contour'
'd vwnd.2'

'draw title v wind m/s 'lev'mb\.'yyyy'.'mmm'.'dd''
'printim 'opf'/w.'lev'mb.vwnd.'yyyy'.'mmm'.'dd'.jpg white'
'c'
say 'Meridional Wind 'lev'mb\.'yyyy'.'mmm'.'dd' '
************

'set gxout shaded'

'd mag(uwnd,vwnd.2)'
'cbarn'

'set gxout vector'
'd uwnd;vwnd.2'


'draw title wind speed m/s 'lev'mb\.'yyyy'.'mmm'.'dd''
'printim 'opf'/w.'lev'mb.wind.vtr.'yyyy'.'mmm'.'dd'.jpg white'
'c'
say 'Wind Vector 'lev'mb\.'yyyy'.'mmm'.'dd' '
*************
'set gxout stream'
'set ccolor 4'
'd uwnd;vwnd.2'

'draw title wind 'lev'mb\.'yyyy'.'mmm'.'dd''
'printim 'opf'/w.'lev'mb.wnd.strm.'yyyy'.'mmm'.'dd'.jpg white'
'c'
say 'Wind Streamline 'lev'mb\.'yyyy'.'mmm'.'dd' '

dd=dd+1
endwhile

prompt 'Do you want to plot another level: n for no, y for yes :'
pull loop
endwhile


*******************************

No comments: