[MITgcm-support] combining netcdf files

Ed Hill ed at eh3.com
Mon Apr 3 23:47:14 EDT 2006


On Mon, 2006-04-03 at 22:00 +0200, mlosch at awi-bremerhaven.de wrote:
> Hi there,
> 
> is there currently an alternate to mnc_assembly.m for combining mnc-netcdf files from N-processors into a single file. For 
> quick diagnostics I do not want to copy all large files from a particular run to a machine where I do have matlab available, 
> but instead I would like, for example, to extract a certain time slab from the netcdf files (which I can with nco or cdo, right?) 
> and possibly combine them into a single netcdf file, contains  the global fields for that particular time slab only, everything 
> preferably in a script. That file, I would be abloe to copy quickly to a machine where I can actually look at the data.
> 
> Is there a tool that does that (other than mnc_assembly)?

Hi Martin,

There are a few different ways you can do the above.  Probably the
quickest is to write a short shell script using either NCO or CDO
commands to extract the one desired time level from each of the per-tile
files:

  for name in state.0000000000.t%03d.nc  \
              phiHyd.0000000000.t%03d.nc ; do
    for i in 1 2 3 4 5 6 ; do
      nm=`printf $name $i`
      echo $nm
      ncks -d T,10 $nm T10_${nm}
    done
  done

and then copy them over to a mcahine with matlab and use mnc_assembly()
to assemble them into the per-face format.  And I'm sure there is a
similar command within cdo.

If you'd like help building either nco or cdo for one of your machines
then send me an email and I'll do what I can.

Ed

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464




More information about the MITgcm-support mailing list