<div dir="rtl"><div style="text-align:left"><br></div><div dir="ltr" style="text-align:left"><span id="result_box" class="" lang="en"><span class="">Thank you.</span><br><span class="">I did not phrase</span> <span class="">the</span> <span class="">question correctly</span><span class="">, I think that</span> <span class="">the example</span> <span class="">I gave</span> <span class="">is not good.</span> <span class="">I</span> <span class="">will try</span> <span class="">to explain myself</span> <span class="">again.</span><br>
<span class="">First I</span> <span class="">must say</span> <span class="">that I am</span> <span class="">working</span> <span class="">with windows</span> <span class="">not Linux</span><span class="">.<br></span></span><span id="result_box" class="" lang="en"><span class="">I want to get</span> <span class="">data</span> <span class="">from a server</span> <span class="">that already</span> <span class="">gives me a</span> <span class="">monthly averages,</span> <span class="">here's</span> <span class="">a better</span> <span class="">example of</span> <span class="">what i means</span><span class="">:<br>
<br><br>'reinit'<br>'set display color white'<br>f = '<a href="http://goldsmr2.sci.gsfc.nasa.gov:80/dods/MATMNXSLV">http://goldsmr2.sci.gsfc.nasa.gov:80/dods/MATMNXSLV</a>'<br>'sdfopen 'f<br>
<br><br><br>'set parea 0.7 10.5 0.6 8'<br>'set lat 32.5'<br>'set lon 35'<br><br>'set t 3 '<br>'d t850-273.16'<br>cc=subwrd(result,4)<br>'q time'<br>ctime = subwrd(result,3)<br>
chour = substr(ctime,9,15)<br>'draw string 0.5 8 'chour'='cc<br><br><br>'set t 15 '<br>'d t850-273.16'<br>cc=subwrd(result,4)<br>'q time'<br>ctime = subwrd(result,3)<br>chour = substr(ctime,9,15)<br>
'draw string 0.5 7.7 'chour'='cc<br><br><br>'set t 27 '<br>'d t850-273.16'<br>cc=subwrd(result,4)<br>'q time'<br>ctime = subwrd(result,3)<br>chour = substr(ctime,9,15)<br>'draw string 0.5 7.7 'chour'='cc<br>
<br></span></span><span id="result_box" class="" lang="en"><span class="">How do I create</span> <span class="">a loop</span> <span class="">to do it</span> <span class="">automatically</span><span class="">, the server</span> <span class="">provides</span> <span class="">data</span> <span class="">from 1979 to</span> 2013<span class="">,</span> <span class="">and</span> <span class="">I want</span> <span class="">to get</span> <span class="">only the data</span> <span class="">of March.</span><br>
<br><span class="">I hope</span> <span class="">I have explained</span> <span class="">myself</span> <span class="">better.</span><br><span class="">Regards</span></span><br></div><div dir="ltr" style="text-align:left">avi.<br>
</div><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2013/4/1 Muhammad Yunus Ahmad Mazuki <span dir="ltr"><<a href="mailto:ukm.yunus@gmail.com" target="_blank">ukm.yunus@gmail.com</a>></span></div>
<blockquote class="gmail_quote" style="margin:0px 0.8ex;border-left:1px solid rgb(204,204,204);border-right:1px solid rgb(204,204,204);padding-left:1ex;padding-right:1ex"><div dir="ltr"><div><div>The average function itself has what you needed. ave(var1,t=1,t=360,<b>12</b>), this means it will average values from t=1,t=13,t=25 ... until t=360.Example of point value extraction.<br>
<br>'sdfopen <a href="http://foo.nc" target="_blank">foo.nc</a>'<br>lonvalue=90<br>latvalue=0<br>levvalue=850<br>tvalue=1<br>'set lon 'lonvalue<br>'set lat 'latvalue<br>'set t 'tvalue<br>'set lev 'levvalue<br>
'd variable1'<br>catch=sublin(result,4)<br>'set gxout fwrite'
<br>'set fwrite point.dat'<br>'d 'catch<br>'disable fwrite'<br><br></div>This is a basic one, modify it as your need requires. I'm not sure about excel, but this will create a binary file, which can be opened by GrADS (using a controller file) and Scilab (which I use for further analysis).<br>
<br></div>Yunus.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Sun, Mar 31, 2013 at 2:25 PM, avi kojokro <span dir="ltr"><<a href="mailto:kojokroavi@gmail.com" target="_blank">kojokroavi@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div dir="rtl"><div dir="ltr" style="text-align:left"><span lang="en"><span>I'm trying</span> <span>to do</span> <span>a script of </span></span><span lang="en"><span><span lang="en"><span>averages</span></span></span> <span>like this</span> <span>example</span> <span>:<br>
<br><br>'set t 1 '<br>'define varav=ave(t850-273.16,t=1,t=1,1)'<br>'d varav'<br>cc=subwrd(result,4)<br>'draw string 0.5 8 jan='cc<br><br></span></span><span lang="en"><span>I want</span> <span>my</span> <span>script</span> <span>calculates</span> <span>every 12</span> <span>months,</span> <span>how do I create</span> <span>a loop</span> <span>script</span> <span>that</span> <span>calculates</span> <span>every 12</span> <span>month</span> <span>average</span> <span>of the same</span> <span>month.<br>
</span></span><span lang="en"><span>I</span> <span>will give</span> <span>an example of what</span> <span>I mean</span><span>:</span> <span>I want to begin</span> <span>to calculate</span> <span>average of</span> <span>January 1979</span> <span>and then</span> <span>later</span> <span>to calculate</span> <span>directly</span> <span>the</span> <span>January 1980</span> <span>and so on.<br>
</span></span><span lang="en"><span>Is it possible</span> <span>that the</span> <span>result</span> <span>will write</span> <span>directly to the</span> <span>Excel</span> <span>file</span><span>, then</span> <span>how to</span> <span>write</span> <span>the command</span> <span>to it.</span><br>
<br><span>Please note</span> <span>that I</span> <span>first started</span> <span>Grads.<br><br></span></span>Thank you so much. <br><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div dir="ltr" style="text-align:left">
avi<br>
</div><div dir="ltr" style="text-align:left"><br></div><div style="text-align:right"><br></div></font></span></div>
<br></div></div>_______________________________________________<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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br></div></div>