[gradsusr] (no subject)

Stephen McMillan smcmillan at planalytics.com
Mon Mar 28 08:32:37 EDT 2016


Gargi,

You are getting only January because your current script is redefining
"month" on the first iteration of the while loop.  Rename it to something
different, since it's already defined on the third line you provided.

Stephen Mc

On Mon, Mar 28, 2016 at 7:51 AM, Gargi Akhoury <gargiakhoury at bitmesra.ac.in>
wrote:

> Dear Grads User's,
>
>             I have tried a program to display the monthly sum of
> precipitation. But I am getting only the January value. Kindly, help me
> regarding this.
>
> Tha program is as follows:
>
> '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 rfc.ctl'
> *'set t 1 365'
>  yr = 1951
>
> imon=1
>   while(imon <= 12)
>    md = subwrd(mday,imon)
>    mc = subwrd(month,imon)
>   time1 = '01'mc''yr
>    time2 = md''mc''yr
> 'define month=sum(rf,t='time1',t='time2')'
>   imon = imon + 1
>   endwhile
> 'd month'
>
> val=subwrd(result,4)
> hj=write(rf_month.csv,val)
>
>
> Thanks & Regards
>
> _______________________________________________
> 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/20160328/9791ed71/attachment.html 


More information about the gradsusr mailing list