def _cbrange_user_defined(cbrange, cbrange_user):
    """Set user-specified colorbar range.

    Parameters:
        cbrange (list):
            Input colorbar range.
        cbrange_user (list):
            User-specified colorbar range. If a value is None, then use the
            previous value.

    Returns:
        list: Colorbar range.
    """
    for i in range(2):
        if cbrange_user[i] is not None:
            cbrange[i] = cbrange_user[i]
    return cbrange