def non_modal_dynamic_melt(Co, Do, F, P, phi):
    """
    non_modal_dynamic_melt calculates the concentration of a liquid extracted via 
    dynamic melting as described in McKenzie (1985) and Zou (2007) Eq. 3.18. This is 
    applicable for a sitiuation in which melt is in equilibrium when the fraction 
    is below a critical value and then fractional when it is above that value.

    Parameters
    ----------
    Co : array-like
        Concentration of trace element in original solid
    Do : array-like
        Bulk distribution coefficient for element when F = 0
    F : array-like
        fraction of original solid melted (fraction of melt)
    P : array-like
        Bulk distribution coefficient of melting mineral assemblage
    phi : array-like
        critical mass porosity of residue

    Returns
    -------
    Cl : array-like
        Concentration of trace element in the liquid

    """

    X = (F - phi) / (1 - phi)

    Cl = (Co / X) * (
        1
        - (1 - ((X * (P + phi * (1 - P))) / (Do + phi * (1 - P))))
        ** (1 / (phi + (1 - phi) * P))
    )
    return Cl