[Thread Prev][Thread Next][Index]

Re: [ferret_users] How to combine files ???

Hi Vinu,
         If you want to combine the NetCDF files decomposed
on latitude, then (assuming the individual NetCDF files are
on proper latitude axis)

 1. define the destination latitude axis 

      yes? define axis/y=-90:90:1/units=latitudes ylat ! 181 points

 2  Assign the destination grid to the variables as follows,

      yes? let temp_1 = temp[d=1,gy=ylat]

 3  Identify the start and end J, on 'ylat' axis, according
      to each input NetCDF file (ie. from first processor 
      owards). Let it be J=1:20, then open a new file as

      yes? sp rm -f ncout.nc
      yes? save/file=ncout.nc/JLIMITS=1:181/J=1:20/CLOBBER temp_1
 4  Close the first input file. Open the second input file then,
      (assuming J for this file is 21:40)

      yes? cancel data 1
      yes? set data inputncfile2.nc.0001
      yes? let temp_1 = temp[d=1,gy=ylat]
      yes? save/file=ncout.nc/J=21:40/APPEND temp_1

 5 Repeat step 4 for other remaining input files.

If the number of input files and variables in each input files 
are large, this method is not at all feasible. In this case you
can try using the mppnccombine.c distributed with MOM4p0 code,
(https://fms.gfdl.noaa.gov/) from GFDL. Which is fairly complex 
enough to handle a wide range of input files. But you may have 
to modify it, to suit for your input files.

Hope this helps,



On Wed, 4 Oct 2006, Vinu K. V. wrote:

> Hi Ferreters,
> 	A parallel run produces out put as pieces (netcdf), 
> each file contains a portion of latitude. How can one combine
> this individual files into one single file of entire
> latitudes ?
> For example,
> 10 files are produced, each file containing output 
> for a portion of latitudes, say, -90  to -80, -80 to -70 and so on.
> I have tried save/file=my_file.nc/append over a dummy 
> file, whose grid is defined for entire globe, but didnt work.
> I suppose there are other methods exist in Ferret to
> do this properly.
> Please help me to find a solution. Thanks in advance
> -Vinu

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement