[gradsusr] (no subject)

Gargi Akhoury gargiakhoury at bitmesra.ac.in
Mon Mar 28 12:06:29 EDT 2016


Hello Stephen,
        Got the results. I have corrected the program, and it is running
correctly. Thanku so much.

Regards

On Mon, Mar 28, 2016 at 9:31 PM, Gargi Akhoury <gargiakhoury at bitmesra.ac.in>
wrote:

> Hello Stephen,
>          Thanku for ur suggestions.....now m making it clear. Actually, I
> have daily precipitation data of 1951 (365 days) in binary form. I have to
> extract data on monthly basis and save it in excel sheet. Converting daily
> data into monthly data so I'll get only 12 values. The above program I have
> seen in Grads users forum and tried to apply it in my case. Hope this will
> make u clear.
>         One more query, is it possible to get all the 365 data (means
> daily data)??
>
> Thanks & Regards
>
> On Mon, Mar 28, 2016 at 8:30 PM, Stephen McMillan <
> smcmillan at planalytics.com> wrote:
>
>> Gargi,
>>
>> It is unclear what you are trying to accomplish, or the results that you
>> expect to get.  The way you have your script set up, you are "fwriting" the
>> summed precipitation 12 times to a file called "outputfile" but what is the
>> purpose of the single second write (monrf.csv,val)?  As written, the latter
>> would produce one value equal to the number of written elements.  Is that
>> what you wanted?  Also, does your fw output file not contain what you
>> expect?
>>
>> If you are getting an error message or just getting an unexpected output,
>> it would help if you include that in your reply, other than just "not
>> getting results."
>>
>> Stephen Mc
>>
>> On Mon, Mar 28, 2016 at 9:43 AM, Gargi Akhoury <
>> gargiakhoury at bitmesra.ac.in> wrote:
>>
>>> Hello,
>>>     I have corrected like this but not getting results..
>>>
>>> '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 gxout fwrite'
>>> 'set fwrite outputfile'
>>>  yr = 1951
>>>
>>> imon=1
>>>   while(imon <= 12)
>>>    md = subwrd(mday,imon)
>>>    mc = subwrd(month,imon)
>>>   time1 = '01'mc''yr
>>>    time2 = md''mc''yr
>>> 'define monrf=sum(rf,time='time1',time='time2')'
>>> 'd monrf'
>>>
>>>   imon = imon + 1
>>>   endwhile
>>>
>>> val=subwrd(result,4)
>>> hj=write(monrf.csv,val)
>>>
>>>
>>> Regards
>>>
>>> On Mon, Mar 28, 2016 at 6:28 PM, Stephen McMillan <
>>> smcmillan at planalytics.com> wrote:
>>>
>>>> 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
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> 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/1ab63eb1/attachment-0001.html 


More information about the gradsusr mailing list