@BeginModule
@NewPage
@Name      = Remapbic
@Title     = Bicubic interpolation
@Section   = Interpolation
@Class     = Interpolation
@Arguments = ifile ofile
@Operators = remapbic genbic

@BeginDescription
This module contains operators for a bicubic remapping of fields between grids in spherical coordinates.
The interpolation is based on an adapted SCRIP library version. 
For a detailed description of the interpolation method see @cite{SCRIP}.
This interpolation method only works on quadrilateral curvilinear source grids.
@IfDoc
Below is a schematic illustration of the bicubic remapping:

\vspace{1mm}

\includegraphics[width=\textwidth]{remapbic.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_remapbic
@Name      = remapbic
@Title     = Bicubic interpolation
@Parameter = grid

@BeginDescription
Performs a bicubic interpolation on all input fields.
@EndDescription
@EndOperator


@BeginOperator_genbic
@Name      = genbic
@Title     = Generate bicubic interpolation weights
@Parameter = grid

@BeginDescription
Generates bicubic interpolation 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 circular grids.
@EndEnvironment


@BeginExample
Say @file{ifile} contains fields on a quadrilateral curvilinear grid.
To remap all fields bicubic to a Gaussian N32 grid, type:
@BeginVerbatim
   cdo remapbic,n32 ifile ofile
@EndVerbatim
@EndExample
