@BeginModule
@NewPage
@Name      = Yearstat
@Title     = Yearly statistical values
@Section   = Statistical values
@Class     = Statistic
@Arguments = ifile ofile
@Operators = yearmin yearmax yearsum yearmean yearavg yearvar yearstd

@BeginDescription
This module computes statistical values over time steps of the same year.
Depending on the actual operator the minimum, maximum, sum, average, variance
or standard deviation of time steps of the same year is written to @file{ofile}.
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_yearmin
@Title     = Yearly minimum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = min{i(t',x), t_1<t'<=t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf min}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearmax
@Title     = Yearly maximum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = max{i(t',x), t_1<t'<=t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf max}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearsum
@Title     = Yearly sum

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = sum{i(t',x), t_1<t'<=t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf sum}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearmean
@Title     = Yearly mean

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = mean{i(t',x), t_1<t'<=t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf mean}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearavg
@Title     = Yearly average

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = avg{i(t',x), t_1<t'<=t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf avg}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearvar
@Title     = Yearly variance

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = var{i(t',x), t_1 < t' <= t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf var}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_yearstd
@Title     = Yearly standard deviation

@BeginDescription
@IfMan
For every adjacent sequence t_1, ...,t_n of time steps of the same year it is

o(t,x) = std{i(t',x), t_1 < t' <= t_n}
@EndifMan
@IfDoc
For every adjacent sequence \begin{math}t_1, ...,t_n\end{math} of time steps of the same year it is: \\
@BeginMath
o(t,x) = \mbox{\bf std}\{i(t',x), t_1 < t' \leq t_n\}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginNote
The operators yearmean and yearavg compute only arithmetical means!
@EndNote


@BeginExample
To compute the yearly mean of a time series use:
@BeginVerbatim
   cdo yearmean ifile ofile
@EndVerbatim
To compute the yearly mean from the correct weighted monthly mean use:
@BeginVerbatim
   cdo mulc,12 -divdpy -yearmean -muldpm ifile ofile
@EndVerbatim
@EndExample
