[Thread Prev][Thread Next][Index]

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



Hi Vinu,
         Ideally, the method i suggested should work fine,
here is an example :

    define axis/y=-90:90:1/units=latitudes   ybig
    define axis/y=-80:-70:1/units=latitudes  ysmall
    let var     = SIN(y[gy=ysmall])
    let var_big = var[gy=ybig]
    list var
    list/j=1:30 var_big

You can check at each step of your script to know exactly
from where the missing value problem occurs. If the latitude
values on the source and destination Y-axis are the same,
then there is no need for any regridding (eg. @NRST) which
will take extra time.

 Try to list the values of readed-in variable and new variable
created in Ferret (on YLAT axis) and track down the problem.

Regards,

Jaison 


On Thu, 5 Oct 2006, Dr. Vinu K. Valsala wrote:

> Hi Jaison,
> 
> Thank you for your reply.
> 
> The method works fine. But, there is one missing
> value at each file boundaries in the combined 
> netcdf file. See the following table. The individual
> files have values for all latitudes but one value
> is missing in the combined netcdf file at each file boundaries.
> 
> 
> 2-Individual files          combined netcdf file.
> ===================         ====================
> 22.5S / 8: -1.403  ---->    22.5S / 24:   ....
> 25.3S / 7: -0.184           25.3S / 23:  -0.18
> 28.1S / 6:  0.336           28.1S / 22:   0.34
> 30.9S / 5:  0.789           30.9S / 21:   0.79
> 33.8S / 4:  1.653           33.7S / 20:   1.65
> 36.6S / 3:  3.538           36.6S / 19:   3.54
> 39.4S / 2:  5.956           39.4S / 18:   5.96
> 42.2S / 1:  7.314           42.2S / 17:   7.31
> 45S   / 8:  8.121  ---->    45S   / 16:   ....
> 47.8S / 7:  7.605           47.8S / 15:   7.60
> 50.6S / 6:  6.409           50.6S / 14:   6.41
> 53.4S / 5:  5.032           53.4S / 13:   5.03
> 56.2S / 4:  3.785           56.2S / 12:   3.79
> 59.1S / 3:  2.822           59.1S / 11:   2.82
> 61.9S / 2:  2.421           61.9S / 10:   2.42
> 64.7S / 1:  3.052           64.7S /  9:   3.05
> 
> 
> The steps I used are here,
> 
> yes? use snapshots.000051.01.01.dta.nc.0000
> yes? define axis/y=-87.187:90.:2.8125/units=latitudes ylat
> yes? let u_model = u[d=1,gy=ylat]
> yes? sp rm n1n.nc
> yes? save/file=n1n.nc/JLIMITS=1:64/J=1:8/clobber u_model
> yes? cancel data 1
> yes? use snapshots.000051.01.01.dta.nc.0001
> yes? let u_model = u[d=1,gy=ylat]
> yes? save/file=n1n.nc/J=9:16/append u_model
> 
> .... and so on.
> 
> 
> NOTE
> The missing value fills correctly when I use @nrst regridding
> mode. i.e.  let u_model = u[d=1,gy=ylat@nrst]
> So, is that necessary to put @nrst on regridding?
> 
> Thanks in advance,
> -Vinu
> 
> 
> 
> 
> 
> 
> 
> On Wed, 2006-10-04 at 22:09 +0530, Jaison Kurian wrote:
> > 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,
> > 
> > Regards,
> > 
> > Jaison
> > 
> > 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