[ncl-talk] Daily mean to monthly mean

Kunal Bali kunal.bali9 at gmail.com
Mon Mar 11 00:01:14 MDT 2019


Try this


              f = addfile("*inputfile*.nc","r")
              x = f->*variable_name*
              printVarSummary(x)

              opt = True
              opt at nval_crit = 12   ; require at least 12 values for the
"avg" is calculated.

              xMon = *calculate_monthly_values* (x, "avg", 0,opt)  ;
convert daily to monthly
              printVarSummary(xMon)

             ; for generating output in netcdf if it is required
              diro = "./"
              filo = "merge2.nc"
              ncdf = addfile(diro+filo ,"c")
              filedimdef(ncdf,"time",-1,True)
              ncdf->xMon=xMon


---
Kunal Bali






On Mon, Mar 11, 2019 at 11:00 AM Soma Roy <somaroy892 at gmail.com> wrote:

> Hello,
> I have 1980 to 2005 daily JJAS (122 days) data in a file..from that I want
> to calculate monthly means for each year in ncl (not CDO) so that output
> file will be 104 (ntime), nlat, nlon.
>
> Which function should I use in ncl to get the above output?
>
>
> Thanks,
> Soma
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190311/c4f18d45/attachment.html>


More information about the ncl-talk mailing list