Friday, November 7, 2008

Gradsnc code for ploting wind at diffrent levels

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

** Indian region (15N, 40N, 40E, 120E)

************************************************Jan.'yyyy'.



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

prompt 'Enter the 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'
'sdfopen vwnd.'yyyy'.nc'
'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'
prompt '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'
prompt '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'
prompt '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'
prompt '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: