Thermodynamics of CaCO3 phase transitions