Nucleation and dehydration of calcium carbonate