@BeginModule
@NewPage
@Name      = Ydaystat
@Title     = Multi-year daily statistical values
@Section   = Statistical values
@Class     = Statistic
@Arguments = ifile ofile
@Operators = ydaymin ydaymax ydaysum ydaymean ydayavg ydaystd ydaystd1 ydayvar ydayvar1

@BeginDescription
This module computes statistical values of each day of year.
Depending on the chosen operator the minimum, maximum, sum, average, variance
or standard deviation of each day of year in @file{ifile} is written to @file{ofile}.
The date information in an output field is the date of the last contributing input field.
@EndModule


@BeginOperator_ydaymin
@Title     = Multi-year daily minimum

@BeginDescription
@IfMan
o(001,x) = min{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = min{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf min}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf min}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydaymax
@Title     = Multi-year daily maximum

@BeginDescription
@IfMan
o(001,x) = max{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = max{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf max}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf max}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydaysum
@Title     = Multi-year daily sum

@BeginDescription
@IfMan
o(001,x) = sum{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = sum{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf sum}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf sum}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydaymean
@Title     = Multi-year daily mean

@BeginDescription
@IfMan
o(001,x) = mean{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = mean{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf mean}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf mean}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydayavg
@Title     = Multi-year daily average

@BeginDescription
@IfMan
o(001,x) = avg{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = avg{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf avg}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf avg}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydayvar
@Title     = Multi-year daily variance

@BeginDescription
Normalize by n. 

@IfMan
o(001,x) = var{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = var{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf var}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf var}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydayvar1
@Title     = Multi-year daily variance (n-1)

@BeginDescription
Normalize by (n-1). 

@IfMan
o(001,x) = var1{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = var1{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf var1}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf var1}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydaystd
@Title     = Multi-year daily standard deviation

@BeginDescription
Normalize by n. 

@IfMan
o(001,x) = std{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = std{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf std}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf std}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginOperator_ydaystd1
@Title     = Multi-year daily standard deviation (n-1)

@BeginDescription
Normalize by (n-1). 

@IfMan
o(001,x) = std1{i(t,x), day(i(t)) = 001}
                 ...
o(366,x) = std1{i(t,x), day(i(t)) = 366}
@EndifMan
@IfDoc
@BeginMath
\begin{array}{c}
o(\mbox{001},x) = \mbox{\bf std1}\{i(t,x), \mbox{day}(i(t)) = \mbox{001}\} \\
\vdots \\
o(\mbox{366},x) = \mbox{\bf std1}\{i(t,x), \mbox{day}(i(t)) = \mbox{366}\} \\
\end{array}
@EndMath
@EndifDoc
@EndDescription
@EndOperator


@BeginExample
To compute the daily mean over all input years use:
@BeginVerbatim
   cdo ydaymean ifile ofile
@EndVerbatim
@EndExample
