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.
LOADING FIELDS
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).
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).
READ_PAR: read the light (photosynthetically available radiation)
from a file set in data.gchem.
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)