# 8.7.2. DIC Package¶

## 8.7.2.1. Introduction¶

This is one of the biogeochemical packages handled from the pkg gchem. The main purpose of this package is to consider the cycling of carbon in the ocean. It also looks at the cycling of phosphorous and potentially oxygen and iron. There are four standard tracers $$DIC$$, $$ALK$$, $$PO4$$, $$DOP$$ and also possibly $$O2$$ and $$Fe$$. The air-sea exchange of CO$$_2$$ and O$$_2$$ are handled as in the OCMIP experiments (reference). The export of biological matter is computed as a function of available light and PO$$_4$$ (and Fe). This export is remineralized at depth according to a Martin curve (again, this is the same as in the OCMIP experiments). There is also a representation of the carbonate flux handled as in the OCMIP experiments. The air-sea exchange on CO$$_2$$ is affected by temperature, salinity and the pH of the surface waters. The pH is determined following the method of Follows et al. For more details of the equations see section [sec:eg-biogeochem_tutorial].

## 8.7.2.2. Key subroutines and parameters¶

INITIALIZATION
DIC_ABIOTIC.h contains the common block for the parameters and fields needed to calculate the air-sea flux of $$CO_2$$ and $$O_2$$. The fixed parameters are set in dic_abiotic_param which is called from gchem_init_fixed.F. The parameters needed for the biotic part of the calculations are initialized in dic_biotic_param and are stored in DIC_BIOTIC.h. The first guess of pH is calculated in dic_surfforcing_init.F.

The air-sea exchange of $$CO_2$$ and $$O_2$$ need wind, atmospheric pressure (although the current version has this hardwired to 1), and sea-ice coverage. The calculation of pH needs silica fields. These fields are read in in dic_fields_load.F. These fields are initialized to zero in dic_ini_forcing.F. The fields for interpolating are in common block in DIC_LOAD.h.

FORCING
The tracers are advected-diffused in ptracers_integrate.F. The updated tracers are passed to dic_biotic_forcing.F where the effects of the air-sea exchange and biological activity and remineralization are calculated and the tracers are updated for a second time. Below we discuss the subroutines called from dic_biotic_forcing.F.
Air-sea exchange of $$CO_2$$ is calculated in dic_surfforcing. Air-Sea Exchange of $$CO_2$$ depends on T,S and pH. The determination of pH is done in carbon_chem.F. There are three subroutines in this file: carbon_coeffs which determines the coefficients for the carbon chemistry equations; calc_pco2 which calculates the pH using a Newton-Raphson method; and calc_pco2_approx which uses the much more efficient method of Follows et al. The latter is hard-wired into this package, the former is kept here for completeness.
Biological productivity is determined following Dutkiewicz et al. (2005) and is calculated in bio_export.F The light in each latitude band is calculate in insol.F, unless using one of the flags listed below. The formation of hard tissue (carbonate) is linked to the biological productivity and has an effect on the alkalinity - the flux of carbonate is calculated in car_flux.F, unless using the flag listed below for the Friis et al (2006) scheme. The flux of phosphate to depth where it instantly remineralized is calculated in phos_flux.F.
The dilution or concentration of carbon and alkalinity by the addition or subtraction of freshwater is important to their surface patterns. These “virtual” fluxes can be calculated by the model in several ways. The older scheme is done following OCMIP protocols (see more in Dutkiewicz et al 2005), in the subroutines dic_surfforcing.F and alk_surfforcing.F. To use this you need to set in GCHEM_OPTIONS.h: #define ALLOW_OLD_VIRTUALFLUX. But this can also be done by the ptracers pkg if this is undefined. You will then need to set the concentration of the tracer in rainwater and potentially a reference tracer value in data.ptracer (PTRACERS_EvPrRn, and PTRACERS_ref respectively).
Oxygen air-sea exchange is calculated in o2_surfforcing.F.
Iron chemistry (the amount of free iron) is taken care of in fe_chem.F.

DIAGNOSTICS
Averages of air-sea exchanges, biological productivity, carbonate activity and pH are calculated. These are initialized to zero in dic_biotic_init and are stored in common block in DIC_BIOTIC.h.

COMPILE TIME FLAGS
These are set in GCHEM_OPTIONS.h:
DIC_BIOTIC: needs to be set for dic to work properly (should be fixed sometime).
ALLOW_O2: include the tracer oxygen.
ALLOW_FE: include the tracer iron. Note you will need an iron dust file set in data.gchem in this case.
MINFE: limit the iron, assuming precpitation of any excess free iron.
CAR_DISS: use the calcium carbonate scheme of Friis et al 2006.
ALLOW_OLD_VIRTUALFLUX: use the old OCMIP style virtual flux for alklinity adn carbon (rather than doing it through pkg/ptracers).
USE_QSW: use the numbers from QSW to be the PAR. Note that a file for Qsw must be supplied in data, or Qsw must be supplied by an atmospheric model.
If the above two flags are not set, the model calculates PAR in insol.F as a function of latitude and year day.
USE_QSW_UNDERICE: if using a sea ice model, or if the Qsw variable has the seaice fraction already taken into account, this flag must be set.
AD_SAFE: will use a tanh function instead of a max function - this is better if using the adjoint
DIC_NO_NEG: will include some failsafes in case any of the variables become negative. (This is advicable). ALLOW_DIC_COST: was used for calculating cost function (but hasn’t been updated or maintained, so not sure if it works still)

## 8.7.2.3. Do’s and Don’ts¶

This package must be run with both ptracers and gchem enabled. It is set up for at least 4 tracers, but there is the provision for oxygen and iron. Note the flags above.

## 8.7.2.4. Reference Material¶

Dutkiewicz. S., A. Sokolov, J. Scott and P. Stone, 2005: A Three-Dimensional Ocean-Seaice-Carbon Cycle Model and its Coupling to a Two-Dimensional Atmospheric Model: Uses in Climate Change Studies, Report 122, Joint Program of the Science and Policy of Global Change, M.I.T., Cambridge, MA.
Follows, M., T. Ito and S. Dutkiewicz, 2006: A Compact and Accurate Carbonate Chemistry Solver for Ocean Biogeochemistry Models. Ocean Modeling, 12, 290-301.
Friis, K., R. Najjar, M.J. Follows, and S. Dutkiewicz, 2006: Possible overestimation of shallow-depth calcium carbonate dissolution in the ocean, Global Biogeochemical Cycles, 20, GB4019, doi:10.1029/2006GB002727.

## 8.7.2.5. Experiments and tutorials that use dic¶

• Global Ocean tutorial, in tutorial_global_oce_biogeo verification directory, described in section [sec:eg-biogeochem_tutorial]