Hi<br><br>I believe your hgt.'yr' is not correct in GrADS. GrADS will open the file <a href="http://hgt.1981.nc">hgt.1981.nc</a> as file 1, and <a href="http://hgt.2010.nc">hgt.2010.nc</a> as file as file 30. So you should just use xxx=1 and while(xxx<=30), since you also you also use yr to set the times. Instead of hgt.1981, it will be registered as hgt.1, which is how GrADS use it. you will also need to add xxx=xxx+1 at the end of the loop. Using cdo will make your life easier. <br>
<br>You can also use template option in GrADS. You can also go to a long length using GrADS to read the files and write it to a single file.<br><br>Yunus<br><br><br><div class="gmail_quote">On Mon, Jan 7, 2013 at 9:54 PM, Kishore Babu <span dir="ltr"><<a href="mailto:kishoreragi@gmail.com" target="_blank">kishoreragi@gmail.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">Hi,<div><br></div><div>you can play very easily with nc file with simple handling cdo commands..</div><div>
<br></div><div>As per your question, you want to add many files into a single file containing same variable for a longer time. </div>
<div><br></div><div>I hope that you have installed cdo. If yes, just invoke the following command ...</div><div><br></div><div>cdo mergetime <a href="http://input1.nc" target="_blank">input1.nc</a> <a href="http://input2.nc" target="_blank">input2.nc</a> <a href="http://input3.nc" target="_blank">input3.nc</a> ........... <a href="http://output.nc" target="_blank">output.nc</a> </div>
<div><br></div><div>That's it! you are done !!! your output file contains all the time you need..</div><div><br></div><div>Cheers,</div><div><br></div><div>Kishore</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote"><div><div class="h5">On Mon, Jan 7, 2013 at 5:49 PM, 2008 duan <span dir="ltr"><<a href="mailto:duan.scut.cn@gmail.com" target="_blank">duan.scut.cn@gmail.com</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 class="h5">
Dear Everyone,<div><br></div><div> Happy New Year!</div><div><br></div><div> Now I have a question to ask you. Thank you very much!</div><div><br></div><div> <font style="line-height:17px;color:rgb(34,34,34);white-space:pre-wrap;font-family:arial,helvetica,sans-serif">'</font><font style="line-height:17px;color:rgb(34,34,34);white-space:pre-wrap;font-family:arial,helvetica,sans-serif">reinit</font><font style="line-height:17px;color:rgb(34,34,34);white-space:pre-wrap;font-family:arial,helvetica,sans-serif">'</font><pre style="color:rgb(34,34,34);white-space:pre-wrap">
<font face="arial, helvetica, sans-serif"><font style="line-height:17px"><font>'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1981.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1982.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1983.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1984.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1985.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1986.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1987.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1988.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1989.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1990.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1991.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1992.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1993.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1994.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1995.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1996.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1997.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1998.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>1999.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2000.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2001.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2002.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2003.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2004.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2005.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2006.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2007.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2008.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2009.</font><font>nc'
'</font><font>sdfopen</font><font> </font><font>D</font><font>:\TDDOWNLOAD\hgt.</font><font>2010.</font><font>nc'
'</font><font>set</font><font> </font><font>mpdset</font><font> </font><font>hires</font><font>'</font><font>
yr</font><font>=</font><font>1981</font><font>
while</font><font>(</font><font>yr</font><font><=</font><font>2010</font><font>)</font><font>
*******************************************************
*Standard deviation will be caculated</font><font>
'</font><font>set</font><font> </font><font>lat</font><font> </font><font>0</font><font> </font><font>50.5</font><font>'
'</font><font>set</font><font> </font><font>lon</font><font> </font><font>119.5</font><font> </font><font>179.5</font><font>'
'</font><font>define</font><font> </font><font>mean</font><font>=</font><font>ave</font><font>(hgt.'</font><font>yr</font><font>',</font><font>time</font><font>=01JAN'</font><font>yr</font><font>',</font><font>time</font><font>=31DEC'</font><font>yr</font><font>')'
'</font><font>define</font><font> sd=</font><font>sqrt</font><font>(</font><font>ave</font><font>(</font><font>pow</font><font>(hgt.'</font><font>yr</font><font>'-</font><font>mean</font><font>,</font><font>2</font><font>),</font><font>time</font><font>=01JAN'</font><font>yr</font><font>',</font><font>time</font><font>=31DEC'</font><font>yr</font><font>'))'</font><font>
*********************************************************
*This is a skill to plot a </font><font>shaded</font><font> </font><font>map</font><font> with </font><font>contour</font><font> </font><font>on</font><font> it </font><font>
'</font><font>set</font><font> </font><font>grads</font><font> </font><font>off</font><font>'
'</font><font>set</font><font> </font><font>gxout</font><font> </font><font>shaded</font><font>'
'</font><font>d</font><font> sd'
'cbarn'
'</font><font>set</font><font> </font><font>gxout</font><font> </font><font>contour</font><font>'
'</font><font>set</font><font> </font><font>cthick</font><font> </font><font>5</font><font>'
'</font><font>d</font><font> sd'
'</font><font>draw</font><font> </font><font>title</font><font> Standard Deviation of '</font><font>yr</font><font>' '
'</font><font>printim</font><font> </font><font>D</font><font>:\TDDOWNLOAD\'</font><font>yr</font><font>'.png x1000 y800 white'
'</font><font>c</font><font>'</font><font>
yr</font><font>=</font><font>yr</font><font>+</font><font>1</font><font>
endwhile</font><font>
;</font></font>
</font></pre><pre style="color:rgb(34,34,34);white-space:pre-wrap"><font style="line-height:17px"><font face="arial, helvetica, sans-serif">I donot know where are the wrongs. I want to figure out the mean and SD between 1981 to 2010.</font></font></pre>
<pre style="color:rgb(34,34,34);white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><span style="line-height:17px">I want to ask how to combine the files containing <a href="http://hgt.1981.nc" target="_blank">hgt.1981.nc</a> to <a href="http://hgt.2010.nc" target="_blank">hgt.2010.nc</a>. If it is a single file, I think it is easy to figure out the mean and SD.</span></font></pre>
<pre style="color:rgb(34,34,34);white-space:pre-wrap"><font face="arial, helvetica, sans-serif"><span style="line-height:17px">Thank you everyone!</span></font></pre><span><font color="#888888"><div><br></div>
-- <br>
Weili Duan<br>Disaster Prevention Research Institute (DPRI), Kyoto University, Uji, Kyoto 611-0011, Japan<br>TEL: <a href="tel:%2B81-774-38-4131" value="+81774384131" target="_blank">+81-774-38-4131</a> FAX: <a href="tel:%2B81-774-38-4130" value="+81774384130" target="_blank">+81-774-38-4130</a><br>
E-mail: <a href="mailto:duan.scut.cn@gmail.com" target="_blank">duan.scut.cn@gmail.com</a><br>
<a href="mailto:dyuan.weiri.88r@st.kyoto-u.ac.jp" target="_blank">duanwl1986@flood.dpri.kyoto-u.ac.jp</a><a href="mailto:dyuan.weiri.88r@st.kyoto-u.ac.jp" target="_blank"></a>
</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">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>