@BeginModule
@NewPage
@Name      = Setbox
@Title     = Set a box to constant
@Section   = Modification
@Class     = Modification
@Arguments = ifile ofile
@Operators = setclonlatbox setcindexbox

@BeginDescription
Sets a box of the rectangular understood field to a constant value. 
The elements outside the box are untouched, the elements inside are 
set to the given constant. All input fields need to have the same 
horizontal grid.
@EndDescription
@EndModule


@BeginOperator_setclonlatbox
@Title     = Set a longitude/latitude box to constant
@Parameter = c lon1 lon2 lat1 lat2

@BeginDescription
Sets the values of a longitude/latitude box to a constant value. The 
user has to give the longitudes and latitudes of the edges of the box.
@EndDescription
@EndOperator


@BeginOperator_setcindexbox
@Title     = Set an index box to constant
@Parameter = c idx1 idx2 idy1 idy2

@BeginDescription
Sets the values of an index box to a constant value. The user has to 
give the indexes of the edges of the box. The index of the left edge 
can be greater than the one of the right edge.
@EndDescription
@EndOperator


@BeginParameter idx1
@Item = c
FLOAT    Constant
@Item = lon1
FLOAT    Western longitude
@Item = lon2
FLOAT    Eastern longitude
@Item = lat1
FLOAT    Southern or northern latitude
@Item = lat2
FLOAT    Northern or southern latitude
@Item = idx1
INTEGER  Index of first longitude
@Item = idx2
INTEGER  Index of last longitude
@Item = idy1
INTEGER  Index of first latitude
@Item = idy2
INTEGER  Index of last latitude
@EndParameter


@BeginExample
To set all values in the region with the longitudes from 120E to 90W and
latitudes from 20N to 20S to the constant value -1.23 use:
@BeginVerbatim
   cdo setclonlatbox,-1.23,120,-90,20,-20 ifile ofile
@EndVerbatim
If the input dataset has fields on a Gaussian N16 grid, the same box can
be set with @oper{setcindexbox} by:
@BeginVerbatim
   cdo setcindexbox,-1.23,23,48,13,20 ifile ofile
@EndVerbatim
@EndExample
