@BeginModule
@NewPage
@Name      = Remap
@Title     = Grid remapping
@Section   = Interpolation
@Class     = Interpolation
@Arguments = ifile ofile
@Operators = remap
@EndModule


@BeginOperator_remap
@Title     = Grid remapping
@Parameter = grid weights

@BeginDescription
Interpolation between different horizontal grids can be a very time-consuming 
process. Especially if the data are on an unstructured and/or a large grid. 
In this case the interpolation process can be split into two parts.
Firstly the generation of the interpolation weights, which is the most time-consuming part.
These interpolation weights can be reused for every remapping process with the operator @mod{remap}.
This operator remaps all input fields to a new horizontal grid. The remap type and 
the interpolation weights of one input grid are read from a NetCDF file. More weights 
are computed if the input fields are on different grids. The NetCDF file with the 
weights should follow the @ref{SCRIP} convention. Normally these weights come from a previous
call to one of the genXXX operators (e.g. @mod{genbil}) or were created by the original SCRIP package.
@EndDescription
@EndOperator


@BeginParameter
@Item = grid
STRING  Target grid description file or name
@Item = weights
STRING  Interpolation weights (SCRIP NetCDF file)
@EndParameter


@BeginEnvironment
@Item = CDO_REMAP_NORM
This variable is used to choose the normalization of the conservative interpolation. 
By default @env{CDO_REMAP_NORM} is set to 'fracarea'. 'fracarea' uses the sum of the
non-masked source cell intersected areas to normalize each target cell field value.
This results in a reasonable flux value but the flux is not locally conserved.
The option 'destarea' uses the total target cell area to normalize each target cell
field value. Local flux conservation is ensured, but unreasonable flux values may result.
@Item = REMAP_EXTRAPOLATE
This variable is used to switch the extrapolation feature 'on' or 'off'.
By default the extrapolation is enabled for remapdis, remapnn and for circular grids.
@Item = REMAP_AREA_MIN
This variable is used to set the minimum destination area fraction. The default
of this variable is 0.0.
@Item = CDO_GRIDSEARCH_RADIUS
Grid search radius in degree, default 180 degree.
@EndEnvironment


@BeginExample
Say @file{ifile} contains fields on a quadrilateral curvilinear grid.
To remap all fields bilinear to a Gaussian N32 grid use:
@BeginVerbatim
   cdo genbil,n32 ifile remapweights.nc
   cdo remap,n32,remapweights.nc ifile ofile
@EndVerbatim
The result will be the same as:
@BeginVerbatim
   cdo remapbil,n32 ifile ofile
@EndVerbatim
@EndExample
