Formation of coral reefs