@BeginModule
@NewPage
@Name      = Remapnn
@Title     = Nearest neighbor remapping
@Section   = Interpolation
@Class     = Interpolation
@Arguments = ifile ofile
@Operators = remapnn gennn

@BeginDescription
This module contains operators for a nearest neighbor remapping of fields between grids
in spherical coordinates.
@IfDoc
Below is a schematic illustration of the nearest neighbor remapping:

\vspace{1mm}

\includegraphics[width=\textwidth]{remapnn.pdf}

\vspace{1mm}

The figure on the left side shows the input data on a regular lon/lat source grid and on the right side
the remapped result on an unstructured triangular target grid. The figure in the middle shows the input data with
the target grid. Grid cells with missing value are grey colored.
@EndifDoc
@EndDescription
@EndModule


@BeginOperator_remapnn
@Name      = remapnn
@Title     = Nearest neighbor remapping
@Parameter = grid

@BeginDescription
Performs a nearest neighbor remapping on all input fields.
@EndDescription
@EndOperator


@BeginOperator_gennn
@Name      = gennn
@Title     = Generate nearest neighbor remap weights
@Parameter = grid

@BeginDescription
Generates nearest neighbor remapping weights for the first input field and writes the result to a file.
The format of this file is NetCDF following the SCRIP convention.
Use the operator @mod{remap} to apply this remapping weights to a data file with the same source grid.
@EndDescription
@EndOperator


@BeginParameter
@Item = grid
STRING  Target grid description file or name
@EndParameter


@BeginEnvironment
@Item = REMAP_EXTRAPOLATE
This variable is used to switch the extrapolation feature 'on' or 'off'.
By default the extrapolation is enabled for this remapping method.
@Item = CDO_GRIDSEARCH_RADIUS
Grid search radius in degree, default 180 degree.
@EndEnvironment
