@BeginModule
@NewPage
@Name      = EcaGsl
@Title     = Thermal Growing season length index
@Section   = Climate indices
@Class     = Climate index
@Arguments = ifile1 ifile2 ofile
@Operators = eca_gsl

@BeginDescription
Let @file{ifile1} be a time series of daily mean temperatures TG,
and @file{ifile2} be a land-water mask.
Within a period of 12 months, the thermal growing season length is officially defined as the number of days between:
@BeginItemize
@Item = frist occurrence of at least nday consecutive days with TG $>$ T within the first 6 months
@Item = first occurrence of at least nday consecutive days with TG $<$ T within the last 6 months
@EndItemize
On northern hemispere, this period corresponds with the regular year, whereas
on southern hemispere, it starts at july $1^{st}$. Please note, that this
definition may lead to weird results concerning values TG = T: In the first
half of the period, these days do not contribute to the gsl, but they do within the second half.

The numbers nday and T are optional parameter with default nday = 6
and T = 5 @celsius. The number fland is an optional parameter with
default value fland = 0.5 and denotes the fraction of a grid point that
have to be covered by land in order to be included in the calculation. A
further output variable is the start day of year of the growing season.
Note that TG have to be given in units of Kelvin, whereas T have to be given
in degrees Celsius.

The date information of a time step in @file{ofile} is the date of
the last contributing time step in @file{ifile}.
@EndDescription
@EndModule


@BeginOperator_eca_gsl
@Title     = Growing season length index
@Parameter = [nday] [T] [fland]
@EndOperator


@BeginParameter
@Item = nday
INTEGER  Number of consecutive days (default: nday = 6)
@Item = T
DOUBLE   Temperature threshold (degree Celsius, default: T = 5° Celsius)
@Item = fland
DOUBLE   Land fraction threshold (default: fland = 0.5)
@EndParameter


@BeginExample
To get the growing season length of a time series of daily
mean temperatures use:
@BeginVerbatim
   cdo eca_gsl tgfile maskfile ofile
@EndVerbatim
@EndExample
