Coral reefs: carbon cycling

Intuitively perhaps coral reefs would seem to seem to store carbon dioxide, and therefore provide an important non- consumptive service in regulating global climate and temperature. This would appear to be the case considering the deposition chemistry of limestone:

carbon dioxide + water + calcium carbonate (limestone) ↔ calcium ion + 2 hydrocarbonate ions

However the situation is much more complex. Over the time scales at which ice ages and patterns of ocean circulation vary (tens to hundreds of thousand years) the balance switches. In cold glacial periods sea level is low and more reefs are exposed. Carbon dioxide and water erode the solid limestone and the chemical equilibrium passes to the right, with increased global concentrations of dissolved calcium and hydrocarbonate ions. Conversely reefs rapidly accumulate in the warm interglacial periods when more of the global pool of dissolved hydrocarbonate is converted into solid limestone, and atmospheric concentrations of carbon dioxide increase.
Therefore reefs can be both sinks and sources of carbon dioxide. Overlying these changes is the accumulation of limestone over geological times scales (1000s of millions of years) through which carbon has been stored in the earth' s crust as limestone, as well as in coal, oil and gas deposits. The role of coral reefs however has been restricted to the last 200-250 million years, since the first scleractinian corals with algal symbionts appeared in the Triassic.
On time scales of most relevance to humans however coral reefs are almost certainly irrelevant to the long term storage of carbon dioxide. Human activities have produced and added more of the gas to the atmosphere in the past century than corals have stored in reefs over the past interglacial period lasting 15,000 years.