Friday, March 27, 2009

Climatology of Seasonal mean using Daily data in GrADS

Prompt 'Enter the folder name: '
pull fld
'!mkdir ../'fld
ans=y
while(ans=y)

prompt 'Enter the starting year:'
pull y1
prompt 'Enter the ending year:'
pull yn
'reinit'
prompt ' enter the starting month as number: '
pull m1
n=m1
if(n=1)
mmm='jan'
endif
if(n=2)
mmm='feb'
endif
if(n=3)
mmm='mar'
endif
if(n=4)
mmm='apr'
endif
if(n=5)
mmm='may'
endif
if(n=6)
mmm='jun'
endif
if(n=7)
mmm='jul'
endif
if(n=8)
mmm='aug'
endif
if(n=9)
mmm='sep'
endif
if(n=10)
mmm='oct'
endif
if(n=11)
mmm='nov'
endif
if(n=12)
mmm='dec'
endif
mmm1=mmm
prompt 'Enter the starting day: '
pull d1
prompt ' enter the ending month as number: '
pull mn
n=mn
if(n=1)
mmm='jan'
endif
if(n=2)
mmm='feb'
endif
if(n=3)
mmm='mar'
endif
if(n=4)
mmm='apr'
endif
if(n=5)
mmm='may'
endif
if(n=6)
mmm='jun'
endif
if(n=7)
mmm='jul'
endif
if(n=8)
mmm='aug'
endif
if(n=9)
mmm='sep'
endif
if(n=10)
mmm='oct'
endif
if(n=11)
mmm='nov'
endif
if(n=12)
mmm='dec'
endif
mmmn=mmm
prompt 'Enter the ending day: '
pull dn
prompt 'Enter the Key word (Active/Break) : '
pull key


'open sst6098.ctl'
'set lat -25 25'
'set lon 50 180'
*'set mproj scaled'
'set time 'd1''mmm1''y1' 'dn''mmmn''yn''
'define t=ave(sst,time='d1''mmm1',time='dn''mmmn')'
'set time 'dn''mmmn''yn''
'define ct=ave(t,time='d1''mmm1''y1',time='dn''mmmn''yn')'
'undefine t'
'set grads off'
'set gxout shaded'
'set clevs 298.5 299 299.5 300 300.5 301 301.5 302 302.5 303 303.5 304'
'set ccols 9 14 4 11 5 13 3 10 7 12 8 2 6'
'd ct'
'cbarn'
'set gxout contour'
*'set ccolor 0'
*'d ct'
'undefine ct'
'close 1'
'draw title sst climatology 'key''
'printim ../'fld'/'key'_'sst'.jpg white'

'clear'
'sdfopen slp.nc'
'set lat -25 25'
'set lon 50 180'
*'set mproj scaled'
'set time 'd1''mmm1''y1' 'dn''mmmn''yn''
'define p=ave(slp,time='d1''mmm1',time='dn''mmmn')'
'set time 'dn''mmmn''yn''
'define cp=ave(p,time='d1''mmm1''y1',time='dn''mmmn''yn')'
'undefine p'
'set grads off'
'set gxout shaded'
*'set clevs 1006.0 1007.0 1008.0 1009.0 1010.0 1011.0 1012.0 1013.0 1014.0 1015.0 1016.0'
*'set ccols 9 14 4 11 5 13 3 10 7 12 8 2'
'd cp'
'cbarn'
'set gxout contour'
'set ccolor 0'
'd cp'
'undefine cp'
'close 1'

'draw title slp climatology 'key''
'printim ../'fld'/'key'_'slp'.jpg white'

'clear'
'open u850.ctl'
'set lat -25 25'
'set lon 50 180'
*'set mproj scaled'
'set time 'd1''mmm1''y1' 'dn''mmmn''yn''
'define uw=ave(u,time='d1''mmm1',time='dn''mmmn')'
'set time 'dn''mmmn''yn''
'define cu=ave(uw,time='d1''mmm1''y1',time='dn''mmmn''yn')'
'undefine uw'
'set grads off'
'set gxout shaded'
'd cu'
'set gxout contour'
'd cu'
'cbarn'
'draw title u wind climatology 'key''
'printim ../'fld'/'key'_'uwind'.jpg white'
'undefine cu'
'close 1'

prompt 'Do you have another one: '
pull ans
endwhile

No comments: