[gradsusr] help in monthly average precipitation script for aphrodite data

Waheed waheed.met at gmail.com
Thu Mar 10 05:07:53 EST 2011


Dear all

Grads version: 2.0.a8
OS : RHL 5 (32bit).

i am trying to find the monthly average precipitation from yearly nc files
 of daily data. i want to get ouput in nc format but monthly average for
each month.
dkiktev had sent me a script and i made modifications in it. now i m running
it for 10 years from 1951-1960 for the month of May . But i am having
trouble with it.

the script is as follows :
* monthly average for the month on May from 1951-1960

'sdfopen 1951.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p51=ave(precip,t=121,t=151)'
'close 1'
'sdfopen 1952.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p52=ave(precip,t=122,t=152)'
'define sum1=p51+p52'
'close 1'
'undefine p51'
'undefine p52'
'sdfopen 1953.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p53=ave(precip,t=121,t=151)'
'define sum2=sum1+p53'
'undefine sum1'
'undefine p53'
'close 1'
'sdfopen 1954.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p54=ave(precip,t=121,t=151)'
'define sum3=sum2+p54'
'undefine sum2'
'undefine p54'
'close 1'
'sdfopen 1955.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p55=ave(precip,t=121,t=151)'
'define sum4=sum3+p55'
'undefine sum3'
'undefine p55'
'close 1'
'sdfopen 1956.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p56=ave(precip,t=122,t=152)'
'define sum5=sum4+p56'
'undefine sum4'
'undefine p56'
'close 1'
'sdfopen 1957.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p57=ave(precip,t=121,t=151)'
'define sum6=sum5+p57'
'undefine sum5'
'undefine p57'
'close 1'
'sdfopen 1958.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p58=ave(precip,t=121,t=151)'
'define sum7=sum6+p58'
'undefine sum6'
'undefine p58'
'close 1'
'sdfopen 1959.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p59=ave(precip,t=121,t=151)'
'define sum8=sum7+p59'
'undefine sum7'
'undefine p59'
'close 1'
'sdfopen 1960.nc'
'set lat 23.025 37.475'
'set lon 60.025 79.975'
'define p60=ave(precip,t=122,t=152)'
'define sum9=sum8+p60'
'undefine sum8'
'undefine p60'
'close 1'
'define pave=sum9/10'
'set sdfwrite waheed.nc'
'sdfwrite pave'
'quit'

It gives an error " define error : no files open yet"

any suggestions for this script or if there is something better please tell
.

Thanx in advance


Best regards
-- 
Waheed Iqbal
 (Meteorologist)
Pakistan Meteorological Department
R & D Islamabad,Pakistan
+923334547814
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110310/2ed9036d/attachment-0003.html 


More information about the gradsusr mailing list