<div dir="ltr"><div><div><div><div>Dear<span style="font-weight:normal"><span name="Ipshita Majhi" class=""> Ipshita Majhi,<br><br></span></span></div><span style="font-weight:normal"><span name="Ipshita Majhi" class="">one very simple way to do this is using the Climate Data Operators (CDO) software, freely available on <a href="https://code.zmaw.de/projects/cdo">https://code.zmaw.de/projects/cdo</a>.<br><br></span></span></div><span style="font-weight:normal"><span name="Ipshita Majhi" class="">Once installed, you just need to type in your linux terminal:<br><br></span></span></div><span style="font-weight:normal"><span name="Ipshita Majhi" class="">cdo monmean filein fileout<br><br><br></span></span></div><span style="font-weight:normal"><span name="Ipshita Majhi" class="">Regards,<br>Roger Torres</span></span> <span class=""><span></span></span></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">Prof. Dr. Roger Rodrigues Torres<br><div>Universidade Federal de Itajubá - Unifei</div><div>Instituto de Recursos Naturais - IRN</div><div>Curriculum Lattes: <a href="http://lattes.cnpq.br/5641165392004404" target="_blank">http://lattes.cnpq.br/5641165392004404</a><br></div><div>Webpage: <a href="http://rtorres.webnode.com.br" target="_blank">http://rtorres.webnode.com.br</a><br></div></div></div>
<br><div class="gmail_quote">2014-09-23 16:25 GMT-03:00 Ipshita Majhi <span dir="ltr"><<a href="mailto:ipmajhi@alaska.edu" target="_blank">ipmajhi@alaska.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Grad users,<br><br>I am trying to convert daily data to monthly data and I am getting error which says unknown command for averaging. I will attach the data file and ctl as well. It will be great if someone could help me. Thank You<br>*************************************************************************************************<br>*Date 09/23/2014<br>*This script is to convert daily values to monthly values for different years which starts from 1901 <br>* and ends in 2010<br>**************************************************************************************************<br><br>'reinit'<br>mday = '31 28 31 30 31 30 31 31 30 31 30 31'<br>month = 'jan feb mar apr may jun jul aug sep oct nov dec'<br><br>'open prec.mean.imr'<br><br><br>'set gxout fwrite'<br>'set fwrite outputfile'<br><br> yr1 = 1901<br> yr2 = 2010<br><br> yr = yr1<br> while(yr<=yr2)<br><br> leap = 0<br> if(math_mod(yr,400) = 0 | math_mod(yr,4) = 0 & math_mod(yr,100) != 0)<br><br> leap = 1<br><br> say yr' is a leap year.'<br>endif<br><br> imon = 1<br> while(imon <= 12)<br> md = subwrd(mday,imon)<br> mc = subwrd(month,imon)<br> if(imon = 2); md = md + leap; endif;<br> time1 = '01'mc''yr<br> time2 = md''mc''yr<br><br> ' month_avg= ave(p,time='time1',time='time2')'<br> imon = imon + 1<br> endwhile<br> yr = yr + 1<br> endwhile<br><br>return(month_avg)<br><br><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></div>