Modelers compute ocean carbonate chemistry often based on code from
the Ocean Carbon Cycle Model Intercomparison Project (OCMIP), last
revised in 2005. Here we offer improved publicly available Fortran 95
routines to model the ocean carbonate system (mocsy 2.0). Both codes
take as input dissolved inorganic carbon

To compute air–sea

Models require computationally efficient routines that are compatible
with other model components, typically written in Fortran. Hence,
model simulations are not made with other public software packages
used widely to compute remaining carbonate system variables from any
input pair, given corresponding temperature

Errors associated with these simplifications are considered to be
negligible, while the reasons behind them are largely historical. Most
studies with ocean carbon cycle models have focused on large-scale
patterns of air–sea

To fill these gaps, we provide here an improved set of routines to
model the ocean carbonate system (mocsy 2.0). This new package uses
the classic approach, taking simulated

The ocean carbonate system is well constrained. Any pair of carbonate
system variables can be used to compute all others. Because only two
carbonate system variables,

Since 2005, this precursor code has continued to be improved. The
first public version was denoted as mocsy 1.0

For its basic calculations, mocsy adopts the recommendations of

In mocsy 2.0, to solve the total alkalinity-pH equation, we have replaced the classic
fixed-point iterative carbonate alkalinity scheme (ICAC) in mocsy 1.0 with a new,
universally convergent algorithm from

Moreover, the SolveSAPHE routines allow mocsy 2.0 to avoid any convergence problem under
extreme conditions. The ICAC methods do not always converge, for example under low

For use with mocsy 2.0, we made minor modification to the SolveSAPHE
routines (1) to use mocsy's equilibrium constants and (2) to remove
arguments and equations for

In mocsy, we use

For this calculation of oceanic

The mocsy 2.0 package also differs substantially from other packages
because it adjusts for effects of subsurface pressure on

Likewise the effects of subsurface pressure on the fugacity coefficient

In Eqs. (

Effect of pressure on

The effects of these pressure corrections on

Another new feature in mocsy 2.0 is that it accounts for the effects of

To do so, mocsy 2.0 replaces the analytical formula for

Surface zonal means of carbonate system variables computed
with mocsy 2.0 from the gridded GLODAP data for

Since the publication of the last best-practices guide

Second for

Global-mean vertical profiles of carbonate system variables
computed with mocsy 2.0 from the data described in Fig.

The best-practice formulations for

To compute the

There is no absolute reference for computed carbonate system variables.
To validate mocsy, its computed variables were compared to those from
CO2SYS–MATLAB

As a baseline reference for later evaluation and sensitivity tests, we
present carbonate system variables computed with mocsy 2.0 from the
gridded GLODAP–WOA2009 data. Magnitudes and patterns of the surface
zonal-mean distributions (Fig.

Differences in surface zonal means between mocsy and CO2SYS
for computed variables shown as (top) percent relative
differences (

Differences in global-mean profiles between mocsy and CO2SYS for computed
variables, as in Fig.

Our evaluation reveals the extent to which mocsy's variables computed
from the GLODAP–WOA2009 data differ from those computed when the same
data is used with the CO2SYS–MATLAB package. Relative differences
remain within

Relative changes in global-mean profiles that result from avoiding
each of the three ocean-model approximations: (1) that
density is constant (blue

Relative differences between packages are slightly larger for

The two remaining computed variables, surface

Errors from all three model approximations increase with depth
(Fig.

Absolute changes in global-mean profiles of computed variables when each of
the three ocean-model approximations is avoided, with line colors and patterns as in
Fig.

Errors in

None of the three approximations is without error, but it is the
constant density approximation which leads to the largest errors in most
computed variables (except for

The effects of the three options on computed variables differ by region and depth. The
choice for the

The 4 % increase in total boron with the new formulation from

The new option where the formulations of

Changes in zonal means of computed variables due to replacing best-practice
recommendations with other options: (1) the

Our focus has been on quantifying errors in computed variables from
the three model approximations and in assessing how variables are
affected by the three user options. A more general concern is how
computed variables are affected by the frequent practice of neglecting
nutrient concentrations in carbonate system calculations. In
high-nutrient regions, the changes in computed variables due to
alkalinity from

As an input variable,

Absolute changes in global-mean vertical profiles of computed variables due to replacing
best-practice recommendations with the three options mentioned in
Fig.

Absolute changes in zonal means of computed variables due to
alkalinity contributions from

Absolute changes in global-mean profiles of computed variables attributable to
nutrient alkalinity, i.e., for the same components shown in Fig.

Changes in the aragonite saturation horizon (ASH) due to
(top) using the new formulation of total boron
(

These biases concern models that neglect contributions of phosphoric and
silicic acids to alkalinity
(by assuming

The combined effect from nutrient alkalinity and the new

Unfortunately, neither the new option for

Although

For simplicity, modelers typically make ocean carbonate chemistry
calculations assuming (1) that model density is constant, (2) that
simulated potential temperature is equivalent to in situ temperature,
and (3) that model depth is equivalent to pressure. None of the three
approximations produces significant errors at the surface. Yet errors
in computed variables grow with depth. At 5000 m, the sum of the
relative errors from the three approximations reach more than 3% for

The same code also offers two new options that have become available
since the publication of the best-practices guide

For simplicity, models often neglect contributions of total phosphorus
and silicon to total alkalinity. Doing so biases computed variables,
e.g., shifting Southern Ocean surface

The mocsy package is distributed under the MIT license and is available from GitHub. It can be retrieved in the conventional manner with Git, namely by issuing the command

in an X terminal on Linux, Mac, or PC operating systems. If that fails, install Git and try again,
or go to the main web page on GitHub (

More details on the code, its compilation, and examples of its use in
Fortran or when called from Python can be found in the mocsy
manual at

We thank the original OCMIP code developers (C. L. Sabine, R. M. Key, and R. G. Najjar)
and those who provided subsequent corrections or comments (A. Mouchet, K. Lindsay,
J. Christian, and G. McKinley). We are grateful to J.-P. Gattuso, E. Lewis, and
D. Wallace, as well as S. van Heuven, D. Pierrot, and J. Rae for coding and making public
their packages (seacarb, CO2SYS, and CO2SYS–MATLAB), which have been no small inspiration
for mocsy. We also thank P. Brockmann and Y. Meurdesoif for professional advice on coding
and distribution strategies. The original manuscript and code have been improved because
of three dedicated referees: G. Munhoven shared scientific and technical savvy while
making his stable, efficient, and well-documented pH solver (SolveSAPHE) publicly
available, allowing us to easily integrate it in mocsy; A. Dickson offered much critical
expertise on carbonate chemistry, for instance inspiring us to include pressure
corrections that dramatically alter computed subsurface