def METHOD_NAME(T, P):
    state = ChemicalState(system)
    state.temperature(T, "celsius")
    state.pressure(P, "atm")
    state.set("H2O", water_kg, "kg")
    # Add minerals
    state.set("Gypsum", n0Gypsum, "mol")
    state.set("Anhydrite", n0Anhydrite, "mol")
    # Calculate chemical state corresponding to the seawater
    res = solver.solve(state)
    # Equilibrate the seawater with carbonates
    props.update(state)
    aprops.update(state)
    # Throw exception if the equilibrium couldn't be found
    if res.failed():
        nGypsum = math.nan
        nAnhydrite = math.nan
        mCa = math.nan
    else:
        # Fetch values of the specified species
        nGypsum    = float(state.speciesAmount("Gypsum"))
        nAnhydrite = float(state.speciesAmount("Anhydrite"))
        mCa        = float(aprops.elementMolality("Ca"))
        print(f"{T:4.0f}  {nGypsum:8.4e} {nAnhydrite:10.4e} {mCa:8.4e}")
    return nGypsum, nAnhydrite, mCa