PUBLIC INTERFACE ~ PUBLIC DATA ~ PUBLIC ROUTINES ~ NAMELIST ~ DIAGNOSTIC FIELDS ~ ERROR MESSAGES ~ REFERENCES ~ NOTES

Program regrid

Contact:  Zhi Liang
Reviewers: 
Change History: WebCVS Log


OVERVIEW

Since most analyses are placed on a spherical latitude-longitude grid and most global ocean models configured from mom4 are run with tripolar grids. A regridding tool is needed to regrid data from tripolar grid onto latitude-longitude grid. This program map data from any logical rectangular grid (tripolar or latitude-longitude) to a spherical latitude-longitude grid. When the data is on Tracer cell (T-cell), the interpolation will be a conservative scheme. When the data is on other position (C-cell, E-cell or N-cell), regridding is accomplished non-conservatively using a nearest neighbor distance weighting algorithm.

Before using this regridding tool, you need to use preprocessing tool make_xgrids to generate the grid file which contains source grid, destination grid and exchange grid information between source grid and destination grid. These exchange grid information is needed when doing conservative remapping. Suppose the file name of your source grid is src_grid.nc and the file name of your destination grid is dst_grid.nc (dst grid should be spherical latitude-lontitude grid), the command will be "make_xgrids -o src_grid.nc -a dst_grid.nc". Before using make_xgrids, you need to make sure src_grid.nc does not contain any exchange grid information. Otherwise you are not going to get the desired exchange grid information. If your src_grid.nc do contains exchange grid information, you can remove all those fields by using ncks. Those fields are AREA_ATMxOCN, DI_ATMxOCN, DJ_ATMxOCN, I_ATM_ATMxOCN, J_ATM_ATMxOCN, I_OCN_ATMxOCN, J_OCN_ATMxOCN, AREA_ATMxLND, DI_ATMxLND, DJ_ATMxLND, I_ATM_ATMxLND, J_ATM_ATMxLND, I_LND_ATMxLND, J_LND_ATMxLND, AREA_LNDxOCN, DI_LNDxOCN, DJ_LNDxOCN, I_LND_LNDxOCN, J_LND_LNDxOCN, I_OCN_LNDxOCN, J_OCN_LNDxOCN, xba, yba, xta, yta, AREA_ATM, xbl, ybl, xtl, ytl, AREA_LND, AREA_LND_CELL, xto, yto and AREA_OCN. After the grid file is generated, the grid file should be passed into the program through nml option "grid_spec_file".

This program expects to read data from a netcdf file, which is specfied by the namelist variable "src_data". The number of data to be remapped is specified by num_flds. The name of field to be remapped is specified by the namelist variable "fld_name". The output file is a netcdf file specified by the namelist variable "dst_data". Each field can be a scalar variable or a vector field, which is specified by vector_fld. The vector field should always be paired together. The data will be always on the source vertical grid. Previous experiences show that linear vertical interpolation will create lots of noises. If we find better vertical interpolation algorithm, we may implement it in the future.


MODULES USED

         mpp_mod
mpp_domains_mod
fms_mod
fms_io_mod
constants_mod
horiz_interp_mod

PUBLIC INTERFACE



PUBLIC DATA

None.


PUBLIC ROUTINES


    NAMELIST

    &regrid_nml

    num_flds
    Number of fields.
    [integer, default: 0]
    src_data
    Name of input file containing to-be-remapped data.
    [character(len=128)]
    dst_data
    Name of output file containing after-remapped data.
    [character(len=128)]
    grid_spec_file
    Name of grid descriptor file containing source and target grid information, exchange grid information between source and target grid. This grid file can be created using preprocessing tool make_xgrids.
    [character(len=128)]
    fld_name
    Name of field to be regridded in input file.
    [character(len=128), dimension(max_flds)]
    fld_pos
    Name of grid where the field located. Valid choices are (T)racer, (C)orner, (E)ast and (N)orth.
    [character(len=1),dimension(max_flds), default: T]
    vector_field
    True if fields are vector components. All the vector field should be paired together. That is, if vector_field(n) is .true., then vector_field(n+1) should be true.
    [logical,dimension(max_flds), default: False]
    num_nbrs
    Number of nearest neighbors for regridding.
    [integer]
    max_dist
    Maximum region of influence around destination grid points.
    [real, units: radians]
    debug
    For Debugging. Set true to print out chksum information for debugging reproducing ability accross processors. default is false.
    [logical]


    DATA SETS

    None.


    ERROR MESSAGES

    None.


    top