[gradsusr] Daily data to monthly data
Roger Rodrigues Torres
torres.fisico at gmail.com
Tue Sep 23 15:31:07 EDT 2014
Dear Ipshita Majhi,
one very simple way to do this is using the Climate Data Operators (CDO)
software, freely available on https://code.zmaw.de/projects/cdo.
Once installed, you just need to type in your linux terminal:
cdo monmean filein fileout
Regards,
Roger Torres
Prof. Dr. Roger Rodrigues Torres
Universidade Federal de Itajubá - Unifei
Instituto de Recursos Naturais - IRN
Curriculum Lattes: http://lattes.cnpq.br/5641165392004404
Webpage: http://rtorres.webnode.com.br
2014-09-23 16:25 GMT-03:00 Ipshita Majhi <ipmajhi at alaska.edu>:
> Dear Grad users,
>
> 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
>
> *************************************************************************************************
> *Date 09/23/2014
> *This script is to convert daily values to monthly values for different
> years which starts from 1901
> * and ends in 2010
>
> **************************************************************************************************
>
> 'reinit'
> mday = '31 28 31 30 31 30 31 31 30 31 30 31'
> month = 'jan feb mar apr may jun jul aug sep oct nov dec'
>
> 'open prec.mean.imr'
>
>
> 'set gxout fwrite'
> 'set fwrite outputfile'
>
> yr1 = 1901
> yr2 = 2010
>
> yr = yr1
> while(yr<=yr2)
>
> leap = 0
> if(math_mod(yr,400) = 0 | math_mod(yr,4) = 0 & math_mod(yr,100) != 0)
>
> leap = 1
>
> say yr' is a leap year.'
> endif
>
> imon = 1
> while(imon <= 12)
> md = subwrd(mday,imon)
> mc = subwrd(month,imon)
> if(imon = 2); md = md + leap; endif;
> time1 = '01'mc''yr
> time2 = md''mc''yr
>
> ' month_avg= ave(p,time='time1',time='time2')'
> imon = imon + 1
> endwhile
> yr = yr + 1
> endwhile
>
> return(month_avg)
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140923/2d201581/attachment.html
More information about the gradsusr
mailing list