Re: nc file average

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Wed May 18 2011 - 10:17:53 MDT

Use the CDO for many files and many variables.
====

CDO: Download and read the documentation at:
      www.mpimet.mpg.de/fileadmin/software/cdo/cdo.pdf

          cdo daymean in.nc out.nc

Please, *do not* send CDO related questions to ncl-talk.
ncl-talk *does not* support the CDO.

Send all CDO related questions to the URLs listed at
      https://code.zmaw.de/projects/cdo

=======================================================
NCL:

    x3 = f->X ; (time,lat,lon) time is 3-hrly
    dimx3 = dimsizes(x3)
    ntim3 = dimx3(0)

    nsd = 8 ; number of samples per day

    xday = x3(::nsd,:,:) ; create array with meta data

    do nt=0,ntim3-1,nsd
       xday(nt/nsd,:,:) = (/ dum_avg_n(nt:nt+nsd-1,:,:) /)
    end do

    diro = "./" ; output directory
    filo = "day.nc"
    system ("/bin/rm -f "+diro+filo)
    fnc = addfile (diro+filo, "c")

    filAtt = 0
    filAtt@title = "..."
    filAtt@Conventions = "None"
    filAtt@creation_date = systemfunc("date")
    fileattdef( fnc, filAtt ) ; create file attributes

    filedimdef(ncdf,"time",-1,True) ; make time UNLIMITED
    fnc->XDAY = xday

On 05/18/2011 07:16 AM, donggt wrote:
> Hello , is there any method in ncl or in nco to convert a 3 hourly nc
> file to daily nc file ? Thank you !

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed May 18 10:19:21 2011

This archive was generated by hypermail 2.1.8 : Wed May 25 2011 - 09:35:33 MDT