A dynamical model (MAGic) is presented that describes the elemental cycling of sedimentary materials involving sodium, potassium, calcium, magnesium, chloride, carbon, oxygen, iron, sulfur and phosphorous through much of the Phanerozoic. The model incorporates the basic reactions controlling atmospheric carbon dioxide and oxygen concentrations, continental and seafloor weathering of silicate and carbonate rocks, net ecosystem productivity, basalt-seawater exchange reactions, precipitation and diagenesis of chemical sediments and authigenic silicates, oxidation-reduction reactions involving carbon, sulfur, and iron, and subduction-decarbonation reactions. Although MAGic contains feedback and forcing functions adapted from the GEOCARB models (Berner, 1991, 1994; Berner and Kothavala, 2001), these functions are incorporated in a reservoir-reaction scheme that is considerably more detailed. Coupled reservoirs include shallow and deep cratonic silicate and carbonate rocks and sediments, seawater, atmosphere, oceanic sediments and basalts, and the shallow mantle. Model results are reasonably consistent with recently published constraints provided by fluid inclusion, isotopic, floral, and mineralogical records. We have used these results to evaluate sensitivity to uncertainties in the history of the earth-ocean-atmosphere system over the past 500 Ma: the advent of pelagic carbonate sedimentation, the importance of burial versus early diagenetic dolomite formation, the importance of reverse weathering, and the relationship of these processes to seafloor spreading rates. Results include a general pattern of dolomite abundance during periods of elevated seafloor spreading and alkalinity production, elevated atmospheric CO<sub>2</sub> concentrations for most of the Phanerozoic similar to those predicted by GEOCARB, and covariance of seawater sulfate to calcium ratios with magnesium to calcium ratios. These trends are broadly consistent with proxies for seawater composition and the mass-age data of the rock record itself.