Origin of Porosity in Carbonate Rocks