CSIRO Environmental Modelling Suite (EMS): scientific description of the optical and biogeochemical models (vB3p0)

Abstract. Since the mid-1990s, Australia's Commonwealth Science Industry and Research Organisation (CSIRO) has been developing a biogeochemical (BGC) model for coupling with a hydrodynamic and sediment model for application in estuaries, coastal waters and shelf seas. The suite of coupled models is referred to as the CSIRO Environmental Modelling Suite (EMS) and has been applied at tens of locations around the Australian continent. At a mature point in the BGC model's development, this paper presents a full mathematical description, as well as links to the freely available code and user guide. The mathematical description is structured into processes so that the details of new parameterisations can be easily identified, along with their derivation. In EMS, the underwater light field is simulated by a spectrally resolved optical model that calculates vertical light attenuation from the scattering and absorption of 20+ optically active constituents. The BGC model itself cycles carbon, nitrogen, phosphorous and oxygen through multiple phytoplankton, zooplankton, detritus and dissolved organic and inorganic forms in multiple water column and sediment layers. The water column is dynamically coupled to the sediment to resolve deposition, resuspension and benthic–pelagic biogeochemical fluxes. With a focus on shallow waters, the model also includes detailed representations of benthic plants such as seagrass, macroalgae and coral polyps. A second focus has been on, where possible, the use of geometric derivations of physical limits to constrain ecological rates. This geometric approach generally requires population-based rates to be derived from initially considering the size and shape of individuals. For example, zooplankton grazing considers encounter rates of one predator on a prey field based on summing relative motion of the predator with the prey individuals and the search area; chlorophyll synthesis includes a geometrically derived self-shading term; and the bottom coverage of benthic plants is calculated from their biomass using an exponential form derived from geometric arguments. This geometric approach has led to a more algebraically complicated set of equations when compared to empirical biogeochemical model formulations based on populations. But while being algebraically complicated, the model has fewer unconstrained parameters and is therefore simpler to move between applications than it would otherwise be. The version of EMS described here is implemented in the eReefs project that delivers a near-real-time coupled hydrodynamic, sediment and biogeochemical simulation of the Great Barrier Reef, northeast Australia, and its formulation provides an example of the application of geometric reasoning in the formulation of aquatic ecological processes.


Abstract. Since the mid-1990s, Australia's Commonwealth Science Industry and Research Organisation (CSIRO) has been developing a biogeochemical (BGC) model for coupling with a hydrodynamic and sediment model for application in estuaries, coastal waters and shelf seas. The suite of coupled models is referred to as the CSIRO Environmental Modelling Suite (EMS) and has been applied at tens of locations around the Australian continent. At a mature point in the BGC model's development, this paper presents a full mathematical description, as well as links to the freely available code and user guide. The mathematical description is structured into processes so that the details of new parameterisations can be easily identified, along with their derivation. In EMS, the underwater light field is simulated by a spectrally resolved optical model that calculates vertical light attenuation from the scattering and absorption of 20+ optically active constituents. The BGC model itself cycles carbon, nitrogen, phosphorous and oxygen through multiple phytoplankton, zooplankton, detritus and dissolved organic and inorganic forms in multiple water column and sediment layers. The water column is dynamically coupled to the sediment to resolve deposition, resuspension and benthic-pelagic biogeochemical fluxes. With a focus on shallow waters, the model also includes detailed representations of benthic plants such as seagrass, macroalgae and coral polyps. A second focus has been on, where possible, the use of geometric derivations of physical limits to constrain ecological rates. This geometric approach generally requires population-based rates to be derived from initially considering the size and shape of individuals. For example, zooplankton grazing considers encounter rates of one predator on a prey field based on summing relative motion of the predator with the prey individuals and the search area; chlorophyll synthesis includes a geometrically derived self-shading term; and the bottom coverage of benthic plants is calculated from their biomass using an exponential form derived from geometric arguments. This geometric approach has led to a more algebraically complicated set of equations when compared to empirical biogeochemical model formulations based on populations. But while being algebraically complicated, the model has fewer uncon-

Introduction
The first model of marine biogeochemistry was developed more than 70 years ago to explain phytoplankton blooms (Riley, 1947). Today, the modelling of estuarine, coastal and global biogeochemical systems has been used for a wide variety of applications including coastal eutrophication (Madden and Kemp, 1996;Baird et al., 2003), shelf carbon and nutrient dynamics (Yool and Fasham, 2001;Dietze et al., 2009), plankton ecosystem diversity (Follows et al., 2007), ocean acidification (Orr et al., 2005), impact of local developments such as fish farms and sewerage treatment plants (Wild-Allen et al., 2010), fishery production (Stock et al., 2008) and operational forecasting (Fennel et al., 2019), to name a few. As a result of these varied applications, a diverse range of biogeochemical models has emerged, with some models developed over decades and being capable of investigating a suite of biogeochemical phenomena (Butenschön et al., 2016). With model capabilities typically dependent on the history of applications for which a particular model has been developed, and perhaps even the backgrounds and interests of the developers themselves, significant differences exist between models. Thus, it is vital that biogeochemical models are accurately described in full (e.g. Butenschön et al., 2016;Aumont et al., 2015 andDutkiewicz et al., 2015), so that model differences can be understood and, where useful, innovations shared between modelling teams.
Estuarine, coastal and shelf modelling projects undertaken over the past 20+ years by Australia's national science agency, the Commonwealth Science Industry and Research Organisation (CSIRO), have led to the development of the CSIRO Environmental Modelling Suite (EMS). EMS contains a suite of hydrodynamic, transport, sediment, optical and biogeochemical models that can be run coupled or offline. The EMS biogeochemical model, the subject of this paper, has been applied around the Australian coastline ( Fig. 1) leading to characteristics of the model which have been tailored to the Australian environment and its challenges.
Australian shelf waters range from tropical to temperate, micro-to macro-tidal, with shallow waters containing coral-, seagrass-or algae-dominated benthic communities. With generally narrow continental shelves, and being surrounded by two poleward-flowing boundary currents (Thompson et al., 2009), primary production in Australian coastal environments is generally limited by dissolved nitrogen in marine environments, phosphorus in freshwaters, and unlimited by silica and iron. The episodic nature of rainfall on the Australian continent, especially in the tropics, and a lack of snow cover, delivers intermittent but occasionally extreme river flows to coastal waters. With a low population density, continent-wide levels of human impacts are small relative to other continents but can be significant locally, often due to large isolated developments such as dams, irrigation schemes, mines and ports. Global changes such as ocean warming and acidification affect all regions. The EMS bio-geochemical (BGC) model has many structural features similar to other models (e.g. multiple plankton functional types, nutrient and detrital pools, an increasing emphasis on optical and carbon chemistry components). Nonetheless, the geographical characteristics of, and anthropogenic influences on, the Australian continent have shaped the development of EMS and led to a BGC model with many unique features.
As the national science body, CSIRO needed to develop a numerical modelling system that could be deployed across the broad range of Australian coastal environments and capable of resolving multiple anthropogenic impacts. With a long coastline (60 000+ km by one measure), containing over 1000 estuaries, an Australian-wide configuration has insufficient resolution to be used for many applied environmental challenges. Thus, in 1999, the EMS biogeochemical model development was targeted to increase its applicability across a range of ecosystems. In particular, given limited resources to model a large number of environments/ecosystems, developments aimed to minimise the need for re-parameterisation of biogeochemical processes for each application. Two innovations arose from this imperative: (1) the software development of a process-based modelling architecture, such that model processes could be included, or excluded, while using the same executable file; and (2) the use, where possible, of geometric descriptions of physical limits to ecological processes as a means of reducing parameter uncertainty . It is the use of these geometric descriptions that has led to the greatest differences between EMS and other aquatic biogeochemical models.
In the aquatic sciences, there has been a long history of experimental and process studies that use geometric arguments to quantify ecological processes, but these derivations have rarely been applied in biogeochemical models, with notable exceptions (microalgal light absorption and plankton sinking rates generally, surface-area-to-volume considerations, Reynolds, 1984, size-focused trait-based modelling, Litchman andKlausmeier, 2008). By prioritising geometric arguments, EMS has included a number of previously published geometric forms including diffusion limitation of microalgae nutrient uptake (Hill and Whittingham, 1955), absorption cross-sections of microalgae (Fig. 2c;Duysens, 1956;Kirk, 1975;Morel and Bricaud, 1981), diffusion limits to macroalgae and coral nutrient uptake (Munk and Riley, 1952;Atkinson and Bilger, 1992;Zhang et al., 2011) and encounter-rate limitation of grazing rates (Fig. 2b;Jackson, 1995).
Perhaps the most important consequence of using geometric constraints in the BGC model is the representation of benthic flora as two-dimensional surfaces, while plankton are represented as three-dimensional suspended objects . Thus, leafy benthic plants such as macroalgae take up nutrients and absorb light on a 2-D surface. In contrast, nutrient uptake to microalgae occurs through a 3-D field, while light uptake of the 3-D cell is limited by the 2-D projected area (Fig. 2a). These contrasting geometric properties, from which the model equations are Figure 1. Model domains of the CSIRO EMS hydrodynamic and biogeochemical applications from 1996 onwards. Additionally, EMS was used for the nationwide Simple Estuarine Response Model (SERM) that was applied generically around Australia's 1000+ estuaries . Brackets refer to specific funding bodies. EMS has also been applied in the Los Lagos region of Chile. A full list of past and current applications and funding bodies is available at https://research.csiro.au/cem/projects/ (last access: 22 September 2020). The encounter rate of prey per individual predator as a function of the radius of encounter (the sum of the predator and prey radii) and the relative motion and prey concentration following Jackson (1995). (c) The use of ray tracing and the mass-specific absorption coefficient to calculate an absorption cross-section for a randomly oriented spheroid following Kirk (1975). (d) Fraction of the bottom covered as seen from above as a result of increasing the number of randomly placed leaves , based on the assumption that leaves are randomly placed; the cover reaches 1 − exp(−1) = 0.63 when the sum of the shaded areas induced by all individual leaves equals the ground area (i.e. a leaf area index of 1).

4506
M. E. Baird et al.: CSIRO shallow-water biogeochemical model derived, generate greater potential light absorption relative to nutrient uptake of benthic communities relative to the same potential light absorption relative to nutrient uptake in unicellular algae . In the most simple terms, this can be related to the surface-area-to-projected-area ratio of a leaf being 0.25 times that of a microalgae cell (Fig. 2a). Thus, the competition for nutrients, ultimately being driven by light absorption and its rate compared to nutrient uptake, is explicitly determined by the contrasting geometries of cells and leaves.
In addition to geometric constraints derived by others, a number of novel geometric descriptions have been introduced into the EMS BGC model, including 1. geometric derivation of the relationship between biomass, B, and fraction of the bottom covered, A eff = 1 − exp(− B), where is the nitrogen-specific leaf area (Sect. 6); 2. impact of self-shading on chlorophyll synthesis quantified by the incremental increase in absorption with the increase in pigment content (Sect. 5.1.3); 3. mass-specific absorption coefficients of photosynthetic pigments better utilised to determine phytoplankton absorption cross-sections (Duysens, 1956;Kirk, 1975;Morel and Bricaud, 1981) through the availability of a library of mass-specific absorption coefficients (Clementson and Wojtasiewicz, 2019) and their wavelength correction using the refractive index of the solvent used in the laboratory determinations (Fig. 5); 4. the space limitation of zooxanthellae within coral polyps using zooxanthellae projected areas in a twolayer gastrodermal cell anatomy (Sect. 6.3.1); and 5. preferential ammonium uptake, which is often calculated using different half-saturation coefficients of nitrate and ammonium uptake (Lee et al., 2002), determined by allowing ammonium uptake to proceed up to the diffusion limit. Should this diffusion limit not meet the required demand, nitrate uptake supplements the ammonium uptake. This representation has the benefit that no additional parameters are required to assign preference, with the same approach applied for both microalgae and benthic plants (Sect. 9.1).
To be clear, these geometric definitions have their own set of assumptions (e.g. a single cell size for a population) and simplifications (e.g. spherical shape). Nonetheless, the effort to apply geometric descriptions of physical limits across the BGC model appears to have been beneficial, as measured by the minimal amount of re-parameterisation that has been required to apply the model to contrasting environments. Of the above-mentioned new formulations, the most useful and easily applied is the bottom cover calculation (Fig. 2d). In fact, it is so simple, and such a clear improvement on empirical forms as demonstrated in Baird et al. (2016a), that it is likely to have been applied in other ecological/biogeochemical models, although we are unaware of any other implementation.
The geometrically constrained relationship between bottom cover and seagrass biomass, B, is cover = 1 − exp(− B) and can be used to illustrate how geometric arguments can produce model equations with tightly constrained parameters. This geometric relationship contains only one parameter, , that is the initial slope between cover and biomass. At low biomass, there is no overlapping of leaves, so the is the area of leaves per unit of biomass (or nitrogenspecific leaf area) and has been determined by many authors in hundreds of seagrass studies. Comparison with data is shown in Appendix A of Baird et al. (2016a) and Fig. 2d. Thus, by using geometric arguments in developing the equation, the form contains only one parameter which has a physical meaning that is tightly constrained.
In addition to using geometric descriptions, there are a few other features unique to the EMS BGC model including 1. calculation of scalar irradiance from downwelling irradiance, vertical attenuation and a photon balance within a layer (Sect. 4.1.2); 2. an oxygen balance achieved through use of biological and chemical oxygen demand tracers (Sect. 10.3.2); and 3. the stoichiometric link of excess photons to reactive oxygen production in zooxanthellae.

Paper outline
This document provides a summary of the biogeochemical processes included in the model (Sect. 2), a summary of the transport model that integrates the advection-diffusion and sinking terms (Sect. 3), and full descriptions of the optical (Sect. 4) and ecological (Sect. 5-9) model equations. The description of both the optical and biogeochemical models is divided into the primary environmental zones: pelagic, epibenthic and sediment. Sect. 9 details parameterisations that are common across numerous ecological processes, such as temperature dependence, and Sect. 10 provides details of the numerical integration techniques. Further sections detail the model evaluation (Sect. 11) and test case generation (Sect. 12). The discussion (Sect. 13) details how past and present applications have influenced the development of the EMS BGC model and anticipates some future developments. Code availability is detailed at the end of the paper. Finally, the Supplement provides tables of processes (S1), state variables (S3) and parameter values (S4), with both mathematical and numerical code details (S2), and additional model evaluation (S5), from the Great Barrier Reef configuration.

Overview of the EMS optical and biogeochemical models
The optical and biogeochemical models are linked by the dependence of scattering and absorption on the state of optically active biogeochemical quantities. The optical model undertakes calculations at distinct wavelengths of light (say 395, 405, 415, . . . 705 nm) representative of individual wavebands (say 400-410, 410-420 nm, etc.) of the vertically resolved downwelling and scalar irradiance that are used by the biogeochemical model to drive photosynthesis. The optical model includes the effect of Earth-Sun distance, Sun angle, atmospheric transmission, surface albedo and refraction on the downwelling surface irradiance. In the water column, the model attenuates light based on the spectrally resolved total absorption and scattering of microalgae, detritus, dissolved organic matter, inorganic particles and the water itself (Fig. 3). The light reaching the bottom is further attenuated by macroalgae, seagrass, corals and benthic microalgae. The biogeochemical model is organised into three zones: pelagic, epibenthic and sediment. Depending on the grid formulation, the pelagic zone may have one or many layers of similar or varying thickness. The epibenthic zone overlaps with the lowest pelagic layer and the top sediment layer and shares the same dissolved and suspended particulate material fields. The sediment is modelled in multiple layers with a thin layer of easily resuspendable material overlying thicker layers of more consolidated sediment. Each sediment layer contains both particles and porewater .
Dissolved and particulate biogeochemical tracers are advected and diffused throughout the model domain in an identical fashion to temperature and salinity. Additionally, biogeochemical particulate substances sink and are resuspended in the same way as sediment particles. Biogeochemical processes are organised into pelagic processes of phytoplankton and zooplankton growth and mortality, detritus remineralisation and fluxes of dissolved oxygen, nitrogen and phosphorus; epibenthic processes of growth and mortality of macroalgae, seagrass and corals, and sediment-based processes of plankton mortality, microphytobenthos growth, detrital remineralisation and fluxes of dissolved substances (Fig. 3).
The biogeochemical model considers four groups of microalgae (small and large phytoplankton representing the functionality of photosynthetic cyanobacteria and diatoms, respectively, microphytobenthos and Trichodesmium), four macrophytes types (seagrass types corresponding to Zostera, Halophila, deep Halophila and macroalgae) and coral polyps. For temperate system applications of the EMS, dinoflagellates, Nodularia and multiple macroalgal species have also been characterised Hadley et al., 2015a).
Photosynthetic growth is determined by concentrations of dissolved nutrients (nitrogen and phosphate) and photosynthetically active radiation. Autotrophs take up dissolved ammonium, nitrate, phosphate and inorganic carbon. Microal-gae incorporate carbon (C), nitrogen (N) and phosphorus (P) at the Redfield ratio (106C : 16N : 1P), while macrophytes do so at the Atkinson ratio (550C : 30N : 1P). Microalgae contain chlorophyll a and a suite of accessories pigments, and have variable carbon : pigment ratios determined using a photo-adaptation model.
Micro-and mesozooplankton graze on small and large phytoplankton, respectively, at rates determined by particle encounter rates and maximum ingestion rates. Additionally, large zooplankton consume small zooplankton. Of the grazed material that is not incorporated into zooplankton biomass, a fraction is released as dissolved and particulate carbon, nitrogen and phosphate, with the remainder forming detritus. Additional detritus accumulates by mortality. Detritus and dissolved organic substances are remineralised into inorganic carbon, nitrogen and phosphate with labile detritus transformed most rapidly (days), refractory detritus slower (months) and dissolved organic material transformed over the longest timescales (years). The production (by photosynthesis) and consumption (by respiration and remineralisation) of dissolved oxygen is also included in the model and, depending on prevailing concentrations, facilitates or inhibits the oxidation of ammonium to nitrate and its subsequent denitrification to dinitrogen gas which is then lost from the system.
Additional water column chemistry calculations are undertaken to solve for the equilibrium carbon chemistry ion concentrations necessary to undertake ocean acidification (OA) studies and to consider sea-air fluxes of oxygen and carbon dioxide. The adsorption and desorption of phosphorus onto inorganic particles as a function of the oxic state of the water are also considered.
In the sediment porewaters, similar remineralisation processes occur as in the water column (Fig. 4). Additionally, nitrogen is denitrified and lost as N 2 gas, while phosphorus can become adsorbed onto inorganic particles and become permanently immobilised in sediments.

Structure of the model description
The biogeochemical model presented in this paper is process based. That is, the rate of change of each ecological state variable is determined by a mathematical representation of each process that moves mass between one variable and another, conserving total mass. For dissolved inorganic phosphorus, the equation in the bottom water column layer (excluding advection, diffusion and particle sinking) could be written as 4508 M. E. . Schematic of the CSIRO Environmental Modelling Suite illustrating the biogeochemical processes in the water column, epipelagic and sediment zones, as well as the carbon chemistry and gas exchange used in vB3p0 for the Great Barrier Reef application. Orange labels represent components that scatter or absorb light. As the number of processes in the model has grown, the representation of all the terms affecting one variable has become unworkable. Thus, instead of presenting the full equation for each state variable, we present the full set of equations for each process.

Presentation of process equations
In Sects. 5-9, descriptions are sorted by processes, such as microalgae growth, coral growth and food web interactions. This organisation allows the model to be explained, with individual notation, in self-contained chunks. For each process, the complete set of model equations, parameter values and state variables is given in tables. Within each process, the equations are required to conserve mass of oxygen, carbon, nitrogen and phosphorus. Furthermore, each process description is independent of any other processes in the model. As the code itself allows the inclusion/exclusion of processes at runtime, the process-based structuring of the scientific description aligns with the architecture of the numerical code.

Model stoichiometry
The  (Table 41) to improve the readability of the mathematical equations.

Transport model
The local rate of change of concentration, C, of each dissolved and particulate constituent contains sink/source terms, S C , which are described in length in the process descriptions of this document, and the advection, diffusion and sinking terms: where the symbol ∇ = ∂ ∂x , ∂ ∂y , ∂ ∂z , v is the velocity field, K is the eddy diffusion coefficient which varies in space and time, and w sink is the local sinking rate (positive downwards) with the z coordinate positive upwards. The calculation of v and K is described in the hydrodynamic model (Herzfeld, 2006;Gillibrand and Herzfeld, 2016). The advection-diffusion terms of Eq. (1), based on the continuum hypothesis for a fluid (Vichi et al., 2007), are solved by either an in-line advection scheme with the baroclinic time step of the hydrodynamic model or an offline transport scheme using a potentially much longer time step . Options for advection and transport schemes in EMS include mass conservative Lagrangian and flux-form approaches described in Herzfeld (2006) and Gillibrand and Herzfeld (2016).
The microalgae are particulates that contain internal concentrations of dissolved nutrients (C, N, P) and pigments that are specified on a per cell basis. To conserve mass, the local rate of change of the concentration of microalgae, B, multiplied by the content (or reserve) of the cell, R, is given by For more information, see Sect. 5.1.6 and Sect. 3.1 of  which describe the coupling of the plankton component of the biogeochemical model to the Princeton Ocean Model.

Optical model
The optical model calculates the spectrally resolved light field in each vertical column and uses it to drive the photosynthesis of phytoplankton and benthic plants in the biogeochemical model. Following the terminology of aquatic optics (Mobley, 1994), we divide the description of the model into calculations of inherent optical properties (IOPs) followed by apparent optical properties (AOPs). IOPs are properties of the medium (e.g. scattering and absorption) and do not depend on the ambient light field. The optical model uses the value of the optically active state variables, and their massspecific absorption and scattering properties, to calculate the total absorption and scattering. AOPs are those properties that depend both on the medium (the IOPs) and on the surface light field. AOPs include downwelling and scalar irradiance. Thus, the optical model uses the vertical distribution of IOPs, and the surface light field, to determine the vertical distribution of the AOPs. Phytoplankton absorption. The model contains four phytoplankton types (small and large phytoplankton, benthic microalgae and Trichodesmium), each with a unique ratio of internal concentration of accessory photosynthetic pigments to chlorophyll a. To calculate the absorption due to each pigment, we use a database of spectrally resolved mass-specific absorption coefficients (Clementson and Wojtasiewicz, 2019). As it can be assumed that accessory pigments stay in a constant ratio to chlorophyll a, the model needs only a state variable for chlorophyll a for each phytoplankton type. The model then calculates the chlorophyll a specific absorption coefficient due to all pigments by using a state variable quantifying the chlorophyll concentration of the population, the number of cells in the population and the ratio of concentration of the accessory pigment to chlorophyll a, and the mass-specific absorption coefficient of each of the accessory pigments. Thus, the chlorophyll a specific absorption coefficient due to all photosynthetic pigments for small phytoplankton at wavelength λ, γ small,λ , is given by where Chl a is the pigment chlorophyll a, Zea is zeaxanthin, Echi is echinenone, β-car is β carotene, PE is phycoerythrin, and PC is phycocyanin, and the ratios of chlorophyll a to accessory pigment concentration are determined from Wojtasiewicz and Stoń-Egiert (2016). Note that the coefficient in Eq.
(3) for Chl a is 1.0 because the ratio of chlorophyll a to chlorophyll a is 1. The resulting chlorophyll a specific absorption coefficient for picoplankton is shown in Fig. 5. Similarly, for large phytoplankton and microphytobenthos (Wright et al., 1996), where Fuco is fucoxanthin (Fig. 6) and for Trichodesmium (Carpenter et al., 1993), where Myxo is myxoxanthophyll (Fig. 7). The absorption cross-section at wavelength λ (α λ ) of a spherical cell of radius (r), chlorophyll a specific absorption coefficient (γ λ ) and homogeneous intracellular chlorophyll a concentration (c i ) can be calculated using geometric optics (i.e. ray tracing without considering internal scattering) and is given by (Duysens, 1956;Kirk, 1975)  where πr 2 is the projected area of a sphere, and the bracketed term is 0 for no absorption (γ c i r = 0) and approaches 1 as the cell becomes fully opaque (γ c i r → ∞). Note that the bracketed term in Eq. (6) is mathematically equivalent to the dimensionless efficiency factor for absorption, Q a (used in Morel and Bricaud, 1981, Finkel, 2001and Bohren and Huffman, 1983, of homogeneous spherical cells with an index of refraction close to that of the surrounding water. Note that the intracellular chlorophyll concentration, c i , changes as a result of chlorophyll synthesis (described later in Eq. 34). The use of an absorption cross-section of an individual cell has two significant advantages. Firstly, the same model parameters used here to calculate absorption in the water column are used to determine photosynthesis by individual cells, including the effect of packaging of pigments within cells. Secondly, the dynamic chlorophyll concentration determined later can be explicitly included in the calculation of phytoplankton absorption. Thus, the absorption of a population of n cell m −3 is given by nα m −1 , while an individual cell absorbs αE o light, where E o is the scalar irradiance.
Coloured dissolved organic matter (CDOM) absorption. Two equations for CDOM absorption are presently being trialled. The two schemes are as follows:  . Pigment-specific absorption coefficients for the dominant pigments found in Trichodesmium determined using laboratory standards in solvent in a 1 cm vial. The aqua line represents the weighted sum of the photosynthetic pigments (Eq. 5), with the weighting calculated from the ratio of each pigment concentration to chlorophyll a. See Fig. 5 for more details. Myxoxanthophyll was dissolved in acetone.
Scheme 1. The absorption of CDOM, a CDOM,λ , is determined from a relationship with salinity in the region (Schroeder et al., 2012): where S is the salinity. In order to avoid unrealistic extrapolation, the salinity used in this relationship is the minimum of the model salinity and 36. In some cases, coastal salinities exceed 36 due to evaporation. The absorption due to CDOM at other wavelengths is calculated using a CDOM spectral slope for the region (Blondeau-Patissier et al., 2009): where S CDOM is an approximate spectral slope for CDOM, with observations ranging from 0.01 to 0.02 nm −1 for significant concentrations of CDOM. Lower magnitudes of the spectral slope generally occur at lower concentrations of CDOM (Blondeau-Patissier et al., 2009). Scheme 2. The absorption of CDOM, a CDOM,λ , is directly related to the concentration of dissolved organic carbon, D C : CDOM,443 is the dissolved organic carbon-specific CDOM absorption coefficient at 443 nm.
Both schemes have drawbacks. Scheme 2, using the concentration of dissolved organic carbon, is closer to reality but is likely to be sensitive to poorly known parameters such as remineralisation rates and initial detritial concentrations. Scheme 1, a function of salinity, will be more stable but perhaps less accurate, especially in estuaries where hypersaline waters may have large estuarine loads of coloured dissolved organic matter.
Absorption due to non-algal particulate material. The waters of the Great Barrier Reef contain suspended sediments originating from various marine sources, such as the white calcium carbonate fragments generated by coral erosion and sediments derived from terrestrial sources such as granite . The model uses spectrally resolved mass-specific absorption coefficients (and also total scattering measurements) from a database of laboratory measurements conducted on either pure mineral suspensions, or mineral mixtures, at two ranges of size distributions (Fig. 8;Stramski et al., 2007). In this model version, we use the calcium carbonate sample CAL1 for CaCO 3 -based particles.
For the terrestrially sourced particles, we used observations from Gladstone Harbour in the central Great Barrier Reef (GBR) (Fig. 9). These IOPs gave a realistic surface colour for the Queensland river sediment plumes ). In the model, optically active non-algal particulates (NAPs) include the inorganic particulates (such as sand and mud; see Sect. 7.1) and detritus. We assumed the optical properties of the detritus were the same as the optical properties in Gladstone Harbour, although open-ocean studies have used a detritial absorption that is more like CDOM (Dutkiewicz et al., 2015).
The absorption due to calcite-based NAP is given by where c 1 is the spectrally resolved mass-specific absorption coefficient determined from laboratory experiments (Fig. 8).
where c 2 is the spectrally resolved mass-specific absorption coefficient determined from field measurements ( Fig. 9), NAP non−CaCO 3 is quantified in kg m −3 , D Atk and D Red are quantified in mg N m −3 , and D C is quantified in mg C m −3 . Total absorption. The total absorption, a T,λ , is given by where a w,λ is clear-water absorption (Fig. 10) and N is the number of phytoplankton classes (see Table 3).
Scattering. The total scattering coefficient is given by where NAP is the concentration of non-algal particulates, b w,λ is the scattering coefficient due to clear water (Fig. 10), c 1 and c 2 are the spectrally resolved mass-specific coefficients (Figs. 8 and 9) and phytoplankton scattering is the product of the chlorophyll-specific phytoplankton scattering coefficient, b phy,λ and the water column chlorophyll concentration of all classes, n x c i,x V x (where c i is the chlorophyll concentration in the cell, and V is the cell volume). The value for b phy,λ is set to 0.2 (mg Chl a m −2 ) −1 for all wavelengths, a typical value for marine phytoplankton (Kirk, 1994). For more details, see Baird et al. (2007b).

Apparent optical properties (AOPs)
The optical model is forced with the downwelling shortwave radiation just above the sea surface, based on remotely sensed cloud fraction observations and calculations of top-of-the-atmosphere clear-sky irradiance and solar angle. The calculation of downwelling radiation and surface albedo (a function of solar elevation and cloud cover) is detailed in Sect. 9.1.1 of the hydrodynamic scientific description (https://research.csiro.au/cem/software/ems/ ems-documentation/, last access: 22 September 2020). The downwelling irradiance just above the water interface is split into wavebands using the weighting for clear-sky irradiance (Fig. 10). Snell's law is used to calculate the azimuth angle of the mean light path through the water, θ sw , as calculated from the atmospheric azimuth angle, θ air , and the refraction of light at the air-water interface (Kirk, 1994): sin θ air sin θ sw = 1.33. Figure 8. The remote-sensing reflectance of the 21 mineral mixtures suspended in water as measured by Stramski et al. (2007). Laboratory measurements of absorption and scattering properties are used to calculated remote-sensing reflectance . Line colouring corresponds to that produced by the mineral suspended in clear water as calculated using the MODIS true colour algorithm (Gumley et al., 2010). CAL1, with a median particle diameter of 2 µm, is used for Mud CaCO 3 .  Kirk (1994). b Kirk (1991) using an average cosine of scattering of 0.924 (Mobley, 1994). c Blondeau-Patissier et al. Calculation of in-water light field. Given the IOPs determined above, the exact solution for AOPs would require a radiative transfer model (Mobley, 1994) which is too computationally expensive for a complex ecosystem model such as developed here. Instead, the in-water light field is solved for using empirical approximations of the relationship between IOPs and AOPs (Kirk, 1991;Mobley, 1994).
The vertical attenuation coefficient at wavelength λ when considering absorption and scattering, K λ , is given by The term outside the square root quantifies the effect of absorption, where a T,λ is the total absorption. The term within the square root of Eq. (15) represents scattering as an extended pathlength through the water column, where g i and g ii   (Babcock et al., 2015). The line colour is rendered like that in Fig. 8. The site labelling is ordered in time, from the first sample collected during neap tides at the top to the last sample collected at spring tides on the bottom. The IOPs used for the Mud non−CaCO 3 end-member are from the WIT site (see legend) at the centre of the harbour, was dominated by inorganic particles. The measured concentration of NAP at the site was 33.042 mg L −1 and is used to calculate mass-specific IOPs.
are empirical constants and take values of 0.402 and 0.180, respectively. The values of g i and g ii depend on the average cosine of scattering. For filtered water with scattering only due to water molecules, the values of g i and g ii are quite different to natural waters. But for waters ranging from coastal to open ocean, the average cosine of scattering varies by only a small amount (0.86-0.95; Kirk, 1991), and thus uncertainties in g i and g ii do not strongly affect K λ .
The downwelling irradiance at wavelength λ at the bottom of a layer h thick, E d,λ,bot , is given by where E d,top,λ is the downwelling irradiance at wavelength λ at the top of the layer and K λ is the vertical attenuation coefficient at wavelength λ, a result of both absorption and scattering processes. Assuming a constant attenuation rate within the layer, the average downwelling irradiance at wavelength λ, E d,λ , is given by We can now calculate the scalar irradiance, E o , for the calculation of phytoplankton absorption, from downwelling irradiance, E d . The light absorbed within a layer must balance the difference in downwelling irradiance from the top and bottom of the layer (since scattering in this model only increases the pathlength of light); thus, Cancelling h, the scalar irradiance as a function of downwelling irradiance is given by This correction conserves photons within the layer, although it is only as good as the original approximation of the im-pact of scattering and azimuth angle on vertical attenuation (Eq. 15).
Vertical attenuation of heat. The vertical attenuation of heat is given by and the local heating by where T is temperature, ρ is the density of water, and c p is the specific heat of water.

Epibenthic optical model
The spectrally resolved light field at the base of the water column is attenuated, from top to bottom, by macroalgae and seagrass (Zostera, then shallow and then deep forms of Halophila), followed by the zooxanthellae in corals.
The downwelling irradiance at wavelength λ after passing through each macroalgae and seagrass species is given by E below,λ : where E above,λ for macroalgae is E d,bot,λ , the downwelling irradiance of the bottom water column layer, A λ is the leaf- Figure 10. Spectrally resolved energy distribution of sunlight, clear-water absorption and clear-water scattering (Smith and Baker, 1981). The fraction of solar radiation between 400 and 700 nm for clear-sky irradiance at the particular spectral resolution is given in panel (a).
The centre of each waveband used in the model simulations is identified by a cross on each curve. Panel (d) shows the pigment-specific absorption of Chl a and generic photosynthetic carotenoids (Ficek et al., 2004) that were used in earlier versions of this model  before the mass-specific absorption coefficients of multiple accessory pigments were implemented (Figs. 5, 6 and 7). specific absorptance, is the nitrogen-specific leaf area, and X is the leaf nitrogen biomass. The light absorbed by corals is assumed to be entirely due to zooxanthellae and is given by where n = CS/m N,CS is the areal density of zooxanthellae cells and α λ is the absorption cross-section of a cell a result of the absorption of multiple pigment types.

Sediment optical model
The optical model in the sediment only concerns the benthic microalgae growing in the porewaters of the top sediment layer. The calculation of light absorption by benthic microalgae assumes they are the only attenuating component in a layer that lies on top layer of sediment, with a perfectly absorbing layer below and no scattering by any other components in the layer. Thus, no light penetrates through to the second sediment layer where benthic microalgae also reside. Thus, the downwelling irradiance at wavelength λ at the bottom of a layer, E d,λ,bot , is given by where E d,top,λ is the downwelling irradiance at wavelength λ at the top of the layer and α λ is the absorption cross-section of the cell at wavelength λ, and n is the concentration of cells in the layer. The layer thickness used here, h, is the thickness of the top sediment layer, so as to convert the concentration of cells in that layer, n, into the areal concentration of cells in the biofilm, n h. Given no scattering in the cell, and that the vertical attenuation coefficient is independent of azimuth angle, the scalar irradiance that the benthic microalgae is exposed to in the surface biofilm is given by The photons captured by each cell, and the microalgae process, follow the same equations as for the water column (Sect. 5.1.3).

Microalgae
The model contains four functional groups of suspended microalgae: small and large phytoplankton, microphytobenthos and Trichodesmium. The growth from internal reserves for each of the functional groups is identical and explained below. The differences in the ecological interactions of the four functional groups are summarised in Table 3. Trichodesmium, a nitrogen fixer, contains additional processes (Sect. 5.2).

Microalgal growth
The growth of microalgae has been modelled in many ways, from simple exponential growth and logistic growth curves, to single-and multiple-nutrient-based curves, through to equations that contain a state variable for the physiological state of the cell (variously described as stores, quotas, reserves, etc.) and to consider the complex processing of photons in the microalgae photosystem. It is now common for complex biogeochemical models to contain state variables for the physiological state of each of the potentially limiting nutrients (Baretta-Bekker et al., 1997;Vichi et al., 2007) and include adaptation to photosystems (Geider et al., 1998). In the context of many different microalgae models, the model that is described here has taken another path again. As articulated above, we chose to base nutrient uptake and light absorption on using geometric constraints. This meant that any growth model needed to be formulated around the maximum rate of supply of each of the limiting nutrients (and light) (see Fig. 2 of Baird et al., 2006). In the microalgae model (most fully described in Baird et al., 2001), the uptake of nutrients and light absorption increases the reserves of nutrients and light, as quantified by a reserve, R, which has units of mass per cell. In the equations, we often use a normalised reserve, R * , which is a quantity between 0 and 1 ( Table 4). The reserves are in turn consumed to generate structural material. Thus, the total content of nitrogen in the microalgae is equal to the sum of the structural material and the reserves.
The model considers the diffusion-limited supply of dissolved inorganic nutrients (N and P) and the absorption of light, delivering N, P and fixed C to the internal reserves of the cell (Fig. 11). Nitrogen and phosphorus are taken directly into the reserves, but carbon is first fixed through photosynthesis (Kirk, 1994): The internal reserves of C, N and P are consumed to form structural material at the Redfield ratio (Redfield et al., 1963): where we have represented nitrogen as ammonium (NH 4 ) in Eq. (27). When the nitrogen source to the cell is nitrate, NO 3 , it is assumed to lose its oxygen at the cell wall (Sect. 9.1). Figure 11. Schematic of the process of microalgae growth from internal reserves. Blue circle: structural material; red pie: nitrogen reserves; purple pie: phosphorus reserves; yellow pie: carbon reserves; green pie: pigment content. Here, a circular pie has a value of 1, representing the normalised reserve (a value between 0 and 1). The box shows that generating structural material for an additional cell requires the equivalent of 100 % internal reserves of carbon, nitrogen and phosphorus of one cell. This figure shows the discrete growth of two cells to three, requiring both the generation of new structural material from reserves and the reserves being diluted as a result of the number of cells in which they are divided increasing from two to three. Thus, the internal reserves for nitrogen after the population increases from two to three is given by two from the initial two cells, minus one for building structural material of the new cell, shared across the three offspring, to give one-third. The same logic applies to carbon and phosphorus reserves, with phosphorus reserves being reduced to one-sixth and carbon reserves being exhausted. In contrast, pigment is not required for structural material so the only reduction is through dilution; the three-fourths content of two cells is shared among three cells to equal one-half in the three cells. This schematic shows one limitation of a population-style model whereby reserves are "shared" across the population (as opposed to individual-based modelling; Beckmann and Hense, 2004). A proof of the conservation of mass for this scheme, including under mixing of populations of suspended microalgae, is given in . The model equations also include terms affecting internal reserves through nutrient uptake, light absorption, respiration and mortality that are not shown in this simple schematic.
The growth rate of microalgae is given by the maximum growth rate, µ max , multiplied by the normalised reserves, R * , of each of C, N and P: The mass of the reserves (and therefore the total C : N : P : Chl a ratio) of the cell depends on the interaction of the supply and consumption rates (Fig. 11). When consumption exceeds supply, and the supply rates are non-Redfield, the normalised internal reserves of the non-limiting nutrients approach 1, while the limiting nutrient becomes depleted. Thus, the model behaves like a "law of the minimum" growth model, except during fast changes in nutrient supply rates.
The molar ratio of a cell, the addition of structural material and reserves, is given by

Nutrient uptake
The diffusion-limited nutrient uptake to a single phytoplankton cell, J , is given by where ψ is the diffusion shape factor (= 4π r for a sphere), D is the molecular diffusivity of the nutrient, C b is the average extracellular nutrient concentration, and C w is the concentration at the wall of the cell. The diffusion shape factor is determined by equating the divergence of the gradient of the concentration field in the vicinity of the cell to zero (∇ 2 C = 0). A semi-empirical correction to Eq. (30), to account for fluid motion around the cell, and the calculation of non-spherical diffusion shape factors, has been applied in earlier work (Baird and Emsley, 1999). For the purposes of biogeochemical modelling, these uncertain corrections for small-scale turbulence and non-spherical shapes are not quantitatively important and have not been pursued here. Numerous studies have considered diffusion-limited transport to the cell surface at low nutrient concentrations saturating to a physiologically limited nutrient uptake at higher concentrations (Hill and Whittingham, 1955;Pasciak and Gavis, 1975;Mann and Lazier, 2006). The physiological limitation is typically considered using a Michaelis-Menten-type equation. Here, we simply consider the diffusion-limited uptake to be saturated by the filling up of reserves, (1 − R * ). Thus, nutrient uptake is given by where R * is the normalised reserve of the nutrient being considered. As shown later when considering preferential ammonium uptake, under extreme limitation relative to other nutrients, R * approaches 0, and uptake approaches the diffusion limitation.

Light capture and chlorophyll synthesis
Light absorption by microalgae cells has already been considered above (Eq. 6). The same absorption cross-section, α, is used to calculate the capture of photons per cell: where 1 − R * C accounts for the reduced capture of photons as the reserves becomes saturated, and (10 9 hc) −1 A V converts from energy to photons. The absorption cross-section is a function of intracellular pigment concentration, which is a dynamic variable determined below. While a drop-off of photosynthesis occurs as the carbon reserves become replete, this formulation does not consider photo-inhibition due to photooxidative stress, although it has been considered elsewhere for zooxanthellae (Baird et al., 2018).
The rate of synthesis of pigment is based on the incremental benefit of adding pigment to the rate of photosynthesis. This calculation includes both the reduced benefit when carbon reserves are replete, (1 − R * C ), and the reduced benefit due to self-shading, χ . The factor χ is calculated for the derivative of the absorption cross-section per unit projected area (see Eq. 6), α/PA, with non-dimensional group ρ = γ c i r. For a sphere of radius r , where χ represents the area-specific incremental rate of change of absorption with ρ. The rate of chlorophyll synthesis is given by where k max Chl is the maximum rate of synthesis, θ min is the minimum C : Chl ratio, and the line in χ signifies the mean over the photosynthetically available radiation. At θ min , pigment synthesis is zero. Both self-shading and the rate of photosynthesis itself are based on photon absorption rather than energy absorption (Table 5), as experimentally shown in Nielsen and Sakshaug (1993).
For each phytoplankton type, the model considers multiple pigments with distinct absorption spectra. The model needs to represent all photo-absorbing pigments as the C : Chl model calculates the pigment concentration based on that required to maximise photosynthesis. If only Chl a was represented, the model would predict a Chl a concentration that was accounting for the absorption of Chl a and the auxiliary pigments, thus overpredicting the Chl a concentration when compared to observations.

Carbon fixation/respiration
When photons are captured, there is an increase in reserves of carbon, k I (1 − R * C ) (Eq. 46), and an accompanying uptake of dissolved inorganic carbon, 106 1060 12k I (1 − R * C ) (Eq. 42), and release of oxygen, 106 1060 32k I (1 − R * C ) (Eq. 43), per cell to the water column (Table 5). Additionally, there is a basal respiration, representing a constant cost of cell maintenance. The loss of internal reserves, µ max B m B,C φR * C , results in a gain of water column dissolved inorganic carbon per cell, 106 1060 12 14 µ max B φR * C , as well as an uptake of dissolved oxygen per cell, 106 1060 32 14 µ max B φR * C ( Table 5). The loss in water column dissolved oxygen per cell represents an instantaneous respiration of the fixed carbon reserves. Basal respiration decreases internal reserves, and therefore growth rate, but does not directly lead to cell mortality at zero carbon reserves. Implicit in this scheme is that the basal cost is higher when the cell has more carbon reserves, R * C .
A linear mortality term, resulting in the loss of structural material and carbon reserves, is considered later.

Application of single cell rates to a population
As mentioned above, the nutrient uptake and light absorption rates are calculated on a per cell basis. This has allowed geometric considerations to be explicitly used and contrasts with most biogeochemical models that formulate planktonic rates based on population interactions. However, the state variables for microalgae (and zooplankton) are for the population. Therefore, rates per cell need to be multiplied by the number of cells to obtain population rates. In the case of microalgae, the number of cells n is given by B/m B,N . This assumes all cells in the population are identical and that the state variable for the population, B, is quantifying only the nitrogen (or oxygen, carbon and phosphorus) associated with the structural material. It should also be noted that all cells in a population have the same state of their reserves.

Conservation of mass of microalgae model
The conservation of mass of cells containing structural material and reserves during transport, growth and mortality is established in . Briefly, for microalgal growth, total concentration of nitrogen in microalgae cells is given by B+BR * N . For conservation of mass, the time derivatives must equate to zero: using the product rule to differentiate the second term on the left-hand side: where thus demonstrating conservation of mass when m B,N = R max N , as used here. The state variables, equations and parameter values for microalgae growth are listed in Tables 4, 5 and 6, respectively. The equations in Table 5 described nitrogen uptake from the DIN pool. The partitioning of uptake between nitrate and ammonium due to preferential ammonium uptake is described in Sect. 9.1. Earlier published versions of the microalgae model are described with multiple nutrient limitation (Baird et al., 2001), with variable C : N ratios (Wild-Allen et al., 2010) and variable C : Chl ratios . Further, demonstration of the conservation of mass during transport is given in .

Nitrogen-fixing Trichodesmium
The growth of Trichodesmium follows the microalgae growth and C : Chl model above, with the following additional processes of nitrogen fixation and physiological-dependent buoyancy adjustment, as described in Robson et al. (2013).
Additional parameter values for Trichodesmium are given in Table 7.

Nitrogen fixation
Nitrogen fixation occurs when the DIN concentration falls below a critical concentration, DIN crit , typically 0.3 to 1.6 µmol L −1 (i.e. 4 to 20 mg N m −3 ; Robson et al., 2013), at which point Trichodesmium produces nitrogenase to allow fixation of N 2 . It is assumed that nitrogenase becomes available whenever ambient DIN falls below the value of DIN crit and carbon and phosphorus are available to support nitrogen uptake. The rate of change of internal reserves of nitrogen, R N , due to nitrogen fixation if DIN < DIN crit is given by where N fix is the rate of nitrogen fixation per cell and r is the radius of the individual cell. Using this formulation, Trichodesmium is able to maintain its nitrogen uptake rate at that achieved through diffusion-limited uptake at DIN crit even when DIN drops below DIN crit , provided phosphorus and carbon reserves, R * P and R * C , respectively, are available. The energetic cost of nitrogen fixation is represented as a fixed proportion of carbon fixation, f Nfix , equivalent to a reduction in quantum efficiency, and as a proportion, f nitrogenase , of the nitrogen fixed: where k I is the rate of photon absorption per cell obtain from the microalgal growth model (Table 5).

Buoyancy adjustment
The rate of change of Trichodesmium biomass, B, as a result of density difference between the cell and the water, is approximated by Stokes' law: where z is the distance in the vertical (positive up), µ is the dynamic viscosity of water, g is acceleration due to gravity, r col is the equivalent spherical radius of the sinking mass representing a colony radius, ρ w is the density of water, and ρ is the cell density given by   where R * C is the normalised carbon reserves of the cell (see above), and ρ min and ρ max are the densities of the cell when there is no carbon reserves and full carbon reserves, respectively. Thus, when light reserves are depleted, the cell is more buoyant, facilitating the retention of Trichodesmium in the surface waters.

Carbon chemistry
The major pools of dissolved inorganic carbon species in the ocean are HCO − 3 , CO − 3 and dissolved CO 2 , which influence the speciation of H + and OH − ions, and therefore pH. The interaction of these ions reaches an equilibrium in seawater within a few tens of seconds (Zeebe and Wolf-Gladrow, 2001). In the BGC model here, where calculation time steps are of the order of tens of minutes, it is reasonable to assume that the carbon chemistry system is at equilibrium.
The Ocean Carbon-Cycle Model Intercomparison Project (OCMIP) has developed numerical methods to quantify airsea carbon fluxes and carbon dioxide system equilibria (Najjar and Orr, 1999). Here, we use a modified version of the OCMIP-2 Fortran code developed for MOM4 (Geophysical Fluid Dynamics Laboratory Modular Ocean Model version 4; Griffies et al., 2004). The OCMIP procedures quantify the state of the carbon dioxide (CO 2 ) system using two prognostic variables, the concentration of dissolved inorganic carbon, DIC, and total alkalinity, A T . The value of these prognostic variables, along with salinity and temperature, are used to calculate the pH and partial pressure of carbon dioxide, pCO 2 , in the surface waters using a set of governing chemical equations which are solved using a Newton-Raphson method (Najjar and Orr, 1999).
We altered the OCMIP scheme by increasing the search space for the iterative scheme from ±0.5 pH units (appropriate for global models) to ±2.5. With this change, the scheme converges over a broad range of DIC and A T values (Munhoven, 2013). For more details, see Mongin and Baird (2014) and Mongin et al. (2016b).

Nitrification
Nitrification is the oxidation of ammonium to form nitrite followed by the rapid oxidation of nitrite to nitrate. This is represented in a one-step process, with the rate of nitrification given by where the equations and parameter values are defined in Tables 9 and 10.

Phosphorus absorption-desorption
The rate of phosphorus desorption from particulates is given by where [O 2 ] is the concentration of oxygen, P is the concentration of dissolved inorganic phosphorus, PIP is the concentration of particulate inorganic phosphorus, NAP is the sum of the non-algal inorganic particulate concentrations, and τ Pabs , k Pads,wc and K O 2 ,abs are model parameters described in Table 10. At steady state, the PIP concentration is given by As an example for rivers flowing into the GBR configuration, and P = 4.2 mg m −3 ; thus, the ratio PIP / DIP = 6.86 (see Fig. 12). Limited available observations of absorption-desorption include from the Johnstone River (Pailles and Moody, 1992) and the GBR (Monbet et al., 2007).

Zooplankton herbivory
In the simple food web of the model, herbivory involves small zooplankton consuming small phytoplankton, and large zooplankton consuming large phytoplankton, microphytobenthos and Trichodesmium. For simplicity, the state variables and equations are only given for small plankton grazing (Tables 11, 13), but the parameters are given for all grazing terms (Table 12). The rate of zooplankton grazing is determined by the encounter rate of the predator and all its prey up until the point at which it saturates the growth of the zooplankton (Eq. 75), and then it is constant. This is a Holling type I grazing response (Gentleman, 2002). Under the condition of multiple prey types, there is no preferential grazing other than that determined by the chance of encounter. The encounter rate is the result of the relative motion of individuals brought about by diffusion (Eq. 77), swimming (Eq. 78) and shear (Eq. 79) determined relative velocities (Eq. 80) (Jackson, 1995;Baird, 2003). One particular advantage of formulating the encounter rate on individuals is that should the number of populations considered in the model change (i.e. an additional phytoplankton class is added), there is no need for empirical coefficients in the model to change. More recent uses of encounter-based grazing functions are described in Flynn and Mitra (2016).
Unlike the microalgae, zooplankton does not contain reserves of nutrients and fixed carbon, and therefore has a fixed stoichiometry of the Redfield ratio. As the zooplankton are grazing on the phytoplankton that contain internal reserves of nutrients, an additional flux of dissolved inorganic nutrients (gR * N for nitrogen) is returned to the water column (for more details, see Sect. 5.4.1).

Conservation of mass in zooplankton grazing
It is important to note that the microalgae model presented above represents internal reserves of nutrients, carbon and chlorophyll as a per cell quantity. Using this representation, there are no losses of internal quantities with either grazing or mortality. However, the implication of their presence is represented in the (gR * N ) terms (Table 13) that return the reserves to the water column. These terms represent the fast return of a fraction of phytoplankton nitrogen due to processes like "sloppy eating".
An alternative and equivalent formulation would be to consider total concentration of microalgal reserves in the water column, then the change in water column concentration of reserves due to mortality (either grazing or natural mortality) must be considered. This alternate representation will not be undertaken here as the above considered equations are fully consistent, but it is worth noting that the numerical solution of the model within the code represents total water column concentrations of internal reserves and therefore must include the appropriate loss terms due to mortality.

Zooplankton carnivory
Large zooplankton consume small zooplankton. This process uses similar encounter rate and consumption rate limitations calculated for zooplankton herbivory (Table 13). As zooplankton contain no internal reserves, the equations are simplified from the herbivory case to those listed in Table 14.
Assuming that the efficiency of herbivory, γ , is equal to that of carnivory, and therefore assigned the same parameter, the additional process of carnivory adds no new parameters to the biogeochemical model.

Zooplankton respiration
In the model, there is no change in water column oxygen concentration if organic material is exchanged between pools with the same elemental ratio. Thus, when zooplankton consume phytoplankton, no oxygen is consumed due to the consumption of phytoplankton structural material (B P ). However, the excess carbon reserves represent a pool of fixed carbon, which when released from the phytoplankton must consume oxygen. Further, zooplankton mortality and growth inefficiency result in detritial production, which when remineralised consumes oxygen. Additionally, carbon released to the dissolved inorganic pool during inefficiency grazing on phytoplankton structural material also consumes oxygen. Thus, zooplankton respiration is implicitly captured in these associated processes.

Non-grazing plankton mortality
The rate of change of plankton biomass, B, as a result of natural mortality is given by where m L is the linear mortality coefficient and m Q is the quadratic mortality coefficient. A combination of linear and quadratic mortality rates are used in the model. When the mortality term is the sole loss term, such as zooplankton in the water column or benthic microalgae in the sediments, a quadratic term is employed to represent increasing predation/viral disease losses in dense populations. For suspended microalgae, we have used only

Detritus at the Redfield ratio
D Red mg N m −3 Zooplankton grazing rate g mg N m −3 s −1 Encounter-rate coefficient due to molecular diffusion φ diff m 3 s −1 cell Z −1 Encounter-rate coefficient due to relative motion φ rel m 3 s −1 cell Z −1 Encounter-rate coefficient due to turbulent shear φ shear m 3 s −1 cell Z −1 Phytoplankton cell mass m B,N mg N cell −1 Zooplankton cell mass m Z,N mg N cell −1 a linear term (i.e. m Q = 0). Linear terms have been used to represent a basal respiration rate. As described in Sect. 5.1.6, the mortality terms need to account for the internal properties of lost microalgae. For definitions of the state variables, see Tables 15 and 16.

Air-sea gas exchange
Air-sea gas exchange is calculated using wind speed (we choose a cubic relationship; Wanninkhof and McGillis, 1999), saturation state of the gas (described below) and the Schmidt number of the gas (Wanninkhof, 1992). The transfer coefficient, k, is given by where 0.0283 cm h −1 is an empirically determined constant (Wanninkhof and McGillis, 1999), u 10 is the short-term steady wind at 10 m above the sea surface (m s −1 ), the Schmidt number, Sc, is the ratio of the diffusivity of momentum and that of the exchanging gas, and is given by a cubic temperature relationship (Wanninkhof, 1992). Finally, a conversion factor of 360 000 m s −1 (cm h −1 ) −1 is used.
In practice, the hydrodynamic model can contain thin surface layers as the surface elevation moves between z levels. Further, physical processes of advection and diffusion and gas fluxes are done sequentially, allowing concentrations to build up through a single time step. To avoid unrealistic changes in the concentration of gases in thin surface layers, the shallowest layer thicker than 20 cm receives all the surface fluxes.  (1) If the zooplankton diet contains multiple phytoplankton classes, and grazing is prey saturated, then phytoplankton loss must be reduced to account for the saturation by other types of microalgae.
(2) Z m Z is the number of individual zooplankton. (3) Phytoplankton pigment is lost to water column without being conserved. Chl a has a chemical formulae of C 55 H 72 O 5 N 4 Mg and a molecular weight of 893.49 g mol −1 . The uptake (and subsequent remineralisation) of molecules for chlorophyll synthesis could make up a maximum (at C : Chl = 20) of (660/893)/20 and (56/893)/20 × (16/106) × (14/12)), or ∼ 4 % and ∼ 2 % of the exchange of C and N between the cell and water column, and will cancel out over the lifetime of a cell. Thus, the error in ignoring chlorophyll loss to the water column is small.

Oxygen
The saturation state of oxygen [O 2 ] sat is determined as a function of temperature and salinity following Weiss (1970). The change in concentration of oxygen in the surface layer due to a sea-air oxygen flux (positive from sea to air) is given by where k O 2 is the transfer coefficient for oxygen (Eq. 100), [O 2 ] is the dissolved oxygen concentration in the surface waters, and h is the thickness of the surface layer of the model into which sea-air flux flows.

Carbon dioxide
The change in surface dissolved inorganic carbon concentration, DIC, resulting from the sea-air flux (positive from sea to air) of carbon dioxide is given by where k CO 2 the transfer coefficient for carbon dioxide (Eq. 100), [CO 2 ] is the dissolved carbon dioxide concentration in the surface waters determined from DIC and A T using the carbon chemistry equilibria calculations described in Sect. 5.3.1, [CO 2 ] atm is the partial pressure of carbon dioxide in the atmosphere, and h is the thickness of the surface layer of the model into which sea-air flux flows.
Table 17. Equations for the zooplankton mortality. f Z2det is the fraction of zooplankton mortality that is remineralised and is equal to 0.5 for both small and large zooplankton.
Note the carbon dioxide flux is determined not by the gradient in DIC but the gradient in [CO 2 ]. At pH values around 8, [CO 2 ] makes up only approximately 1/200 of DIC in seawater, significantly reducing the air-sea exchange. Counteracting this reduced gradient, note that changing DIC results in an approximately 10-fold change in [CO 2 ] (quantified by the Revelle factor; Zeebe and Wolf-Gladrow, 2001). Thus, the gas exchange of CO 2 is approximately 1/200 × 10 = 1/20 of the oxygen flux for the same proportional perturbation in DIC and oxygen. At a Sc number of 524 (25 • C seawater) and a wind speed of 12 m s −1 , 1 m of water equilibrates with CO 2 in the atmosphere with an e-folding timescale of approximately 1 d.

Epibenthic processes
In the model, benthic communities are quantified as a biomass per unit area or areal biomass. At low biomass, the community is composed of a few specimens spread over a small fraction of the bottom, with no interaction between the nutrient and energy acquisition of individuals. Thus, at low biomass, the areal fluxes are a linear function of the biomass.
As biomass increases, the individuals begin to cover a significant fraction of the bottom. For nutrient and light fluxes that are constant per unit area, such as downwelling irradiance and sediment releases, the flux per unit biomass decreases with increasing biomass. Some processes, such as photosynthesis in a thick seagrass meadow or nutrient uptake by a coral reef, become independent of biomass (Atkinson, 1992) as the bottom becomes completely covered. To capture the non-linear effect of biomass on benthic processes, we use an effective projected area fraction, A eff .
To restate, at low biomass, the area on the bottom covered by the benthic community is a linear function of biomass. As the total leaf area approaches and exceeds the projected area, the projected area for the calculation of water-community exchange approaches 1 and becomes independent of biomass. This is represented using where A eff is the effective projected area fraction of the benthic community (m 2 m −2 ), B is the biomass of the benthic community (g N m −2 ), and B is the nitrogen-specific leaf area coefficient (m 2 g N −1 ). For further explanation of B , see Baird et al. (2016a). The parameter B is critical: it provides a means of converting between biomass and fractions of the bottom covered and is used in calculating the absorption cross-section of the leaf and the nutrient uptake of corals and macroalgae. That B has a simple physical explanation and can be determined from commonly undertaken morphological measurement (see below), gives us confidence in its use throughout the model.

Macroalgae
The macroalgae model considers the diffusion-limited supply of dissolved inorganic nutrients (N and P) and the absorption of light, delivering N, P and fixed C, respectively. Unlike the microalgae model, no internal reserves are considered, implying that the macroalgae has a fixed stoichiometry that can be specified as where the stoichiometry is based on Atkinson and Smith (1983) (see also Hadley et al., 2015a, b). Note that when ammonium is taken up instead of nitrate there is a slightly different O 2 balance (Sect. 9.1).
In the next section, we will consider the maximum nutrient uptake and light absorption and then bring them together to determine the realised growth rate.

Nutrient uptake
Nutrient uptake by macroalgae is a function of nutrient concentration, water motion (Hurd, 2000) and internal physiology. The maximum flux of nutrients is specified as a mass transfer limit per projected area of macroalgae and is given by (Falter et al., 2004;Zhang et al., 2011) where S x is the mass transfer rate coefficient of element x = N, P, τ is the shear stress on the bottom, ρ is the density of water, and Sc x is the Schmidt number. The Schmidt number is the ratio of the diffusivity of momentum, ν, and mass, D x (Table 6), and varies with temperature, salinity and nutrient species. The rate constant S can be thought of as the height of water cleared of mass per unit of time by the watermacroalgae exchange.

Light capture
The calculation of light capture by macroalgae involves estimating the fraction of light that is incident upon the leaves and the fraction that is absorbed. The rate of photon capture is given by where h, c and A V are fundamental constants, 10 9 nm m −1 accounts for the typical representation of wavelength, λ, in nm, and A L,λ is the spectrally resolved leaf-specific absorptance. As shown in Eq. (103), the term 1 − exp (− MA MA) gives the effective projected area fraction of the community. In the case of light absorption of macroalgae, the exponent is multiplied by the leaf-specific absorptance, A L,λ , to account for the transparency of the leaves. At low macroalgae biomass, absorption at wavelength λ is equal to E d,λ A L,λ MA MA, increasing linearly with biomass as all leaves at low biomass are exposed to full light (i.e. there is no self-shading). At high biomass, the absorption by the community asymptotes to E d,λ , at which point increasing biomass does not increase the absorption as all light is already absorbed. For more details on the calculation of MA , see Baird et al. (2016a).

Growth
The growth rate combines nutrient, light and maximum organic matter synthesis rates following 14 31 and the production of macroalgae is given by µ MA MA. We have used the commonly applied multiple minimum function (von Liebig, 1840), although it is noted that others use the multiple of limitation terms (Fasham, 1993). The microalgae model described above uses dynamical reserves to determine the growth rate. The growth approximated using dynamical reserves closer approximates a multiple minimum function than a multiple of minimum terms, so it was deemed more appropriate to use a multiple minimum function for macroalgae and seagrass for which internal reserves were not resolved. The maximum growth rate is inside the minimum operator. This allows the growth of macroalgae to be independent of temperature at low light but still have an exponential dependence at maximum growth rates .

Mortality
Mortality is defined as a simple linear function of biomass: A quadratic formulation is not necessary as both the nutrient and light capture rates become independent of biomass as MA 1/ MA . Thus, the steady-state biomass of macroalgae under nutrient limitation is given by and for light-limited growth by The full macroalgae variables, equations and parameters are listed in Tables 18, 19 and 20.

Seagrass
Seagrasses are quantified per m 2 with a constant stoichiometry (C : N : P = 550 : 30 : 1) for both above-ground, SG A , and below-ground, SG B , biomass and can translocate organic matter at this constant stoichiometry between the two stores of biomass. Growth occurs only in the above-ground biomass, but losses (grazing, decay, etc.) occur in both. Multiple seagrass varieties are represented. The varieties are modelled using the same equations for growth, respiration and mortality but with different parameter values. Here, we just list the variables, equations and parameters (Tables 21, 22 and 23) for the seagrass submodel. A description of the seagrass processes of growth, translocation between roots and leaves, and mortality has been published in Baird et al. (2016a), along with a comparison to observations from Gladstone Harbour on the northeast Australian coast.

Coral polyps
The coral polyp parameterisation consists of a microalgae growth model to represent zooxanthellae growth based on Baird et al. (2013), and the parameterisation of coral-zooxanthellae interaction based on the host-symbiont model of Gustafsson et al. (2013), and the photo-adaptation, photoinhibition and reaction centre dynamics model of Baird et al. (2018). The extra detail on the zooxanthellae photosystem is required due to its important role in thermal-stress-driven coral bleaching (Yonge, 1930;Suggett et al., 2008).

Coral host, symbiont and the environment
The state variables for the coral polyp model (Table 24) include the biomass of coral tissue, CH (g N m −2 ), and the structure material of the zooxanthellae cells, CS (mg N m −2 ). The structure material of the zooxanthellae, CS, in addition to nitrogen, contains carbon and phosphorus at the Redfield ratio. The zooxanthellae cells also contain reserves of nitrogen, R N (mg N m −2 ), phosphorus, R P (mg P m −2 ), and carbon, R C (mg C m −2 ). The zooxanthellae light absorption capability is resolved by considering the time-varying concentrations of pigments chlorophyll a, Chl, diadinoxanthin, X p , and diatoxanthin, X h , for which the state variable represents the areal concentration. A further three pigments, chlorophyll c 2 , peridinin and β carotene, are considered in the absorption calculations,  Exchanges between the coral community and the overlying water can alter the water column concentrations of dissolved inorganic carbon, DIC, nitrogen, N, and phosphorus, P , as well as particulate phytoplankton, B, zooplankton, Z, and detritus, D, where multiple nitrogen, plankton and detritus types are resolved (Table 24). The coral host is able to assimilate particulate organic nitrogen either through translocation from the zooxanthellae cells or through the capture of water column organic detritus and/or plankton. The zooxanthellae varies its intracellular pigment content depending on potential light limitation of growth, and the incremental benefit of adding pigment, allowing for the package effect . The coral tissue is assumed to have a Redfield C : N : P stoichiometry (Redfield et al., 1963), as shown by Muller-Parker et al. (1994). The zooxanthellae are modelled with variable C : N : P ratios (Muller-Parker et al., 1994), based on a structure material at the Redfield ratio but with variable internal reserves. The fluxes of C, N and P with the overlying water column (nutrient uptake and detritial/mucus release) can therefore vary from the Redfield ratio.
Here, we present the state variables (Table 24), derived variables (Table 25), equations (Tables 26, 27, 28 and 29) and parameters values (Tables 30 and 31) for the coral submodel. The description of the coral processes has been published in Baird et al. (2018), along with a comparison to observations from the Great Barrier Reef on the northeast Australian coast.

Coral calcification
The rate of coral calcification is a function of the water column aragonite saturation, a , and the normalised reserves of fixed carbon in the symbiont, R * C . The rates of change of DIC and total alkalinity, A T , in the bottom water column layer of thickness h wc due to calcification becomes where g is the rate of net calcification, k day and k night are defined in Table 30 with habitat-specific values (Anthony et al.,  2011; Mongin and Baird, 2014). The fluxes are scaled by the effective projected area of the community, A eff . The power of 2 for R * C ensures that generally light-replete symbionts provide the host with sufficient energy for calcification.

Dissolution of shelf carbonate sands
In addition to the dissolution of carbonate sands on a growing coral reef, which is captured in the net dissolution quantified above, the marine carbonates on the continental shelf dissolve (Eyre et al., 2018). Like above, the dissolution of marine carbonates is approximated as a source of DIC and alkalinity but does not affect the properties (mass, porosity, etc.) of the underlying sediments.
We assume carbonate dissolution from the sediment bed is proportional to the fraction of the total surface sediment that is composed of either sand or mud carbonates. Other components, whose fraction do not release DIC and alkalinity, include carbonate gravel and non-carbonate mineralogies. Thus, the change in DIC and A T in the bottom water column layer is given by where M is the total mass of surface layer inorganic sediments (see Sect. 7), d CaCO 3 is the dissolution rate of CaCO 3 and is the reverse reaction to calcification, and h wc is the thickness of the water column layer. The dissolution rate, d CaCO 3 (mmol m −2 d −1 ), is assumed to be a function of a (Eyre et al., 2018): d CaCO 3 = −11.51 a + 33.683.

Brief summary of processes in the sediments
The EMS model contains a multi-layered sediment compartment with time-and space-varying vertical layers and the Table 23. Constants and parameter values used to model seagrass. a Factor of 2 for nighttime, factor of 2 for roots. b Zostera is calculated from leaf characteristics in Kemp et al. (1987); Hansen et al. (2000); Halophila ovalis is calculated from leaf dimensions in Vermaat et al. (1995); SG can also be determined from specific leaf area such as determined in Cambridge and Lambers (1998) for nine Australian seagrass species. c Spectrally resolved values in Baird et al. (2016a). d Duarte and Chiscano (1999). e Loosely based on Kaldy et al. (2013). f Thalassia testudinum (Gras et al., 2003). g Thalassia testudinum (Lee and Dunton, 1999). h Chartrand et al. (2012); Longstaff (2003); Chartrand et al. (2017). i Roberts (1993   The sediment model contains inorganic particles of different sizes (dust, mud, sand and gravel) and different mineralogies (carbonate and non-carbonate) ( Table 33). The sediment model includes the processes of particulate advection and mixing in the water column, resuspension sinking and settling, as well as sediment overturning and bioturbation ). These processes, along with initial conditions, determine the mass of each inorganic particulate type in the sediments.
The critical shear stress for resuspension and the sinking rates are generally larger for large particles, while mineralogy only affects the optical properties. The size-class dust only has a non-carbonate form. FineSed also only has a noncarbonate form and has the same physical and optical properties as non-carbonate mud, except that it is initialised with a zero value. Dust and FineSed are particles that enter the domain from rivers during the simulation.
The organic matter classes are discussed in the Sect. 8.1. The inorganic and organic particulate classes are summarised in Table 33 and undergo resuspension, sinking, settling, sediment overturning and bioturbation in a manner similar to the inorganic particulates.

Sediment nitrification-denitrification
Nitrification in the sediment is similar to the water column but with a sigmoid rather than hyperbolic relationship at low oxygen for numerical reasons (Eq. 204). Denitrification occurs only in the sediment.

Sediment phosphorus absorption-desorption
Sediment phosphorus absorption-desorption is similar to water column (Eq. 206). There is an additional pool of immobilised particulate inorganic phosphorus (PIPI) which accu- Table 26. Equations for the interactions of coral host, symbiont and environment excluding bleaching loss terms that appear in Table 29. The term CS/m B,N is the concentration of zooxanthellae cells. The equation for organic matter formation gives the stoichiometric constants; 12 g C mol C −1 ; 32 g O mol O 2 −1 .  Table 31.
mulates in the model over time as PIP becomes immobilised and represents permanent sequestration (Eq. 207).
8 Common water, epibenthic and sediment processes

Detritus remineralisation
The non-living components of the C, N and P cycles include the particulate labile and refractory pools, and a dissolved pool (Fig. 4). The labile detritus has a pool at the Redfield ratio, D Red , and at the Atkinson ratio, D Atk , resulting from mortality of organic matter at these ratios (see processes above). The labile detritus from both pools then breaks down into refractory detritus and dissolved organic matter. In order to account for the mixed source of labile detritus, the refrac-tory detritus and dissolved organic matter pools are quantified by individual elements (C, N, P). A component of the breakdown of each of these pools is returned to dissolved inorganic components. Finally, as the refractory and dissolved components are separated into C, N and P components, this introduces the possibility to have P components break down quicker than C and N. This is specified as the breakdown rate of P relative to N, RD P and DOM P , respectively, for refractory and dissolved detritus. The variables, equations and parameter values for detritus remineralisation can be found in Tables 37, 38 and 39, respectively.

Anaerobic and anoxic respiration
The processes of remineralisation, phytoplankton mortality and zooplankton grazing return carbon dioxide to the water 4534 M. E. Baird et al.: CSIRO shallow-water biogeochemical model Table 28. Equations for symbiont reaction centre dynamics. Bleaching loss terms appear in Table 29.  column. In oxic conditions, these processes consume oxygen in a ratio of DIC : 32 12 [O 2 ]. At low oxygen concentrations, the oxygen consumed is where K OA is the half-saturation constant for anoxic respiration (Boudreau, 1996). A sigmoid saturation term is used because it is more numerically stable as the oxygen concentration approaches 0. The anoxic component of remineralisation results in an increased chemical oxygen demand (COD): where COD is a dissolved tracer, with the same units as oxygen.
When oxygen and COD coexist, they react to reduce both, following where 8000 mg O m −3 is approximately the saturation concentration of oxygen in seawater, and τ COD is the timescale of this reduction. The term min[COD, 8000] is required because COD represents the end stage of anoxic reduction and can become large for long simulations. Even with this limitation, if τ COD = 1 h −1 , the processes in Eqs. (223) and (224) proceed faster than most of the other porewater processes.   Straile (1997). c Redfield et al. (1963) and Kirk (1994). d Finkel (2001). e Ribes and Atkinson (2007); Wyatt et al. (2010). f, g Gustafsson et al. (2013Gustafsson et al. ( , 2014.   Hochberg et al. (2006). c Fitted parameter based on the existence of non-bleaching threshold (Suggett et al., 2009) and a comparison of observed bleaching and model output in the ∼ 1 km model.

Common ecological parameterisations
Most of the ecological processes contain a temperature dependence and, for those uptaking dissolved inorganic nitrogen, preferential ammonium uptake. To simplify the descrip-tion of the above processes, these common parameterisations are described separately in this section. An additional processes common to all variables, and across multiples zones, is the diffusive sediment-water exchange. ], is a mean oceanic value; 12 g C mol C −1 . Other constants and parameters are defined in Table 30.  )   Table 33. Characteristics of the particulate classes. Y -yes, N -no, I -initial condition, C -catchment, OM -remineralisation from organic matter, B -brown, W -white (Condie et al., 2009;

Preferential uptake of ammonium
The model contains two forms of dissolved inorganic nitrogen (DIN) used by photosynthetic organisms, dissolved ammonium (NH 4 ) and dissolved nitrate (NO 3 ): where N is the concentration of DIN, [NH 4 ] is the concentration of dissolved ammonium and [NO 3 ] is the concentration of nitrate. In the model, the ammonium component of the DIN pool is assumed to be taken up first, followed by the nitrate, with the caveat that the uptake of ammonium cannot exceed the diffusion limit for ammonium. The underlying principle of this assumption is that photosynthetic organisms can entirely prefer ammonium but that the uptake of ammonium is still limited by diffusion to the organism's surface.
As the nitrogen uptake formulation varies for the different autotrophs, the formulation of the preference of ammonium also varies. The diffusion coefficient of ammonium and ni-trate are only 3 % different, so for simplicity we have used the nitrate diffusion coefficient for both.
Thus, for microalgae (Eq. 40) and Trichodesmium (Eq. 55), which both contain internal reserves of nitrogen, the partitioning of nitrogen uptake is given by For macroalgae (Eq. 108) and seagrass leaves (Eq. 122), which also have diffusion limits to uptake but are not repre- Zooxanthellae is a combination of the two cases above, because in the model they contain reserves like microalgae, but the uptake rate is across a 2-D surface like macroalgae.
In the case of nutrient uptake by seagrass roots (Eq. 124), which has a saturating nitrogen uptake functional form, the terms are where K N is a function of the ratio of above-ground to below-ground biomass described in Baird et al. (2016a).
One feature worth noting is that the above formulation for preferential ammonium uptake requires no additional parameters, which is different to other classically applied formulations (Fasham et al., 1990) that require a new parameter, potentially for each autotroph. This simple use of the geometric constraint has an important role in reducing model complexity.

Oxygen release during nitrate uptake
For all autotrophs, the uptake of a nitrate ion results in the retention of the one nitrogen atom in their reserves or structural material, and the release of the three oxygen atoms into the water column or porewaters.
The oxygen that is part of the structural material of microalgae is assumed to have been taken up through photosynthesis. For simplicity, in the equations for autotroph-driven changes in dissolved oxygen above, we have assumed that DIN uptake is ammonium. Thus, after partitioning on nitrogen uptake, the term in Eq. (235) needs to be added to change in oxygen in microalgae (Eq. 40), Trichodesmium (Eq. 55) and other autotrophs.

Temperature dependence of ecological rates
Physiological rate parameters (maximum growth rates, mortality rates, remineralisation rates) have a temperature dependence that is determined from where r T is the physiological rate parameter (e.g. µ, ζ ) at temperature T , T ref is the reference temperature (nominally 20 • C for GBR), r T ref the physiological rate parameter at temperature T ref , Q 10 is the Q10 temperature coefficient and represents the rate of change of a biological rate as a result of increasing temperature by 10 • C.
Note that while physiological rates may be temperature dependent, the ecological processes they are included in may not. For example, for extremely light-limited growth, all autotrophs capture light at a rate independent of temperature. With the reserves of nutrients replete, the steady-state realised growth rate, µ, becomes the rate of photon capture, k. This can be shown algebraically: This corresponds with observations of no temperature dependence of photosynthesis at low light levels (Kirk, 1994).
Similar arguments show that extremely nutrient limited autotrophs will have the same temperature dependence to that of the diffusion coefficient. Thus, the autotroph growth model has a temperature dependence that adjusts appropriately to the physiological condition of the autotroph and is a combination of constant, exponential and polynomial expressions.
Physiological rates in the model that are not temperature dependent are mass transfer rate constant for particulate grazing by corals, S Part ; net coral calcification g; maximum chlorophyll synthesis, k max Chl ; and rate of translocation between leaves and roots in seagrass, τ tran .

Diffusive exchange of dissolved tracers across sediment-water interface
Due to the thin surface sediment layer, and the potentially large epibenthic drawdown of porewater dissolved tracers, the exchange of dissolved tracers between the bottom water column layer and the top sediment layer is integrated in the same numerical operation as the ecological tracers (other transport processes occurring between ecological time steps). The flux, J , is given by where C and C s are the concentration in water column and sediment, respectively, and k is the transfer coefficient.
For the simulations, we used k = D/ h = 4.6 × 10 −7 m s −1 , where D = 3 × 10 −9 m 2 s −1 is the diffusion coefficient and h = 0.0065 mm is the thickness of the diffusive layer.   While, in reality, k would vary with water column and sediment hydrodynamics as influenced by community type, etc., these complexities have not been considered. In addition to the diffusive flux between the sediment and water column, particulate deposition entrains water column water into the sediments, and particulate resuspension releases porewaters into the water column. Sediment model details can be found at https://research.csiro.au/cem/software/ems/ ems-documentation/ (last access: 22 September 2020).

Splitting of physical and ecological integrations
The numerical solution of the time-dependent advectiondiffusion-reaction equations for each of the ecological tracers is implemented through sequential solving of the partial differential equations (PDEs) for advection and diffusion, and the ordinary differential equations (ODEs) for reactions. This technique, called operator splitting, is common in geophysical science (Hundsdorfer and Verwer, 2003;Butenschön et al., 2012).
Under the sequential operator splitting technique used, first the advection-diffusion processes are solved for the period of the time step (15 min-1 h; Table 40). The values of the tracers at the end of this PDE integration, and the initial time, are then used as initial conditions for the ODE integration. After the ODE integration has run for the same time period, the values of the tracers are updated, and time is considered to have moved forward just one time step. The integration continues to operate sequentially for the whole model simulation. The errors due to operator splitting can be significant (Butenschön et al., 2012), although tests in relatively coarse (4 km) models show that reducing the time step from 60 to 30 min does not substantially change the model solution. For higher-resolution models, shorter timescales are required to resolve finer-scale motion and its interaction with ecological processes.
The PDE solvers are described in the physical model description available at https://research.csiro.au/cem/software/ ems/ems-documentation/ (last access: 22 September 2020).
The code allows fourth-to fifth-order and seventh-to eighth-order adaptive ODE solvers following Dormand and Prince (1980), as well as the Euler method and adaptive firstand second-order solvers. The preferred scheme is the adap-  290,310,330,350,370,390,410,430,440,450,470,490,510,530,550,570,590,610,630,650,670,690,710  tive fourth-fifth order (similar to ode45 in MATLAB) and implemented in numerous biogeochemical models (Yool, 1997). This requires seven function evaluations for the first step and six for each step after. A relative tolerance of 10 −5 is required for each state variable for the integration step to proceed.
The solution of the ecological equations are independent for each vertical column and depend only on the layers above through which the light has propagated. For an n wc -layer water column and n sed -layer sediment, the integrator sequentially solves the top n wc − 1 water column layers; the nth water column layer, epibenthic and top sediment layer together; and then the n sed − 1 to bottom sediment layers.

Optical integration
The inherent and apparent optical properties are calculated between the hydrodynamic and ecological integrations. The light field used for each ecological time step is that calculated at the start time of the ecological integration. The spectral resolution of 25 wavebands has been chosen to resolve the absorption peaks associated with Chl a and to span the optical wavelengths. The wavelengths integrated have been chosen such that the lower end of one waveband and the top end of another fall on 400 and 700 nm, respectively, allowing precise calculation of photosynthetically available radiation (PAR).

Approximation of stoichiometric coefficients
In this model description, we have chosen to explicitly include atomic mass as integer values, so that the unit conversions are more readable in the equations than if they had all been rendered as mathematical symbols. Nonetheless, these values are more precisely given in the numerical code (Table 41). It is worth remembering that the atomic masses are approximations assuming the ratio of isotopes found in the periodic table (Atkins, 1994)

Mass conservation in water column and sediment porewaters
A check of mass conservation of total C, TC, total N, TN, total P, TP, and oxygen, [O 2 ], is undertaken in each grid cell at each time step. To establish mass conservation, the sum of the change in mass (of N, P, C and O) with time and the sinks/sources (such as sea-air fluxes, denitrification) must equate to zero. The total mass and conservation equations are same for the water column and porewaters, with the caveats that (1) airsea fluxes only affect surface layers of the water, (2) denitrification only occurs in the sediment, and (3) the porosity, φ, of the water column is 1. In the sediment, the concentration of particulates is given per unit volume of space, while the concentration of dissolved tracers is given per unit volume of porewater. Thus, the concentration of dissolved tracer, X, per unit space is given by φX.
The total carbon in a unit volume of space and its conservation are given by The total nitrogen in a unit volume of space and its conservation are given by The total phosphorus in a unit volume of space and its conservation are given by The concept of oxygen conservation in the model is more subtle than that of C, N and P due to the mass of oxygen in the water molecules not being considered. When photosynthesis occurs, C is transferred from the dissolved phase to reserves within the cell. With both dissolved and particulate pools considered, mass conservation of C is straightforward. In contrast to C, during photosynthesis, oxygen is drawn from the water molecules (i.e. H 2 O), whose mass is not being considered, and released into the water column. Conversely, when organic matter is broken down, oxygen is consumed from the water column and released as H 2 O.
In order to obtain a mass conservation for oxygen, the concept of biological oxygen demand (BOD) is used. Often BOD represents the biological demand for oxygen in say a 5 d incubation, BOD 5 . Here, for the purposes of mass conservation checks, we use BOD ∞ , the oxygen demand over an infinite time for breakdown. This represents the total oxygen removed from the water molecules for organic matter creation.
Anaerobic respiration reduces BOD ∞ without reducing O 2 but instead creating reduced-oxygen species. This is accounted for in the oxygen balance by the prognostic tracer COD. In other biogeochemical modelling studies, this is represented by a negative oxygen concentration. Thus, at any time point, the biogeochemical model will conserve the oxygen concentration minus BOD ∞ minus COD, plus or minus any sources and sinks such as sea-air fluxes: where R is respiration of organic matter. In addition to dissolved oxygen, BOD and COD, nitrate (NO 3 ) appears in the oxygen mass balance. This is necessary because the N associated with nitrate uptake is not taken into the autotrophs but rather released into the water column or porewater. Other entities that contain oxygen in the ocean include the water molecule (H 2 O) and the phosphorus ion (PO 4 ). In the case of water, this oxygen reservoir is considered very large, with the small flux associated with its change balanced by BOD. In the case of PO 4 , this is a small reservoir. As oxygen remains bound to P through the entire processes of uptake into reserves and incorporated into structural material and then release, it is not necessary to include it in the oxygen balance for the purposes of ensuring consistency. Nonetheless, strictly the water column and porewater oxygen reservoirs could include a term plus 64 31 [PO 4 ], and the BOD would have similar quantities for reserves and structural material.

Mass conservation in the epibenthic
Mass conservation in the epibenthos requires consideration of fluxes between the water column, porewaters and the epibenthic organisms (macroalgae, seagrass and coral hosts and symbionts). The total carbon in the epibenthos, and its conservation, is given by where h wc and h sed are the thickness of the bottom water column and top sediment layers, R * C is the normalised internal reserves of carbon in zooxanthellae, 12 g is the rate coral calcification per unit area of coral, A eff is the area of the bottom covered by coral per m 2 , and the diffusion terms between porewaters and the water column cancel, so they do not appear in the equations. Note the units of mass of CS needs to be in g N, and some configurations may have multiple seagrass and macroalgae species.
Similarly, for nitrogen, phosphorus and oxygen in the epibenthos, where there is no dissolved oxygen in the epibenthos.

Unconditional stability
In addition to the above standard numerical techniques, a number of innovations are used to ensure model solutions are reached. Should an integration step fail in a grid cell, no increment of the state variables occurs, and the model continues with a warning flag registered (as Ecology Error). Generally, the problem does not reoccur due to the transport of tracers alleviating the stiff point in phase space of the model. Furthermore, when a water column becomes dry (the sea level drops below the seabed depth), ecological processes are turned off.

Model evaluation
The EMS BGC model has been deployed in a range of environments around Australia. With each deployment, a skill assessment has been undertaken (for a history of these applications, see Sect. 13). Recently, the EMS BGC model has been thoroughly assessed against remotely sensed and in situ observations on the GBR as part of the eReefs project (Schiller et al., 2014;Steven et al., 2019b). The assessment of version B1p0 of the eReefs marine model configuration of the EMS included a range of model configurations (4 km, 1 km and relocatable fine-resolution versions) . The optical and carbon chemistry outputs were assessed in Baird et al. (2016b) and Mongin et al. (2016b), respectively. A more recent assessment of the BGC model (vB2p0) in the GBR compared simulations against a range of in situ observations that included 24 water quality moorings, two nutrient sampling programmes (with a total of 18 stations) and time series of taxon-specific plankton abundance. In addition to providing a range of skill metrics, the assessment included analysis of seasonal plankton dynamics (Skerratt et al., 2019).
In this section, we assess version B3p0 in the 4 km GBR configuration. First, we consider the behaviour of the microalgae physiology as a means to understanding the dynamics of the microalgal growth model. Secondly, the techniques and observations used in Skerratt et al. (2019) have been applied to the model version described in this paper (vB3p0) with highlights discussed here and the full analysis appearing in the Supplement.

Analysis of microalgae growth and pigment synthesis dynamics
The microalgae growth model (Sect. 5.1.1) was derived from first quantifying the fluxes into a cell of energy (for fixing carbon), N, P and O. Each flux adds to the reserves of that element in the cell. A second process, the consumption of reserves to create microalgae structural material with a constant stoichiometry (C : N : P = 106 : 16 : 1), increases the number of cells but reduces the reserves of each element both per cell and of the population. Thus, the microalgae in the growth model are generating organic matter at the Redfield ratio while being exposed to external nutrient fields at non-Redfield ratios. At the same time as the microalgae grow, the model represents the synthesis of chlorophyll based on the cell's need for more carbon fixation and the benefit of adding pigment on the rate of photon absorption (Fig. 11).
To illustrate these dynamics, we look at a vertical profile of a deep site in the Coral Sea with a 1 and 2.5 µm radius microalgae (Fig. 13). The expectation is that, for the same environmental conditions, the 1 µm cell will be less nutrient limited and more light limited than the 2.5 µm cell -a result of the 1 µm cell having a greater diffusion rate per unit volume than the larger cell. Further, that near-surface cells will be more nutrient limited, deeper cells more light limited. Finally, light-limited cells will generally have more pigment per cell.
In addition to being a measure of the quantity of nutrient reserves, normalised reserves (R * ) of each nutrient is a metric of how limiting that nutrient is, with 1 being unlimited, and 0 being completely limited. At the surface at midday, the 1 µm cells have a biomass of 0.2 mg m −3 (Fig. 13b). The cells are strongly phosphorus limited (R * P = 0.22), slightly nitrogen limited (R * N = 0.86) and almost light unlimited (R * C = 0.99). The realised growth rate, as a fraction of the maximum growth rate, is R * C R * N R * P = 0.19. The larger cells are more nutrient limited (R * P = 0.14, R * N = 0.54), and again light unlimited (R * C = 0.98), realising a normalised growth rate of 0.07 (Fig. 13c).
The elemental ratios of the microalgae can be calculated from the reserves (in wt wt −1 : C : N = (12/14)(106/16)(1 + R * C )/(1 + R * N ); C : P = (12/31)(106/1)(1 + R * C )/(1 + R * N )). The C : N and C : P ratios are both higher in the nutrientreplete surface waters, with C : P varying more due to greater P limitation in the surface waters. A deep chlorophyll maximum has formed for the 1 µm microalgae at 40 m and for 2.5 µm microalgae at 60 m. Here, we will explain this distribution based on microalgae growth alone (ignoring grazing and sinking terms). The 1 µm microalgae has a growth maximum at 40 m, as nutrients have become non-limiting and fixed carbon reserves are still relatively high (R * C = 0.8). Growth below 50 m becomes primarily light limited, so normalised growth is equal to normalised fixed carbon reserves. The 2.5 µm microalgae are nutrient limited deeper into the water column, resulting in a deep growth maximum.
The 1 and 2.5 µm cells have a slight biomass maximum at 40 and 50 m, respectively, but the chlorophyll maximum is more pronounced (Fig. 13b, c). At the surface, the 1 µm microalgae have low pigment content and are therefore relatively transparent (opaqueness, or the absorption crosssection divided by the projected area, α/(π r 2 ), is 0.11), with a C : Chl ratio of 100 [g g −1 ]. At the deep chlorophyll maxima for 1 µm cells, the pigment content has increased, as shown by the C : Chl dropping to 20 [g g −1 ], the minimum C : Chl ratio observed in the ocean (Sathyendranath et al., 2009), resulting in an opaqueness of 0.25. The 2.5 µm cells are less light limited than the smaller cells. At the surface, chlorophyll synthesis generates in 2.5 µm cells an opaqueness of 0.52. Given the larger size of the cell, this is achieved at a C : Chl ratio of 150. At the 50 m deep chlorophyll maxima, the C : Chl dropped to 20, but in the larger cells this achieves an opaqueness of 0.91 (i.e. the absorption crosssection is almost equal to the projected area).
In summary, the application of simple physical limits to uptake, a restraint of constant stoichiometric conversion to structural material, and cells synthesising chlorophyll to maximise photon absorption when light limited, generates the typical physiological properties of microalgae seen in vertical profiles in the ocean.

Model assessment of the GBR configuration
A detailed comparison of a GBR simulation against observations of Chl a concentration, dissolved inorganic carbon, nitrogen, phosphorus and ammonium, dissolved organic nitrogen and phosphorus, alkalinity, pH, aragonite saturation, mass of suspended sediments, turbidity and Secchi depth appears in the Supplement. Here, we highlight the carbon chemistry, nutrient and plankton components that are driven by the BGC model.

Chlorophyll dynamics
The most accurate measurements of water column chlorophyll concentrations in the GBR are obtained using highperformance liquid chromatography (HPLC) and chlorophyll extractions from water column samples. Chlorophyll extractions have been taken at 36 locations along the GBR (S5, Sect. 10; for site locations, see S5, Sect. E1). As an example, a time series at Pelorus Island in the central GBR (Fig. 14) shows large variability in both the observations and the simulations, driven by interannual climatic forcing, with 2011-2013 experiencing much greater river loads than 2014-2016, intra-annual trends driven by greater loads of nutrients during the wet season (January-June) than the remainder of the year, as well as monthly variability related to tidal movements and predator-prey oscillations. Even given this variability, comparison of the instantaneous state of the simulations against extracted chlorophyll concentrations showed the model was able to achieve across all 36 sites a bias ± root mean square error (RMSE) of −0.11 ± 0.32 mg m −3 (Fig. 15).
Moored fluorometers are generally less accurate than chlorophyll extractions but provide a greater temporal resolution of chlorophyll dynamics. Here, we show observations from a mooring at Palm Passage (Fig. 16), away from the influence of the river discharge and dependent primary on shelf break interactions. The observed time series from 60 m depth show interannual variability in fluorescence related to primarily to an October-March maximum in intrusion events (for details of deployment details and oceanographic processes, see Benthuysen et al., 2016), which are also seen in the vB3p0 simulations. Comparison to other moored fluorometers on the GBR (S5, Sects. 19 and 21) shows a range of predictive skill.

Nutrient dynamics
The model represents dissolved nitrate, ammonium and phosphorus nutrients. In the surface waters of the inshore Figure 13. Vertical profiles of physiochemical variables (a) and physiological variables from 1 µm (b, d) and 2.5 µm (c, e) radii microalgae. Panel (a) shows photosynthetically available radiation (PAR; mol m −2 s −1 ), dissolved inorganic phosphorus (DIP; mg P m −3 ), dissolved inorganic nitrogen (DIN; mg N m −3 ), vertical diffusivity (K z ; m 3 s −1 ) and temperature ( • C). Panels (b) (1 µm) and (c) (2.5 µm) show biomass of structural material in nitrogen (B N ; mg N m −3 ), chlorophyll a concentration (Chl; mg Chl a m −3 ), normalised reserves of fixed carbon (R * C ), nitrogen (R * N ) and phosphorus (R * P ), cell opaqueness (absorption cross-section divided by projected area, α/(πr 2 )) and normalised growth rate of R * C R * N R * P . Panels (d) (1 µm) and (e) (2.5 µm) show stoichiometric ratios of carbon to nitrogen (C : N), phosphorus (C : P) and chlorophyll (C : Chl a). PAR, K z , temperature and B N are all scaled for plotting. GBR, nutrients are generally at very low concentrations, with modest increases seen each wet season. At High Island in the central GBR (Fig. 17), DIP has a mean concentration of 2 mg m −3 , with concentrations varying between 0 and 5 mg m −3 . The concentrations of nitrate and ammonium are both very low, with occasional peaks driven by river plume exposure. The simulated nutrients generally follow the expected time-varying patterns: peaks in the wet season, larger peaks in the wettest years (2011,2012,2013,2018) and extremely low concentrations in the dry seasons. Across all sites (S5, Sect. 13), vB3p0 predicted DIP with a skill of (bias ± RMSE) of −0.88±2.17 mg P m −3 , nitrate of −0.70± 3.86 mg N m −3 and ammonium of −0.77 ± 1.63 mg N m −3 .

Carbon chemistry
The model contains two state variables to represent the state of carbon chemistry, dissolved inorganic carbon and alkalinity, from which, at equilibrium and known temperature and salinity, other variables such as pH may be calculated. The biogeochemical model provides highly skilful predictions of pH and aragonite saturation (Fig. 18). This success is primarily due to the skill of the hydrodynamic model. The circulation produces a good representation of the alkalinity field, and the sea surface temperature sets an accurate difference in the partial pressure of CO 2 between the atmosphere and ocean. With these phenomena accurately calculated, the model needs only to correctly predict the timeaveraged wind-speed-dependent air-sea flux. Further assessment of carbon chemistry properties along the entire length  (Willmott et al., 1985), mean absolute percent error (MAPE) and RMSE. of the GBR (S5; Sect. 28) shows a bias ± RMSE of DIC of −7.7 ± 34.2 mmol m −3 . Further skill assessment from inshore sites is available in Mongin et al. (2016b).

Relocatable Coast and Ocean Model (RECOM)
A web-based interface, RECOM, has been developed to automate the process of downscaling the EMS model using an existing hindcast as boundary conditions (https: //research.csiro.au/ereefs/models/models-about/recom/, last access: 22 September 2020, including the RECOM User Manual). For the purposes of learning how to apply the EMS software available, RECOM provides the user with the ability to generate a complete test case of a domain situated along the northeast Australian coastline. Once a RECOM simulation has been generated using the web interface, the entire simulation including source code, forcing and initial condition files, model configuration files and the model output can be downloaded. This allows the user to repeat the model simulation on their own computing system and modify code, forcing and output frequency as required. The technical details of RECOM are detailed in Baird et al. (2018) and in the RECOM user manual.

Discussion
The EMS BGC model development has been a function of the historical applications of the model across a rage of ecosystems, so it is worth giving a brief history of the model development.

History of the development of the EMS biogeochemical model
The EMS biogeochemical model was first developed as a nitrogen-based model for determining the assimilative capacity for sewerage discharged into Port Philip Bay, the embayment of the city of Melbourne (Harris et al., 1996). This study saw a focus on sediment processes such as denitrification and demonstrated the ability of bay-wide denitrification to prevent change in the ecological state of the bay exposed to sewerage treatment plant loads (Murray and Parslow, 1997;Murray and Parlsow, 1999). The basic structure of the model and in particular the split of pelagic, epibenthic and sediment zones were in place for this project. This zonation generated the ability to resolve processes in shallow-water systems and in particular to consider benthic flora in detail. The next major study involved simulating a range of estuarine morphologies (salt wedge, tidal, lagoon, residence times) and forcings (river flow seasonality, nutrient inputs, etc.) that were representative of Australia's 1000+ estuaries . At this point, carbon and phosphorus were included in the model, and the process of including physical limits to ecological processes begun (e.g. diffusion limitation of nutrient uptake and encounter-rate limitation of grazing).
Following studies in the phosphorus-limited Gippsland Lakes and macro-tidal Ord River system led to the refinement of the phosphorus absorption-desorption processes. Further studies of the biogeochemical-sediment interactions in the subtropical Fitzroy River (Robson et al., 2006) and investigation of the impacts of a tropical cyclone (Condie et al., 2009), saw a stronger link to remote observations. At this time, the use of offline transport schemes were also implemented (such as the Moreton Bay model), allowing for an order-of-magnitude faster model integration .
The next major change in the BGC model involved implementing variable C : N : P ratios of microalgae through the introduction of reserves of energy, nitrogen and phosphorus (Wild-Allen et al., 2010), allowing for more accurate prediction of the elemental budgets and impacts of natural and anthropogenic forcing of the Derwent River estuary, southeast Tasmania. This study was followed up by a number of studies developing scenarios to inform management strategies of the region (Wild-Allen et al., 2011, 2013Skerratt et al., 2013;Hadley et al., 2015a, b).
From 2010 onwards, EMS has been applied to consider the impacts of catchment loads on the Great Barrier Reef. The focus on water clarity led to the development of a spectrally resolved optical model and the introduction of simulated true colour . The eReefs project was the first EMS application to consider corals with the introduction of the host-symbiont coral system and equilibrium carbon chemistry (Mongin and Baird, 2014;Mongin et al., 2016b, a). Additionally, the calculation of model outputs that match  remote-sensing observations allowed the model to be run in a data-assimilating system, where the observation-model mismatch was based on remote-sensing reflectance .
The most recent application of the EMS BGC model has been for investigating the environmental impact of aquaculture in Los Lagos, Chile (Steven et al., 2019a). For the Los Lagos application, new processes for fish farms, dinoflagellates and benthic filter feeders were added, although these additions are not described in this document. As a demonstration of the ability to add and remove processes, the Los Lagos application was run with the same EMS C-executable file as the Great Barrier Reef application, just with the configuration files altered.

Comparison with other marine biogeochemical models
As introduced earlier, there are a number of complex marine biogeochemical models. The most similar model in scope and approach to EMS is the ERSEM (European Regional Seas Ecosystem Model) model (Butenschön et al., 2016). Both ERSEM and EMS consider in detail pelagic, benthic and sediment processes and could generally be described as functional group models. That is, the state variables and the processes that link them are chosen to represent groups of organisms that act in similar ways. This allows the complex-  ity of real systems to be reduced to a tractable model. Many functional group style biogeochemical models exist and were in fact the earliest models developed (Riley, 1947;Fasham, 1993;Sarmiento et al., 1993). The most significant differences between EMS and ERSEM are (1) EMS concentrates more on benthic flora than ERSEM, while ERSEM considers lower-trophic-level ecosystem interactions such as fisheries that are not captured in EMS; and (2) while EMS and ERSEM have similar state variables and processes, EMS has a different set of governing equations that are based on geometric constraints of individuals while ERSEM, like most other functional biogeochemical models, has equations based on empirical relationships determined from population interactions.
The last two decades have seen addition modelling approaches emerge: trait-based models that consider changing processes rates as populations vary (Bruggeman and Kooijman, 2007); size-based models that determine rates based on organism size (Baird et al., 2007a); ecosystem-style models that consider a multiple "species" within a functional group, developing large food webs (Fulton et al., 2014); and models that consider a large number of functional groups that are refined through competition between groups (Follows et al., 2007). These new approaches are applied primarily in pelagic ecosystems, where the generic nature of pelagic interactions encourages overarching philosophies to model construction and with considerable success (Dutkiewicz et al., 2015). The awkwardness of the variety of benthic communities (corals, seagrass, kelp, etc.) and their prime role in shallow water, has meant that estuarine and coastal models have, like ERSEM and EMS, typically chosen the functional model approach (Madden and Kemp, 1996;Spillman et al., 2007).

Future developments in EMS
EMS has been developed to address specific scientific questions in Australia's coastal environment. As a result, the set of processes the EMS considers varies from those typically applied by other groups developing marine BGC models. Processes which have not been considered but often are considered in marine BGC models, include iron and silicate limitation (which are not common on the Australian continental shelf or estuaries), photo-inhibition of microalgae, explicit bacterial biomass. Each of these will be considered as the need arises.
A deliberate decision in the development of the EMS BGC model was made to avoid higher-trophic-level processes, such fish dynamics and reproduction of long-lived species. This decision was made because (1) including these longer timescale, often highly non-linear, processes reduces the ability of development to concentrate on BGC processes; and (2) it was recognised that CSIRO has developed a widely used ecosystem model (Atlantis, https://research.csiro.au/ atlantis/, last access: 22 September 2020; Fulton et al., 2014), and that coupling the EMS with Atlantis takes advantage of complementary strengths of the two modelling systems.
A recent capacity introduced to EMS is the development of a relocatable capability (RECOM; Sect. 12), allowing model configurations (grid, river and meteorological forcing, ecological processes, boundary conditions) to be automatically generated. This capability will be a good test of the portability of the BGC model and in particular the use of geometric description of physical limits to ecological processes.
Future enhancements in the EMS BGC model for tropical systems are likely to continue to pursue those components at risk from human impacts, such as dissolution of marine carbonates affecting sediment substrate and herbicide interactions with photosystems. We also expect to continue to refine the optical model and in particular the relationship between particle size distribution and mass-specific scattering and absorption properties. In temperate systems, current and near-future deployments of EMS in Australia will be focused on coastal system characterisation for aquaculture, carbon sequestration and management decision support for the blue economy. Ongoing research includes improved methods for model validation against observations and translation of model outputs into knowledge that informs stakeholder decisions.

Concluding thoughts
The BGC model in the CSIRO EMS has developed unique parameterisation when compared to other marine biogeochemical models applied elsewhere due in part to a unique set of scientific challenges of the Australian coastline. It has proved to be useful in many applications, most notably the Great Barrier Reef where extensive observational datasets has allowed new process model development and detailed model skill assessment Mongin et al., 2016b;Skerratt et al., 2019 andhttp://ereefs.info/, last access: 22 September 2020). This document provides easy access to some of the novel process formulations that have been important in this success, as well as a complete scientific description of version B3p0.
The web page links to an extensive user guide for the entire EMS package, which contains any information that is generic across the hydrodynamic, sediment, transport and ecological models, such as input/output formats. A smaller biogeochemical user guide documents details relevant only to the biogeochemical and optical models (such as how to specify wavelengths for the optical model), and a biogeochemical developer's guide describes how to add additional processes to the code.
A permanent link to the EMS C code used in this paper is (CSIRO, 2019) https://doi.org/10.25919/5e701c5c2d9c9.
The code available is also available on GitHub at https://github. com/csiro-coasts/EMS/ (CSIRO, 2020a), which continues to be de-veloped. The version is labelled as vB3p0 to distinguish it from earlier versions of the ecological library used in the eReefs project and others. On the GitHub site, vB3p0 is referred to as ecology v1.1.1, is contained within EMS release v1.1 in the GitHub archive and can be accessed at https://github.com/csiro-coasts/EMS/releases/tag/v1. 1.1 (CSIRO, 2020b).
The list of processes that this paper describes is given in a configuration file in the Supplement (S1). The library contains other processes that have been retained for backward comparability or for other applications (i.e. mussel farms). The methods by which differential equations described in this scientific description are incorporated into the model code are described in the Supplement (S2).
Author contributions. All authors contributed to the CSIRO EMS BGC model through either proposing model formulations, writing significant components of the code or applying the model. The primary model developers were MEB, KWA, JP, MM, BR and FR. MEB wrote the manuscript with co-authors contributing analyses, figures and revisions. JS and MEB prepared the article Supplements.
Competing interests. The authors declare that they have no conflict of interest.