def calc_clf(rs, rso):
    """
    Crawford and Duchon (1999) cloud fraction.

    Parameters
    ----------
    rs : numpy ndarray
        Total incoming shortwave solar radiation, in MegaJoules per square meter per day
    rso : numpy ndarray
        Clear-sky solar radiation.

    """
    clf = 1.0 - (rs / rso)

    # From Crawford and Duchon (1999):
    # Calculated values of clf less than zero were adjusted back to
    # zero so as to be physically realistic.
    clf[clf < 0] = 0

    return clf