[gradsusr] Unknown command :0

Ipshita Majhi ipmajhi at alaska.edu
Fri Sep 26 16:41:11 EDT 2014


Dear Grads Users,

I am running a script to convert daily to monthly data and it runs till I
put a write command to get an output then it tells me it is an unknown
command.It will be great if someone can help me.

*************************************************************************************************
*Date 09/25/2014
*This script is to convert daily values to monthly values for different
years which starts from 1901
* and ends in 2010
**************************************************************************************************
rc=gsfallow("on")
'reinit'
mday = '31 28 31 30 31 30 31 31 30 31 30 31'
month = 'jan feb mar apr may jun jul aug sep oct nov dec'

'open prec.mean.imr.ctl'



 yr1 = 1901
 yr2 = 2010

 yr = yr1
 while(yr<=yr2)

 leap = 0
 if(math_mod(yr,400) = 0 | math_mod(yr,4) = 0 & math_mod(yr,100) != 0)

 leap = 1

 say yr' is a leap year.'
endif

   imon = 1
   while(imon <= 12)
   md = subwrd(mday,imon)
   mc = subwrd(month,imon)
   if(imon = 2); md = md + leap; endif;
   time1 = '01'mc''yr
   time2 = md''mc''yr

 ' monthavg= ave(p,time='time1',time='time2')'
   imon = imon + 1
 endwhile
  yr = yr + 1
 endwhile

write('monthly_mean_Precp.txt',monthavg)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140926/f14db961/attachment.html 


More information about the gradsusr mailing list