[gradsusr] Unknown command :0

Stephen McMillan smcmillan at planalytics.com
Fri Sep 26 17:13:25 EDT 2014


Ipshita,
Try making it a dummy variable, for example:

dum=write('monthly_mean_Precp.txt',monthavg)

Stephen Mc

On Fri, Sep 26, 2014 at 4:41 PM, Ipshita Majhi <ipmajhi at alaska.edu> wrote:

> 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)
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140926/a0f8ce8c/attachment.html 


More information about the gradsusr mailing list