@BeginModule
@NewPage
@Name      = EcaHd
@Title     = Heating degree days
@Section   = ECA indices
@Class     = ECA index
@Arguments = ifile ofile
@Operators = eca_hd

@BeginDescription
Let @file{ifile} be a time series of daily mean temperatures TG, then
the heating degree days are defined as the sum of T1 - TG, where only
values TG < T2 are considered. If T1 and T2 are omitted, a temperature
of 17° Celsius is used for both parameters. If only T1 is given, T2 is
set to T1. Note that TG must be given in units of kelvin.
The date information for a time step in @file{ofile} is the date of
the last contributing time step in @file{ifile}.
@EndDescription
@EndModule


@BeginOperator_eca_hd
@Title     = Heating degree days
@Parameter = [T1] [T2]
@EndOperator


@BeginParameter
@Item = T1
FLOAT   Temperature limit (° Celsius, default: T1 = 17° Celsius)
@Item = T2
FLOAT   Temperature limit (° Celsius, default: T2 = T1)
@EndParameter


@BeginExample
To compute the heating degree days for a time series of daily
mean temperatures, use:
@BeginVerbatim
   cdo eca_hd tgfile ofile
@EndVerbatim
@EndExample
