Atmospheric Gas-Aerosol Equilibrium: IV. Thermodynamics of Carbonates