@BeginModule
@NewPage
@Name      = Ymonstat
@Title     = Multi-year monthly statistical values
@Section   = Statistical values
@Class     = Statistic
@Arguments = ifile ofile
@Operators = ymonmin ymonmax ymonsum ymonmean ymonavg ymonstd ymonstd1 ymonvar ymonvar1

@BeginDescription
This module computes statistical values of each month of year.
Depending on the chosen operator the minimum, maximum, sum, average, variance
or standard deviation of each month 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.
@EndDescription
@EndModule


@BeginOperator_ymonmin
@Title     = Multi-year monthly minimum

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


@BeginOperator_ymonmax
@Title     = Multi-year monthly maximum

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


@BeginOperator_ymonsum
@Title     = Multi-year monthly sum

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


@BeginOperator_ymonmean
@Title     = Multi-year monthly mean

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


@BeginOperator_ymonavg
@Title     = Multi-year monthly average

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


@BeginOperator_ymonvar
@Title     = Multi-year monthly variance

@BeginDescription
Divisor is n. 

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


@BeginOperator_ymonvar1
@Title     = Multi-year monthly variance (n-1)

@BeginDescription
Divisor is (n-1). 

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


@BeginOperator_ymonstd
@Title     = Multi-year monthly standard deviation

@BeginDescription
Divisor is n. 

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


@BeginOperator_ymonstd1
@Title     = Multi-year monthly standard deviation (n-1)

@BeginDescription
Divisor is (n-1). 

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


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