@BeginModule
@Name      = Arithdays
@Title     = Arithmetic with days
@Section   = Arithmetic
@Class     = Arithmetic
@Arguments = ifile ofile
@Operators = muldpm divdpm muldpy divdpy

@BeginDescription
This module multiplies or divides each timestep of a dataset with the corresponding
days per month or days per year. The result of these functions depends on the used
calendar of the input data.
@EndDescription
@EndModule


@BeginOperator_muldpm
@Title     = Multiply with days per month

@BeginDescription
@BeginMath
o(t,x) = i(t,x) * days\_per\_month
@EndMath
@EndDescription
@EndOperator


@BeginOperator_divdpm
@Title     = Divide by days per month

@BeginDescription
@BeginMath
o(t,x) = i(t,x) / days\_per\_month
@EndMath
@EndDescription
@EndOperator


@BeginOperator_muldpy
@Title     = Multiply with days per year

@BeginDescription
@BeginMath
o(t,x) = i(t,x) * days\_per\_year
@EndMath
@EndDescription
@EndOperator


@BeginOperator_divdpy
@Title     = Divide by days per year

@BeginDescription
@BeginMath
o(t,x) = i(t,x) / days\_per\_year
@EndMath
@EndDescription
@EndOperator


@C @BeginExample
@C Assume an input dataset is a monthly mean time series.
@C To compute the yearly mean from the correct weighted monthly mean use:
@C @BeginVerbatim
@C    cdo muldpm ifile tmpfile1
@C    cdo yearsum tmpfile1 tmpfile2
@C    cdo divdpy tmpfile2 ofile
@C @EndVerbatim
@C Or all in one command line:
@C @BeginVerbatim
@C    cdo divdpy -yearsum -muldpm ifile ofile
@C @EndVerbatim
@C @EndExample
