<P> Many corals in the order Scleractinia are hermatypic, meaning that they are involved in building reefs . Most such corals obtain some of their energy from zooxanthellae in the genus Symbiodinium . These are symbiotic photosynthetic dinoflagellates which require sunlight; reef - forming corals are therefore found mainly in shallow water . They secrete calcium carbonate to form hard skeletons that become the framework of the reef . However, not all reef - building corals in shallow water contain zooxanthellae, and some deep water species, living at depths to which light cannot penetrate, form reefs but do not harbour the symbionts . </P> <P> There are various types of shallow - water coral reef, including fringing reefs, barrier reefs and atolls; most occur in tropical and subtropical seas . They are very slow - growing, adding perhaps one centimetre (0.4 in) in height each year . The Great Barrier Reef is thought to have been laid down about two million years ago . Over time, corals fragment and die, sand and rubble accumulates between the corals, and the shells of clams and other molluscs decay to form a gradually evolving calcium carbonate structure . Coral reefs are extremely diverse marine ecosystems hosting over 4,000 species of fish, massive numbers of cnidarians, molluscs, crustaceans, and many other animals . </P> <P> Although corals first appeared in the Cambrian period, some 542 million years ago, fossils are extremely rare until the Ordovician period, 100 million years later, when rugose and tabulate corals became widespread . Paleozoic corals often contained numerous endobiotic symbionts . </P> <P> Tabulate corals occur in limestones and calcareous shales of the Ordovician and Silurian periods, and often form low cushions or branching masses of calcite alongside rugose corals . Their numbers began to decline during the middle of the Silurian period, and they became extinct at the end of the Permian period, 250 million years ago . </P>

When do the first coral reefs appear in the fossil record
find me the text answering this question