[gradsusr] (no subject)

Stephen McMillan smcmillan at planalytics.com
Mon Mar 28 08:58:31 EDT 2016


Gargi,
Instead of using "t= ...", use "time= ..." when you define the
precipitation variable.
Stephen

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

> Hello Stephen,
>         I have corrected but still getting a single value......not the
> values for all 12 months separately.
>
> Regards
>
> On Mon, Mar 28, 2016 at 6:02 PM, Stephen McMillan <
> smcmillan at planalytics.com> wrote:
>
>> 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
>>>
>>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
> _______________________________________________
> 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/819d48b6/attachment-0001.html 


More information about the gradsusr mailing list