<div dir="ltr">Thanks, Gargi, that helps. And, yes, it's possible to get all 365 daily data. Instead of 12 timesteps as you do now, you will loop through 365 timesteps. <div><br></div><div>Since you are wanting results in text files for viewing in Excel, you may want to consider using 'set gxout print' along with 'set prnopts...' instead of 'set gxout fwrite'. See appropriate entries in the GrADS Documentation Index.</div><div><br></div><div>Steve Mc</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 12:01 PM, Gargi Akhoury <span dir="ltr"><<a href="mailto:gargiakhoury@bitmesra.ac.in" target="_blank">gargiakhoury@bitmesra.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Stephen,<div> 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. </div><div> One more query, is it possible to get all the 365 data (means daily data)?? </div><div><br></div><div>Thanks & Regards</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 8:30 PM, Stephen McMillan <span dir="ltr"><<a href="mailto:smcmillan@planalytics.com" target="_blank">smcmillan@planalytics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gargi,<div><br></div><div>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?</div><div><br></div><div>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."</div><div><br></div><div>Stephen Mc</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 9:43 AM, Gargi Akhoury <span dir="ltr"><<a href="mailto:gargiakhoury@bitmesra.ac.in" target="_blank">gargiakhoury@bitmesra.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div> I have corrected like this but not getting results..</div><div><br></div><div><span><div>'reinit'</div><div> mday = '31 28 31 30 31 30 31 31 30 31 30 31'</div><div> month = 'jan feb mar apr may jun jul aug sep oct nov dec'</div><div><br></div><div>'open rfc.ctl' </div></span><div>'set gxout fwrite'</div><div>'set fwrite outputfile'</div><span><div> yr = 1951</div><div><br></div><div>imon=1</div><div> while(imon <= 12)</div><div> md = subwrd(mday,imon)</div><div> mc = subwrd(month,imon)</div><div> time1 = '01'mc''yr</div><div> time2 = md''mc''yr</div></span><div>'define monrf=sum(rf,time='time1',time='time2')' </div><div>'d monrf'</div><span><div><br></div><div> imon = imon + 1</div><div> endwhile </div><div><br></div></span><div>val=subwrd(result,4)</div><div>hj=write(monrf.csv,val)</div><div><br></div></div><div><br></div><div>Regards</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 6:28 PM, Stephen McMillan <span dir="ltr"><<a href="mailto:smcmillan@planalytics.com" target="_blank">smcmillan@planalytics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gargi,<div>Instead of using "t= ...", use "time= ..." when you define the precipitation variable.</div><span><font color="#888888"><div>Stephen</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 8:49 AM, Gargi Akhoury <span dir="ltr"><<a href="mailto:gargiakhoury@bitmesra.ac.in" target="_blank">gargiakhoury@bitmesra.ac.in</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Stephen,<div> I have corrected but still getting a single value......not the values for all 12 months separately. </div><div><br></div><div>Regards</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 28, 2016 at 6:02 PM, Stephen McMillan <span dir="ltr"><<a href="mailto:smcmillan@planalytics.com" target="_blank">smcmillan@planalytics.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Gargi,<div><br></div><div>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.</div><div><br></div><div>Stephen Mc</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Mon, Mar 28, 2016 at 7:51 AM, Gargi Akhoury <span dir="ltr"><<a href="mailto:gargiakhoury@bitmesra.ac.in" target="_blank">gargiakhoury@bitmesra.ac.in</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Dear Grads User's,<div> </div><div> 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.</div><div><br></div><div>Tha program is as follows:</div><div><br></div><div><div>'reinit'</div><div> mday = '31 28 31 30 31 30 31 31 30 31 30 31'</div><div> month = 'jan feb mar apr may jun jul aug sep oct nov dec'</div><div><br></div><div>'open rfc.ctl'</div><div>*'set t 1 365' </div><div> yr = 1951</div><div><br></div><div>imon=1</div><div> while(imon <= 12)</div><div> md = subwrd(mday,imon)</div><div> mc = subwrd(month,imon)</div><div> time1 = '01'mc''yr</div><div> time2 = md''mc''yr</div><div>'define month=sum(rf,t='time1',t='time2')' </div><div> imon = imon + 1</div><div> endwhile </div><div>'d month'</div><div><br></div><div>val=subwrd(result,4)</div><div>hj=write(rf_month.csv,val)</div><div><br></div></div><div><br></div><div>Thanks & Regards</div></div>
<br></div></div><span>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></span></blockquote></div><br></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>