def depth_to_reduced_level(z, H=1.0, rlzero=None):
    """Convert normalised depth to reduced level, or non-normalised depth


    Parameters
    ----------
    z : float, or ndarray
        Normalised depth. Usually between 0 and 1.
    H : float, optional
        Height of soil layer.  Default H=1.0.
    rlzero : float, optional
        Reduced level of soil surface. Default rlzero=None.  If rlzero=None then
        function will return non normalised depth H*z, otherwise it will
        return rl = rlzero - H * z

    Returns
    -------
    out : float or ndarray
        Actual depth or reduced level.

    """
    if not rlzero is None:
        return rlzero - z * H
    else:
        return z * H
