Friday, February 20, 2009

control structors in GrADS

Prompt 'Enter the folder name: '
pull fld
'!mkdir ../'fld
prompt 'enter the year as yyyy :'
pull yyyy
prompt 'enter the month as number 1 to 12 :'
pull n
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
prompt mmm' '
prompt

dd=1
while(dd<=30)

'reinit'
'sdfopen slp.'yyyy'.nc'

'set lat 5 25'
'set lon 60 90'
'set time 'dd''mmm''yyyy''

'set grads off'
'set gxout shaded'
'd slp'
'cbarn'
'draw title slp 'yyyy' 'mmm' 'dd' '
'printim ../'fld'/slp'yyyy''n''dd'.jpg white'

dd=dd+1
endwhile






1 comment: