<html><body><div style="color:#000; background-color:#fff, font-family:garamond, new york, times, serif;font-size:14pt"><SPAN style="RIGHT: auto"><SPAN style="RIGHT: auto">Hi Rashed,<BR>How can I adjust it to stop overwriting the output? See below the&nbsp;.gs file.<BR style="RIGHT: auto" class=yui-cursor></SPAN><BR><SPAN style="RIGHT: auto" lang=EN>
<div style="RIGHT: auto">Thanks<BR style="RIGHT: auto"><BR>'reinit'</div>
<div>'sdfopen gcpcr.nc'</div>
<div>'set x 0.5 360.5'</div>
<div>'set y 1 180'</div>
<div>t = 151</div>
<div>'set sdfwrite rain.nc'</div>
<div>*'set gxout fwrite'</div>
<div>while (t&lt;670)</div>
<div>'set t 't</div>
<div>'define jul=r'</div>
<div style="RIGHT: auto">'set t 't+1</div>
<div>'define aug=r' </div>
<div>'set t 't+2</div>
<div>'define sep=r'</div>
<div>'define jas=(jul+aug+sep)/3'</div>
<div>'sdfwrite jas'</div>
<div>t = t+12 </div>
<div>endwhile</div>
<div>'clear sdfwrite'</div>
<div>;</div></SPAN><BR><BR><VAR id=yui-ie-cursor></VAR><BR class=yui-cursor></SPAN>
<DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV id=RTEContent>
<DIV>
<DIV><B><EM>===================================================</EM></B></DIV>
<DIV><B><EM><FONT color=#007f40 face="lucida console, sans-serif">ZABLONE OWITI<BR></FONT><FONT face="garamond, new york, times, serif">GRADUATE STUDENT<BR>Nanjing University of Information, Science and Technology<BR>College of International Education<BR>Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR></FONT></EM></B><FONT color=#333333 face="garamond, new york, times, serif">Tel: +86-25-58731402<BR>Fax: +86-25-58731456</FONT></DIV>
<DIV><B><EM><FONT face="garamond, new york, times, serif">Mob. 15077895632</FONT></EM></B></DIV>
<DIV><B><EM>Website: <A href="http://www.nuist.edu.cn/" rel=nofollow target=_blank>www.nuist.edu.cn</A><BR></EM></B><I><STRONG>====================================================<BR></STRONG><SPAN style="FONT-STYLE: italic; FONT-FAMILY: inherit" class=ms__id351>
<div class=MsoNormal><I><SPAN style="COLOR: #e36c0a; FONT-SIZE: 12pt">"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."</SPAN></I><I><SPAN style="COLOR: #e36c0a; FONT-SIZE: 12pt"></SPAN></I></div>
<div class=MsoNormal>&nbsp;</div></SPAN></I><BR></DIV></DIV></DIV>
<DIV style="FONT-FAMILY: inherit; FONT-SIZE: 14pt"><BR>
<DIV style="FONT-FAMILY: inherit; FONT-SIZE: 12pt"><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Rashed Mahmood &lt;rashidcomsis@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Zablone Owiti &lt;zablonowiti@yahoo.com&gt;; GrADS Users Forum &lt;gradsusr@gradsusr.org&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">Cc:</SPAN></B> <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Saturday, 15 January 2011 8:34 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [gradsusr] Problem Extracting data in netcdf format<BR></FONT><BR>
<DIV id=yiv148457350>
<DIV><BR>I&nbsp;guess your loop is overwriting the output file and the output variable as after every loop as the name is same after each iteration...</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Rashed </DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=1>Institute of Atmospheric Physics</FONT></DIV>
<DIV><FONT size=1>(CAS) Beijing.<BR></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV class=yiv148457350gmail_quote>On Thu, Jan 13, 2011 at 6:13 PM, Zablone Owiti <SPAN dir=ltr>&lt;<A href="mailto:zablonowiti@yahoo.com" rel=nofollow target=_blank ymailto="mailto:zablonowiti@yahoo.com">zablonowiti@yahoo.com</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class=yiv148457350gmail_quote>
<DIV>
<DIV style="COLOR: #000; FONT-SIZE: 14pt">
<DIV></DIV>
<DIV>&nbsp;Dear users,</DIV>
<DIV>I am attempting to extract seasonal(JAS) data from a monthly netcdf data file using the attached script.</DIV>
<DIV>When I run the script, it only write the first timestep data(i.e it fails to loop). </DIV>
<DIV>What could be error in the script?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks<VAR></VAR></DIV>
<DIV>&nbsp;</DIV>
<DIV>
<DIV>
<DIV><B><I>===================================================</I></B></DIV>
<DIV><B><I><FONT color=#007f40 face="lucida console, sans-serif">ZABLONE OWITI<BR></FONT><FONT face="garamond, new york, times, serif">GRADUATE STUDENT<BR>Nanjing University of Information, Science and Technology<BR>College of International Education<BR>Add: 219 Ning Liu Rd, Nanjing, Jiangsu, 21004, P.R. China<BR></FONT></I></B><FONT color=#333333 face="garamond, new york, times, serif">Tel: +86-25-58731402<BR>Fax: +86-25-58731456</FONT></DIV>
<DIV><B><I><FONT face="garamond, new york, times, serif">Mob. 15077895632</FONT></I></B></DIV>
<DIV><B><I>Website: <A href="http://www.nuist.edu.cn/" rel=nofollow target=_blank>www.nuist.edu.cn</A><BR></I></B><I><B>====================================================<BR></B><SPAN style="FONT-STYLE: italic; FONT-FAMILY: inherit">
<div class=yiv148457350MsoNormal><I><SPAN style="COLOR: #e36c0a; FONT-SIZE: 12pt">"The real art of conversation is not only to say the right thing at the right time, but also to leave unsaid the wrong thing at the tempting moment."</SPAN></I><I><SPAN style="COLOR: #e36c0a; FONT-SIZE: 12pt"></SPAN></I></div>
<div class=yiv148457350MsoNormal>&nbsp;</div></SPAN></I><BR></DIV></DIV></DIV></DIV><BR></DIV><BR>_______________________________________________<BR>gradsusr mailing list<BR><A href="mailto:gradsusr@gradsusr.org" rel=nofollow target=_blank ymailto="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</A><BR><A href="http://gradsusr.org/mailman/listinfo/gradsusr" rel=nofollow target=_blank>http://gradsusr.org/mailman/listinfo/gradsusr</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV><BR><BR></DIV></DIV></div><br></body></html>