예제 #1
0
def check_viability(trait_values):
    """ check the viability of allocation(a) &  residence time(ŧ) combinations"""

    rtur = np.array(model.spinup3(0.01, trait_values))
    if rtur[0] <= 0.01 or rtur[1] <= 0.01:
        return False
    return True
예제 #2
0
def check_viability(trait_values):
    """ check the viability of allocation(a) &  residence time(ŧ) combinations"""

    rtur = np.array(model.spinup3(0.1, trait_values))
    if rtur[0] <= 0.001 or rtur[1] <= 0.001:
        #print("invalid_combination")
        #print(rtur[0], rtur[1])
        #print("\n")
        return False # aways return true
    return True
예제 #3
0
def check_viability(trait_values, wood):
    """ Check the viability of allocation(a) & residence time(ŧ) combinations.
        Some PLS combinations of allocation coefficients and residence times
        are not 'biomass acumulators' at low npp (< 0.01 kg m⁻² year⁻¹)
        do not have enough mass of carbon (< 0.01 kg m⁻²) in all CVEG compartments

        trait_values: np.array(shape=(6,), dtype=f64) allocation and residence time combination (possible PLS)
        wood: bool  Is this a woody PLS?
    """

    assert wood is not None
    rtur = np.array(model.spinup3(1.0, trait_values))
    if wood:
        if rtur[0] <= 0.5 or rtur[1] <= 0.5 or rtur[2] <= 0.5:
            return False
        return True
    else:
        if rtur[0] <= 0.5 or rtur[1] <= 0.5:
            return False
        return True