Object-Based Modeling of Marine Phytoplankton and Seaweeds

: The aim of this work is to simulate the dissolved oxygen deﬁciency in the coastal zone that sometimes occurs during the summer water stagnation. We consider the main components of the marine ecosystem that play a major role in such processes—concentrations of nitrogen, phosphorus and sulfur compounds in water, dissolved and particular organic matter, oxygen, biomass of phytoplankton and macroalgae. We use the object-based modeling technique to simulate the spatio-temporal variability of the ecosystem in a 2D domain. In comparison with the traditional approach, it gives several advantages: more precise parametrizations of the biological components’ functionality; higher spatial resolution; possibility to account for the individual variability of hydrobionts; easy inclusion of an arbitrary number of species in the model. Our model included three species of phytoplankton and seven macroalgae. Individual-based modules control their functionality. Species of phytoplankton and seaweeds chosen for simulations are typical for the coastal zone of Crimea. In the simulations, we study the contribution of micro- and macroalgae to the processes of self-puriﬁcation of a semi-enclosed basin in case of a sharp increase in nutrient concentration in water.


Introduction
Coastal marine ecosystems are often exposed to oxygen deficiency, especially in summer under conditions of the stable water column stratification. The reason for this is the imbalance between the sources and sinks of dissolved oxygen (DO). The sources of DO in coastal waters are macro and microalgae production, inflow at the air-sea border, horizontal and vertical exchange with the waters rich in DO. The sinks are respiration, costs on decomposing of organic matter in water and sediments, and oxidation of reduced forms of nitrogen and sulfur. Since the 1960s, hypoxia has become an increasingly acute environmental problem. The number of regions with "dead zones" grew exponentially, doubling about once every 10 years. Now, such zones are noted in 400 coastal ecosystems, and their area exceeds 245 thousand square kilometers [1]. The worst situation is observed in continental seas with limited water exchange with the ocean. These include, for example, large sections of the Baltic Sea [2], the Kattegat Strait, the Black Sea [3,4], the Gulf of Mexico [5,6], river estuaries of the East China Sea [7] and South China Sea [8].
High nutrients loads (eutrophication) lead to large production of microalgae organic matter, and as a result, great demand of DO for its decomposition. However, not all areas receiving high amount of nutrients experience oxygen deficiency. Hydrophysical processes can also induce hypoxia in coastal waters. The formation of low DO areas in the bottom layer is a complicated process caused by a number of physical and biochemical factors. Ecological modeling is a good tool for studying the various processes leading to hypoxia separately and highlighting the main ones. A comprehensive review of modeling approaches to investigation of eutrophication in marine coastal areas has been recently In [16], Ulva lactuca and Gracilaria tikvahiae modules were developed and included into the ecosystem model of a shallow estuary as a part. They predict the biomass dynamics in units of carbon, nitrogen, and phosphorus. Primary production, respiration, grazing, decay, and physical exchange are empirical functions estimated on the local observation data. Simulations showed a strong competition for nutrients between phytoplankton and macroalgae, greater than that for light.
In [17], seagrass and macroalgae modules were implemented in the European Regional Seas Ecosystem Model to simulate the seasonal and interannual trends in nutrient concentrations and macrophyte biomasses in a coastal lagoon. The one-dimensional equations for macroalgae biomass were based on a balance between uptake, release and structural costs of the nutrients. The sensitivity analysis of macroalgae and seagrass to PAR and nitrogen concentration demonstrated high dependence of seagrass on light intensity in comparison with greater influence of nutrients concentration on macroalgae dynamics.
Complex ecosystem models are required to simulate the dynamics of biological and hydrochemical components in coastal areas where bottom macroalgae contribute to primary production and compete with phytoplanktonic community for nutrients and light. The target of this article is to propose a new tool for implementation of macroalgae and phytoplankton components to the two-layer ecological model describing dynamics of dissolved gases, nitrogen, phosphorus, and sulfur compounds. The model can reproduce oxic and anoxic conditions in the bottom layer and transitions between them. Therefore, it can be applied to simulate hypoxia occurrence and reconstruction of the oxidizing conditions.

Materials and Methods
First, consider a brief introduction into the object-based modeling (OBM) technique used for the development of the proposed ecological model on the Matlab platform. OBM allows a modeler to group the specific characteristics (properties) of similar entities with the dynamic procedures describing their behavior (methods) into a single definition named class. All that is needed to calculate the future state of these entities is defined in this class. An object is an instance of a class. At the beginning of the program run, the objects are created within a modeling domain (2D or 3D) in accordance with their class definition. The properties of each object represent their state, and the changes of this state depend on the specific location of this object and corresponding environmental influences.
Classes can be organized in the hierarchical structure. Common data and functionality should be placed in a superclass (parent-class), which we then use to derive subclasses (child-class). The subclasses inherit the data and functionality of the superclass and can add some other properties or functions that are unique to their particular purposes. A subclass can have two or more parents inheriting their properties and methods. In our model, the subclass "Algae" has two parents: "Bio-object" defining the common properties and methods of all biological objects, and "Species" determining the species-specific parameters of the corresponding subclass. Physical interpretation of the object is a water column, the nearest living space of a group of identical plants or animals where all the processes of exchange with the environment occur. Therefore, properties of an object include its location, radius of the horizontal projection of a water column, its height, total mass, and biomass as well as individual characteristics of the identical entities inside it. The dynamic models for the micro and macroalgae subclasses describing their evolution in the changing environment are the methods of the appropriate subclasses. These are individual-based models (IBMs) [18,19]. In comparison with the grid representation of biological components in the spatial ecological models, this approach provides the following advantages: • IBMs using parametrizations based on laboratory experiments on defining the physiological functions of marine hydrobionts promises more precise simulation of the population dynamics than models based on grid representation of plankton fields.

•
Higher spatial resolution within the aggregation of any hydrobionts due to adjustable size of the objects.
• An opportunity to account for the individual variability of organisms and plants, which we parameterize in a set of empirical coefficients used in the IBMs. • Natural and easy inclusion of additional biological components (in particular, aquaculture objects) into a spatial ecological model. Figure 1 shows the block diagram of the proposed model and the general scheme of classes used for the description of the biological components (hydrobiological module HB). According to our conception, all biological components (discrete entities) are described as sets of objects distributed in the 2D spatial domain ( Figure A1), whereas continuous hydrophysical and hydrochemical variables are presented as fields on a regular grid. We consider organismal and population levels of the ecosystem biological components. The first one is described in the frame of the object properties. The second is a classical representation characterized by average biomass and abundance, taxonomic structure, spatial variability, etc. Variables at this level are calculated by averaging the objects' properties. Dynamics of the chemical compounds (nitrates, nitrites, ammonia, dissolved oxygen, dissolved organic matter (DOM) and particular organic matter (POM) in nitrogen units, hydrogen sulfide, thiosulfate, sulfur, sulfate, and phosphate) are described within the hydrochemistry module (HC). The two-layer integral hydrodynamics module (HD) of the ecological model controls current velocities and water temperature. The vertical structure of the calculated domain contains the upper mixed and bottom layers divided by a seasonal thermocline. During spring and summer warming, the upper layer is deepening and the structure becomes vertically homogeneous. In the periods of summer stagnation caused by low wind speed, a new mixed layer can appear. During low wind periods, mixing cannot reach the bottom layer and under certain conditions, oxygen deficiency can occur. The mathematical description of this process is included in the HC module. Oxygen gets inside through the exchange with the atmosphere and production of the autotrophs during the photosynthesis. The sinks of oxygen are oxidation costs, respiration of plants (in the dark), and an outflow to the atmosphere. conception, all biological components (discrete entities) are described as sets of objects distributed in the 2D spatial domain ( Figure A1), whereas continuous hydrophysical and hydrochemical variables are presented as fields on a regular grid. We consider organismal and population levels of the ecosystem biological components. The first one is described in the frame of the object properties. The second is a classical representation characterized by average biomass and abundance, taxonomic structure, spatial variability, etc. Variables at this level are calculated by averaging the objects' properties. Dynamics of the chemical compounds (nitrates, nitrites, ammonia, dissolved oxygen, dissolved organic matter (DOM) and particular organic matter (POM) in nitrogen units, hydrogen sulfide, thiosulfate, sulfur, sulfate, and phosphate) are described within the hydrochemistry module (HC). The two-layer integral hydrodynamics module (HD) of the ecological model controls current velocities and water temperature. The vertical structure of the calculated domain contains the upper mixed and bottom layers divided by a seasonal thermocline. During spring and summer warming, the upper layer is deepening and the structure becomes vertically homogeneous. In the periods of summer stagnation caused by low wind speed, a new mixed layer can appear. During low wind periods, mixing cannot reach the bottom layer and under certain conditions, oxygen deficiency can occur. The mathematical description of this process is included in the HC module. Oxygen gets inside through the exchange with the atmosphere and production of the autotrophs during the photosynthesis. The sinks of oxygen are oxidation costs, respiration of plants (in the dark), and an outflow to the atmosphere.
Hydrophysical state variables of the HD module provide external inputs to the HC and the HB module shown in Figure 1. Chemical and biological components of the ecosystem interact by the exchange of matter; therefore, corresponding state variables are connected through the special procedures in the HB module. We calculated available resources for a biological object in the proportion to the intersection area of a horizontal projection of an object and a grid cell. Concentrations of the chemical compounds change in the same proportion due to the uptake and release of these compounds by the macro and microalgae objects. The objects can overlap each other and form an aggregation. Therefore, they compete for light and nutrients. Light intensity for macroalgae objects located at the bottom depends on the biomass of the planktonic objects at the same location. At each time step, we resolve the objects at a random order. If an aggregation is so tight that there is deficit of resources for growth, the production rate of some objects can be zero or negative. The objects with the biomass below the threshold are eliminated from the system. Under better trophic conditions, the objects can bisect forming new ones that are included in the system. Hydrophysical state variables of the HD module provide external inputs to the HC and the HB module shown in Figure 1. Chemical and biological components of the ecosystem interact by the exchange of matter; therefore, corresponding state variables are connected through the special procedures in the HB module. We calculated available resources for a biological object in the proportion to the intersection area of a horizontal projection of an object and a grid cell. Concentrations of the chemical compounds change in the same proportion due to the uptake and release of these compounds by the macro and microalgae objects. The objects can overlap each other and form an aggregation. Therefore, they compete for light and nutrients. Light intensity for macroalgae objects located at the bottom depends on the biomass of the planktonic objects at the same location. At each time step, we resolve the objects at a random order. If an aggregation is so tight that there is deficit of resources for growth, the production rate of some objects can be zero or negative. The objects with the biomass below the threshold are eliminated from the system. Under better trophic conditions, the objects can bisect forming new ones that are included in the system.

Microalgae Objects
Properties of the microalgae object define its position in the calculated domain, size, biomass, species, number of cells, intracellular content of nutrients, and some other variables. Methods of the object determine how it can interact with other objects and the environment. The main method describes the process of growth, which is supplemented by the procedures for estimation of available resources, consumption and release of matter by the objects due to algae physiology. These three procedures are started at each time step for each object during the model integration.
For the microalgae object, we use a model describing the phytoplankton growth as a balance between the incoming energy and structure maintenance costs [19]. The specific growth rate and nutrient uptake rates are functions of the intracellular content of nitrogen and phosphorus: Variables of this system of equations are listed in Table A1. The mortality rate is estimated as to provide a fit to actual data on phytoplankton abundance in the simulated region.
In case hydrogen sulfide appears in the water, the mortality rate increases: In this submodule, we use ecological archive presented in [20] to evaluate their values for three phytoplanktonic species typical and predominant in the Sevastopol bay: Sceletonema, costatum (Bacillariophyta), Gymnodinium catenatum (Dinoflagellata) иEmiliania huxleyi (Coccolithophyceae). These parameters are presented in Table A2.
Light and dissolved inorganic compounds of carbon, nitrogen and phosphorus are resources for growth. We do not use any parameterization of photoinhibition bearing in mind that microalgae cells can use all the space within the water column and focus at the level where light intensity is comfortable for growth. Self-shading was parameterized by the coefficient in Equation (2): where D ph is the average phytoplankton biomass in the nearest surroundings of the object (on the population level); D th is the threshold value of the biomass indicated the beginning of the self-shading process.

Macroalgae Objects
Bottom seaweeds community is described as a set of modeling objects at the lower boundary of the calculated domain. Each object has a cylinder shape with a height of up to 2 m and simulates the nearest living space of a group of identical plants. Objects of this class perform the array "Phytobenthos" (Figure 1). The main method of this class is the model describing physiology of the macrophytes [18]. The dynamical equations are similar to Equations (1)-(9) with the only difference in the description of the specific growth rate. We can simulate the photosynthesis of the macroalgae in more detail due to better scientific knowledge, understanding, and parameterization of these components of the ecosystem. Therefore, we use the following formulas for modeling the photosynthesis rate P m , and the specific growth rate of the macroalgae µ m : Variables of these equations are listed in Table A3. We use an average empirical ratio between chlorophyll concentration and dry weight of phytoplankton biomass following the study [21]. The light attenuation coefficient describing the influence of phytoplankton growth on the light intensity at the bottom layer is given as a function of chlorophyll concentration according to [22]. Self-shading (coefficient C w in Equation (14)) is parameterized by analogy with Equation (10).
To simulate the production processes in the bottom phytocenosis in the coastal zone of the Crimea, we chose seven macroalgae species typical for the rocky substrate: Cystoseira barbata, Ulva lactuca, Ceramium tenuicorne, Cladophora glomerata, Polysiphonia nigrescens, Phyllophora truncata, Enteromorpha prolifera. The model for this macroalgae community was studied and verified on annual data in [23] for a one-dimensional case. Table A4 shows the photosynthetic and kinetic parameters used in our study. The extremum nutrients contents in tissue were set equal for all macroalgae: Q min P = 28 µmol P/g DW; Q min N = 850 µmol N/g DW; Q max P = 80 µmol P/g DW; Q max N = 2570 µmol N/g DW. Macroalgae objects interact with the environment in the same manner as the phytoplankton objects. Concentrations of nitrogen and phosphorus compounds (both inorganic and organic) and oxygen changed under the influence of uptake and release of matter by the macrophytes. Objects containing algae of different species can exist in the same place or intersect each other simulating coexistence of the epiphytes and host plants and their competition for nutrients.

Hydrochemistry Module
Dynamics of water chemistry were described by the model for nitrogen and sulfur cycles in the Black Sea [24]. Despite the fact that this model was initially developed for the redox zone of the Black Sea, it can be applied to the simulation of anoxic conditions that are possible in the eutrophic coastal waters during the summer stagnation. Even in a non-eutrophied system, restricted vertical mixing can lead to anoxia. High concentrations of nutrients can dramatically worsen the situation. The model is able to mathematically describe the transition of normal oxic conditions to anoxic ones. It parameterizes the cycles of nitrogen and sulfur including the processes of ammonification, nitrification, nitrate reduction, denitrification, three stages of hydrogen sulfide oxidation, two stages of sulphate reduction, and thiodenitrification ( Figure 2). The concentration of phosphorus was added to the model using the Redfield ratio to simulate macro-and micro algae physiological processes more accurately (uptake, internal stocks, possible limitation of growth by nitrogen and phosphorus). Hydrochemical fields were represented as arrays of discrete values in the cells of a regular grid. Coupling with the hydrodynamic module was performed using a special procedure. The concentration of the chemical element in each grid cell was considered as a sum of changes caused by dynamical factors, chemical processes, and biologically induced changes: The vertical distribution of water temperature is determined by heat flux and wind stress at the surface in accordance with the simple integral model [25]. Two layers with a homogeneous vertical distribution of temperature and chemical compounds can exchange water volumes under certain influences at the air-sea boundary. General equations for the chemical components of the model include advective and diffusive terms, exchange between layers, chemically and biologically induced terms: Hydrochemical fields were represented as arrays of discrete values in the cells of a regular grid. Coupling with the hydrodynamic module was performed using a special procedure. The concentration of the chemical element in each grid cell was considered as a sum of changes caused by dynamical factors, chemical processes, and biologically induced changes: The vertical distribution of water temperature is determined by heat flux and wind stress at the surface in accordance with the simple integral model [25]. Two layers with a homogeneous vertical distribution of temperature and chemical compounds can exchange water volumes under certain influences at the air-sea boundary. General equations for the chemical components of the model include advective and diffusive terms, exchange between layers, chemically and biologically induced terms: where U and V are the averaged current velocities in the corresponding layers; indices u and b indicate the upper and bottom layers; X i are chemical components of the model; G i are the terms induced by chemical processes; and A i are the inputs and uptake by biological components. Q 0 and Q h are fluxes at the surface and intermediate boundaries.
A detailed description of the chemical model and numeric values of the model parameters can be found in [25]. Here, we show the equations for dissolved oxygen in the upper and bottom layers as an example (Equations (18) and (19)).
where ∆DO u hor is the horizontal advection and diffusion input; DO sat is the saturating oxygen concentration; β is the coefficient of air-sea gas exchange; T is the temperature; W is the wind speed above the sea; Q h is the flow between the two layers (when the upper layer is deepening ; h is the upper layer depth; P p B p is the oxygen production during photosynthesis of phytoplankton (P p = c 4 µ p ); p 1 Am is the oxygen expenses for oxidation of organic matter; p i Nf i are oxygen expenses for nitrification; p i Hs i are oxygen expenses for hydrogen sulfide oxidation; p i are stoichiometric coefficients. For DO in the bottom layer, the equation is: where if the upper boundary of the bottom layer rises (∆h < 0), and Q h = 0 if not; P m B m is the oxygen production during the macroalgae photosynthesis.
Particular organic matter sinks at a set fixed rate. Therefore, some part of it passes from the upper layer to the lower one, thereby increasing the likelihood of anoxia.

Exchange Procedure
Algae objects can interact with the environment provided by the chemistry module in two ways. They can estimate the average concentration of nutrients within the occupied space and change their uptake rate in accordance with this value and their own internal reserves (Equations (5)-(8)). Concentrations of inorganic nutrients change due to the uptake by autotrophs. The second way is the release of matter by the algae objects and corresponding alteration of dissolved and particulate organic matter and oxygen concentrations in grid cells.
Available inorganic resources R N i and R P i are calculated at each time step as the average concentration of nitrogen and phosphorus at the location of the object: where D j N and D j P are the concentrations of nitrates, ammonium and phosphates at a j grid cell, which is partially occupied by the i algae object; M is the number of grid cells partially occupied by an object; D N 0 and D P 0 are the threshold concentrations; S ij is the area of a grid cell overlap by an object in the horizontal projection; S i is the basal area of an object. R N i and R P i were used as inputs to the growth procedure of an object, and, at the output, according to Equations (1)-(9), we obtain the values of the actual uptake of nitrates and ammonium, released oxygen, dissolved and particular organic matter.
Output values should be transferred into the corresponding fields, and the exchange procedure does it in the following manner. The actual uptake of nonorganic nitrogen and phosphorus (µmol/m 3 ) is calculated as: where indices t + 1 and t indicate discrete time steps; N ex = dt·µkB is the exudation of dissolved organic matter during a time step, and N mort = dt·mB is the particular organic matter released due to decay. N ex enters the pool of DOM, and N mort -the POM pool. The rate of exudation k p in Equation (1) and k m in Equation (11) are defined by 15% for microalgae and 25% for macrophytes in the light and half this value in the dark [26,27]. The rate of the oxygen release due to photosynthesis is defined as P m (Equation (12)) for macroalgae and in proportion to the specific growth rate for microalgae (P p ). These additional negative or positive inputs are distributed between the grid cells occupied by an object in the same proportion as during the estimation of available resources in Equation (21).

Sensitivity Analysis
The sensitivity analysis of the submodules simulating phytoplankton and macroalgae dynamics was considered in the previously published papers [19,23]. In case of a sharp drop in the nutrients supply, the macroalgae community adapted to new conditions in approximately 20 days. Only two slowly growing species needed more time for adaptation. The new stable state was characterized by lower growth rates and higher uptake rates. The internal content of the nutrients also decreased, but relative change of this parameter varied from 2 to 4 when the external concentration dropped 10 fold.
It was found that the reaction of the system to a decrease in concentrations depends on the molar N/P ratio in water and their initial concentration [23]. With an initially high concentration of nutrients in water, the relative decrease in the specific growth rate was significantly less than with low initial concentrations. With a lower N/P ratio, the decrease in specific growth rates of most macroalgae was less, and the relative increase in the uptake rates was greater. We explained this phenomenon by the fact that phosphorus acted as a limiting element for algae growth with an increase in the N/P ratio.
The phytoplankton adapted to the step-wise changes of the nutrients supply much faster. A sharp increase in the nutrient uptake rates and flexible stoichiometry allow some taxonomic groups to keep almost the same growth rate during a 10-fold drop of the external concentrations. According to our estimates [19], insolation has a major effect on the phytoplankton dynamics. The specific growth rate can slightly increase and then decrease if insolation continues growing. The combined effect of irradiance and temperature rise leads to extremely fast growth of microalgae abundance and biomass. Due to the rapid adaptation of algae cells to changes in the nutrients supply, seasonal variability of phytoplankton abundance is mainly defined by seasonal changes of insolation and water temperature.

Results and Discussion
We have applied the model to study the case when the discharge of contaminated water sharply increases the nutrient concentration in the area with difficult water exchange. Usual nitrate concentration in the Sevastopol Bay varies from 0 to 4 µmol/L, and maximum values are observed in the surface layer of the South Bay (Figure 3). Extremum nitrate concentrations are caused by discharges of polluted water and can achieve 40-50 µmol/L at the upper layer of the South Bay. We have studied the process of self-purification of this basin by carrying out the simulations with the model including various modules. The initial conditions and the control variables were the same for each experiment. For the first simulation, we use only the main part of the ecological model-the hydrochemical module. In this experiment, the decomposition of organics and the oxidation of reduced forms could only occur due to the DO available in the system. In the second experiment, we added a set of phytoplankton objects controlled by the module of the phytoplankton growth. Finally, the third simulation was fulfilled with both phytoplankton and macroalgae sets of objects that provided additional inputs of DO. Then, we comprised and analyzed the obtained results to study the contribution of various components of the coastal ecosystem to the process of self-purification. To consider the case of limited water exchange in the top part of the South Bay, we excluded the advection terms from the left sides of Equations (16) and (17)

Dissolved Oxygen
We estimated the ecological state of the basin by DO concentration in water, the rate of water purification from excessive concentrations of nutrients, and the likelihood of anoxia. Figure 4 shows the DO concentrations together with the hydrological conditions in the upper and bottom layers in all three simulations. Such conditions, with low wind speed above a semi-enclosed bay, are typical for summer. In the first simulation without phytoplankton and macroalgae, DO in the lower layer was spent rather quickly and its content was reduced so much that traces of hydrogen sulfide appeared after 13 model days and its concentration in the lower layer increased over time ( Figure A2). In the second simulation with phytoplankton objects in the ecosystem, the trigger for hypoxia occurred almost at the same time. Photosynthesis of phytoplankton was accompanied not only by the oxygen production but also by DOM and POM release. Therefore, phytoplankton growth was unable to prevent contamination of the bottom layer with hydrogen sulfide.
Inclusion of the macroalgae objects fundamentally changed the situation in the bottom layer (Figure 4b). DO content was stable during the simulation, showing only slight diurnal fluctuations, and did not drop below 4 mL/L. The stable states of the phytoplankton and macroalgae biomass under given conditions were 220 mg DW/m 3 and 440 g DW/m 2 , the initial biomass was set as shown in Table A5. We chose low initial values for simulations to show that even with such biomass of bottom macroalgae, the case of sharp deterioration of the water quality could be recovered by selfpurification. At higher seaweeds biomass, the extraction of nitrogen and the saturation of the bottom layer with oxygen occurred more intensely. For example, at a macroalgae biomass of 500 g DW/m 2 the nitrate concentration in the lower layer (under the same initial conditions) decreased to 1 µ mol during 5 model days, and DO concentration in the bottom layer stayed near the saturation level. The hydrological conditions simulated summer stagnation with low wind and quasi-constant water temperature for one month. The time step was 0.125 day (3 h), and the space step was 50 m. The initial concentrations of the hydrochemical components are listed in Table A5.

Dissolved Oxygen
We estimated the ecological state of the basin by DO concentration in water, the rate of water purification from excessive concentrations of nutrients, and the likelihood of anoxia. Figure 4 shows the DO concentrations together with the hydrological conditions in the upper and bottom layers in all three simulations. Such conditions, with low wind speed above a semi-enclosed bay, are typical for summer.

Dissolved Oxygen
We estimated the ecological state of the basin by DO concentration in water, the rate of water purification from excessive concentrations of nutrients, and the likelihood of anoxia. Figure 4 shows the DO concentrations together with the hydrological conditions in the upper and bottom layers in all three simulations. Such conditions, with low wind speed above a semi-enclosed bay, are typical for summer. In the first simulation without phytoplankton and macroalgae, DO in the lower layer was spent rather quickly and its content was reduced so much that traces of hydrogen sulfide appeared after 13 model days and its concentration in the lower layer increased over time ( Figure A2). In the second simulation with phytoplankton objects in the ecosystem, the trigger for hypoxia occurred almost at the same time. Photosynthesis of phytoplankton was accompanied not only by the oxygen production but also by DOM and POM release. Therefore, phytoplankton growth was unable to prevent contamination of the bottom layer with hydrogen sulfide.
Inclusion of the macroalgae objects fundamentally changed the situation in the bottom layer (Figure 4b). DO content was stable during the simulation, showing only slight diurnal fluctuations, and did not drop below 4 mL/L. The stable states of the phytoplankton and macroalgae biomass under given conditions were 220 mg DW/m 3 and 440 g DW/m 2 , the initial biomass was set as shown in Table A5. We chose low initial values for simulations to show that even with such biomass of bottom macroalgae, the case of sharp deterioration of the water quality could be recovered by selfpurification. At higher seaweeds biomass, the extraction of nitrogen and the saturation of the bottom layer with oxygen occurred more intensely. For example, at a macroalgae biomass of 500 g DW/m 2 the nitrate concentration in the lower layer (under the same initial conditions) decreased to 1 µ mol during 5 model days, and DO concentration in the bottom layer stayed near the saturation level. In the first simulation without phytoplankton and macroalgae, DO in the lower layer was spent rather quickly and its content was reduced so much that traces of hydrogen sulfide appeared after 13 model days and its concentration in the lower layer increased over time ( Figure A2). In the second simulation with phytoplankton objects in the ecosystem, the trigger for hypoxia occurred almost at the same time. Photosynthesis of phytoplankton was accompanied not only by the oxygen production but also by DOM and POM release. Therefore, phytoplankton growth was unable to prevent contamination of the bottom layer with hydrogen sulfide.
Inclusion of the macroalgae objects fundamentally changed the situation in the bottom layer (Figure 4b). DO content was stable during the simulation, showing only slight diurnal fluctuations, and did not drop below 4 mL/L. The stable states of the phytoplankton and macroalgae biomass under given conditions were 220 mg DW/m 3 and 440 g DW/m 2 , the initial biomass was set as shown in Table A5. We chose low initial values for simulations to show that even with such biomass of bottom macroalgae, the case of sharp deterioration of the water quality could be recovered by self-purification. At higher seaweeds biomass, the extraction of nitrogen and the saturation of the bottom layer with oxygen occurred more intensely. For example, at a macroalgae biomass of 500 g DW/m 2 the nitrate concentration in the lower layer (under the same initial conditions) decreased to 1 µmol during 5 model days, and DO concentration in the bottom layer stayed near the saturation level.

Nitrates
Consider nitrogen dynamics and compare graphs of nitrate concentration in these three simulations ( Figure 5). In the first experiment, nitrate concentration grew due to oxidation of ammonia and organic matter whose contents in water were rather high (Figures 6 and 7, Figure A3). Phytoplankton cells used nitrates and ammonia for growth; therefore, in the second experiment, we expected that the inorganic nitrogen would decrease. However, nitrate concentration in the lower layer was growing in the second experiment. This can be explained by input from the organic matter compound due to the ammonification process. This is confirmed by comparing the graphs in Figures 5-7 and Figures A2  and A3. DOM in the bottom layer was growing in this simulation mainly through the phytoplankton exudation ( Figure 6). Additional input of the organic matter was coming from the sinking POM and its partial decomposition and dissolution (Figure 7). In the third experiment, inorganic nitrogen in the bottom layer slightly decreased in comparison with the initial state. In the upper layer, average nitrate concentration decreased due to phytoplankton uptake and water exchange between layers.

Nitrates
Consider nitrogen dynamics and compare graphs of nitrate concentration in these three simulations ( Figure 5). In the first experiment, nitrate concentration grew due to oxidation of ammonia and organic matter whose contents in water were rather high (Figures 6 and 7, Figure A3). Phytoplankton cells used nitrates and ammonia for growth; therefore, in the second experiment, we expected that the inorganic nitrogen would decrease. However, nitrate concentration in the lower layer was growing in the second experiment. This can be explained by input from the organic matter compound due to the ammonification process. This is confirmed by comparing the graphs in Figures  5-7 and Figures A2 and A3. DOM in the bottom layer was growing in this simulation mainly through the phytoplankton exudation ( Figure 6). Additional input of the organic matter was coming from the sinking POM and its partial decomposition and dissolution (Figure 7). In the third experiment, inorganic nitrogen in the bottom layer slightly decreased in comparison with the initial state. In the upper layer, average nitrate concentration decreased due to phytoplankton uptake and water exchange between layers.

Dissolved Organic Matter
Graphs of the DOM dynamics differ from the nitrate ones. In the first simulation, organic matter was oxidizing without any additional sources. Therefore, its content in both layers decreased. In the second and third simulations, phytoplankton and seaweeds released DOM by the exudation process. The additional input of partially dissolving POM increased DOM concentration. This led to the additional oxygen demand. Maximum DOM concentration was observed in the third experiment at the bottom layer where the conditions were insufficient for its fast oxidation.

Nitrates
Consider nitrogen dynamics and compare graphs of nitrate concentration in these three simulations ( Figure 5). In the first experiment, nitrate concentration grew due to oxidation of ammonia and organic matter whose contents in water were rather high (Figures 6 and 7, Figure A3). Phytoplankton cells used nitrates and ammonia for growth; therefore, in the second experiment, we expected that the inorganic nitrogen would decrease. However, nitrate concentration in the lower layer was growing in the second experiment. This can be explained by input from the organic matter compound due to the ammonification process. This is confirmed by comparing the graphs in Figures  5-7 and Figures A2 and A3. DOM in the bottom layer was growing in this simulation mainly through the phytoplankton exudation ( Figure 6). Additional input of the organic matter was coming from the sinking POM and its partial decomposition and dissolution (Figure 7). In the third experiment, inorganic nitrogen in the bottom layer slightly decreased in comparison with the initial state. In the upper layer, average nitrate concentration decreased due to phytoplankton uptake and water exchange between layers.

Dissolved Organic Matter
Graphs of the DOM dynamics differ from the nitrate ones. In the first simulation, organic matter was oxidizing without any additional sources. Therefore, its content in both layers decreased. In the second and third simulations, phytoplankton and seaweeds released DOM by the exudation process. The additional input of partially dissolving POM increased DOM concentration. This led to the additional oxygen demand. Maximum DOM concentration was observed in the third experiment at the bottom layer where the conditions were insufficient for its fast oxidation.

Sources and Sinks of DO
It is of interest to analyze the integral sources and sinks of DO in these three experiments ( Figure  8). Averaging was performed over the entire period of the experiment (1 month). In the first simulation, sources of DO are air-sea flow and internal DO stocks (Figure 8a). The sinks of DO are costs on the organic matter oxidation and nitrification. DO expenses on hydrogen sulfide oxidation are very small, so we do not show them on the graphs. In the second experiment, an additional source of DO is provided by phytoplankton growth (Figure 8b), and in the third experiment by phytoplankton and macroalgae growth (Figure 8c). , and third (c) simulations: 1oxygen flow at the air-water border; 2-oxygen stock-out of the initial state of the system; 3-oxygen production by phytoplankton; 4-oxygen production of marine seaweeds. Sinks: 5-ammonification costs; 6-nitrification costs.
In the third experiment, the system state remains oxidizing and no hydrogen sulfide appears in the lower layer of the model basin ( Figure A2). However, oxygen demand for organic matter oxidation increases by 43% from 276 to 395 mL/(m 3 day) in comparison with the second simulation (Figure 8c). Additional organic matter is a product of seaweeds functioning (DOM release in the form of exudates and POM input due to decay).
Consider the rate of oxygen release by various types of autotrophs in a model ecosystem. Figure  9 shows the specific and total rates of DO release per day. According to the diagram, the specific oxygen production of microalgae is several times higher than that of macroalgae, which is connected with a higher rate of microalgae photosynthesis and, accordingly, its growth. In this experiment, the maximum specific growth rate of phytoplankton was set as 0.76 day −1 . The maximum rate of macroalgae did not exceed 0.11 day −1 .

Dissolved Organic Matter
Graphs of the DOM dynamics differ from the nitrate ones. In the first simulation, organic matter was oxidizing without any additional sources. Therefore, its content in both layers decreased. In the second and third simulations, phytoplankton and seaweeds released DOM by the exudation process. The additional input of partially dissolving POM increased DOM concentration. This led to the additional oxygen demand. Maximum DOM concentration was observed in the third experiment at the bottom layer where the conditions were insufficient for its fast oxidation.

Sources and Sinks of DO
It is of interest to analyze the integral sources and sinks of DO in these three experiments (Figure 8). Averaging was performed over the entire period of the experiment (1 month). In the first simulation, sources of DO are air-sea flow and internal DO stocks (Figure 8a). The sinks of DO are costs on the organic matter oxidation and nitrification. DO expenses on hydrogen sulfide oxidation are very small, so we do not show them on the graphs. In the second experiment, an additional source of DO is provided by phytoplankton growth (Figure 8b), and in the third experiment by phytoplankton and macroalgae growth (Figure 8c).

Sources and Sinks of DO
It is of interest to analyze the integral sources and sinks of DO in these three experiments ( Figure  8). Averaging was performed over the entire period of the experiment (1 month). In the first simulation, sources of DO are air-sea flow and internal DO stocks (Figure 8a). The sinks of DO are costs on the organic matter oxidation and nitrification. DO expenses on hydrogen sulfide oxidation are very small, so we do not show them on the graphs. In the second experiment, an additional source of DO is provided by phytoplankton growth (Figure 8b), and in the third experiment by phytoplankton and macroalgae growth (Figure 8c). , and third (c) simulations: 1oxygen flow at the air-water border; 2-oxygen stock-out of the initial state of the system; 3-oxygen production by phytoplankton; 4-oxygen production of marine seaweeds. Sinks: 5-ammonification costs; 6-nitrification costs.
In the third experiment, the system state remains oxidizing and no hydrogen sulfide appears in the lower layer of the model basin ( Figure A2). However, oxygen demand for organic matter oxidation increases by 43% from 276 to 395 mL/(m 3 day) in comparison with the second simulation (Figure 8c). Additional organic matter is a product of seaweeds functioning (DOM release in the form of exudates and POM input due to decay).
Consider the rate of oxygen release by various types of autotrophs in a model ecosystem. Figure  9 shows the specific and total rates of DO release per day. According to the diagram, the specific oxygen production of microalgae is several times higher than that of macroalgae, which is connected with a higher rate of microalgae photosynthesis and, accordingly, its growth. In this experiment, the maximum specific growth rate of phytoplankton was set as 0.76 day −1 . The maximum rate of macroalgae did not exceed 0.11 day −1 . In the third experiment, the system state remains oxidizing and no hydrogen sulfide appears in the lower layer of the model basin ( Figure A2). However, oxygen demand for organic matter oxidation increases by 43% from 276 to 395 mL/(m 3 day) in comparison with the second simulation (Figure 8c). Additional organic matter is a product of seaweeds functioning (DOM release in the form of exudates and POM input due to decay).
Consider the rate of oxygen release by various types of autotrophs in a model ecosystem. Figure 9 shows the specific and total rates of DO release per day. According to the diagram, the specific oxygen production of microalgae is several times higher than that of macroalgae, which is connected with a higher rate of microalgae photosynthesis and, accordingly, its growth. In this experiment, the maximum specific growth rate of phytoplankton was set as 0.76 day −1 . The maximum rate of macroalgae did not exceed 0.11 day −1 . Although phytoplankton has higher rates of DO production, it cannot be considered as the factor of self-purification of the ecosystem. Only if the primary production of phytoplankton is needed for the following trophic levels, the balance between the production and demand of DO can be positive. During microalgae blooms, DO demand for the oxidation of a huge amount of produced organic matter is bigger than DO production, especially since a big part of it flows to the atmosphere through the air-sea border.

Particular Organic Matter
We can draw the analogous diagrams (as in Figure 9a,b) for nitrogen and phosphorus uptake, release of DOM and POM by phytoplankton and macroalgae species. These low-level characteristics can help us to deepen our understanding of the processes on the population level. Consider the ratio of the specific rates of dissolved and particular organic matter release ( Figure 10). In our model, POM is considered as organic matter consisting of two parts: dead cells or tissues, and those consumed by the animals at the next trophic level. Mortality rates are the most uncertain parameters in the model. We estimated these coefficients based on the requirements of biomass stability and correspondence to the values observed in the region [23]. At the same time, DOM release rates are proportional to the growth rates and can be roughly estimated in the laboratory experiments. According to the diagram in Figure 10, POM release by phytoplankton is much higher in comparison with the macrophytes. These estimates may be overstated because this variant of the model does not include the next trophic levels-marine animals. Consumption of the part of the primary production prolongs the time of the organic matter decomposition, but, in a semi-enclosed basin, it cannot sufficiently influence the result. Therefore, primary production of phytoplankton is accompanied by much higher oxygen demand for the decomposition of organic matter in comparison with the macrophytes.
Compare now the diagrams in Figures 9b and 10. Green macrophytes (Ulva, Cladophora and Enteromorpha) make an increased contribution to DO supply. However, their POM/DOM ratios are Although phytoplankton has higher rates of DO production, it cannot be considered as the factor of self-purification of the ecosystem. Only if the primary production of phytoplankton is needed for the following trophic levels, the balance between the production and demand of DO can be positive. During microalgae blooms, DO demand for the oxidation of a huge amount of produced organic matter is bigger than DO production, especially since a big part of it flows to the atmosphere through the air-sea border.

Particular Organic Matter
We can draw the analogous diagrams (as in Figure 9a,b) for nitrogen and phosphorus uptake, release of DOM and POM by phytoplankton and macroalgae species. These low-level characteristics can help us to deepen our understanding of the processes on the population level. Consider the ratio of the specific rates of dissolved and particular organic matter release ( Figure 10). In our model, POM is considered as organic matter consisting of two parts: dead cells or tissues, and those consumed by the animals at the next trophic level. Mortality rates are the most uncertain parameters in the model. We estimated these coefficients based on the requirements of biomass stability and correspondence to the values observed in the region [23]. At the same time, DOM release rates are proportional to the growth rates and can be roughly estimated in the laboratory experiments. Although phytoplankton has higher rates of DO production, it cannot be considered as the factor of self-purification of the ecosystem. Only if the primary production of phytoplankton is needed for the following trophic levels, the balance between the production and demand of DO can be positive. During microalgae blooms, DO demand for the oxidation of a huge amount of produced organic matter is bigger than DO production, especially since a big part of it flows to the atmosphere through the air-sea border.

Particular Organic Matter
We can draw the analogous diagrams (as in Figure 9a,b) for nitrogen and phosphorus uptake, release of DOM and POM by phytoplankton and macroalgae species. These low-level characteristics can help us to deepen our understanding of the processes on the population level. Consider the ratio of the specific rates of dissolved and particular organic matter release ( Figure 10). In our model, POM is considered as organic matter consisting of two parts: dead cells or tissues, and those consumed by the animals at the next trophic level. Mortality rates are the most uncertain parameters in the model. We estimated these coefficients based on the requirements of biomass stability and correspondence to the values observed in the region [23]. At the same time, DOM release rates are proportional to the growth rates and can be roughly estimated in the laboratory experiments. According to the diagram in Figure 10, POM release by phytoplankton is much higher in comparison with the macrophytes. These estimates may be overstated because this variant of the model does not include the next trophic levels-marine animals. Consumption of the part of the primary production prolongs the time of the organic matter decomposition, but, in a semi-enclosed basin, it cannot sufficiently influence the result. Therefore, primary production of phytoplankton is accompanied by much higher oxygen demand for the decomposition of organic matter in comparison with the macrophytes.
Compare now the diagrams in Figures 9b and 10. Green macrophytes (Ulva, Cladophora and Enteromorpha) make an increased contribution to DO supply. However, their POM/DOM ratios are According to the diagram in Figure 10, POM release by phytoplankton is much higher in comparison with the macrophytes. These estimates may be overstated because this variant of the model does not include the next trophic levels-marine animals. Consumption of the part of the primary production prolongs the time of the organic matter decomposition, but, in a semi-enclosed basin, it cannot sufficiently influence the result. Therefore, primary production of phytoplankton is accompanied by much higher oxygen demand for the decomposition of organic matter in comparison with the macrophytes.
Compare now the diagrams in Figures 9b and 10. Green macrophytes (Ulva, Cladophora and Enteromorpha) make an increased contribution to DO supply. However, their POM/DOM ratios are also higher than for other macroalgae species. Cystoseira, the basis of the bottom macrophytes community, shows the best relationship between DO production and DO demand on the decomposition of produced organic matter. This is why, by our estimates, this seaweed plays the major role in self-purification of the basin in the situation of excessive nutrient input in the coastal waters.

Conclusions
The experiments have shown that the proposed model is an effective tool for studying and parameterizing the influence of phytoplankton, marine seaweeds, and (in future) aquaculture facilities on the concentration of organic matter and oxygen. An object-based approach allows one to analyze biochemical mechanisms of the autotrophs' physiology (nutrient uptake, growth, oxygen production, exudation, etc.) on both individual and population levels. Incorporation of the objects containing model plants with laboratory-estimated properties into a 3D ecological model simulating the marine environment is of great interest. Competition for nutrients and light between species and self-shading modify the rates of the main processes and can lead to unpredictable changes of the state variables of the ecosystem. The proposed modeling technique promotes a better understanding of internal ecosystem dynamics by identifying the causes of possible changes. Individual-based bottom-up modeling gives the possibility of tracking the variability of the internal state variables, such as the nutrients stored in phytoplankton cells and macroalgae tissues and the internal stoichiometric ratio of main elements.
In the test simulations discussed above, we study the reaction of different plant components of the ecosystem on sharp increase of inorganic nitrogen in water. We compare micro and macroalgae species with very different rates of the main physiological processes. Analyzing the results of experiments, we have shown why the phytoplankton community with much higher rates of oxygen production could not prevent hydrogen sulfide pollution in the conditions of low mixing and high nutrient concentration in water.
The proposed approach could explain and demonstrate the mechanism of the high internal plasticity of marine autotrophs, allowing them to continue growing even in severe trophic conditions. This approach is very convenient for expanding the model structure. Using its principles and rules, we can easily add new species and components to the model. This is also true for aquaculture facilities. Further development of the ecosystem model and embedding the next trophic level components can provide a new tool for studying the relationships between natural and artificial components of the marine coastal ecosystems including aquaculture.  Table A5. Initial values of the chemical and biological components of the model.

Component
Initial Value Figure A1. Spatially explicit layout of objects in the model domain. . Figure A3. Averaged ammonium concentration in the upper (a) and lower (b) layers in the experiments when: 1 (blue)-only chemical processes are taken into account; 2 (red)-chemical processes plus phytoplankton production; 3 (green)-the same with the addition of bottom seaweeds community.  . Figure A3. Averaged ammonium concentration in the upper (a) and lower (b) layers in the experiments when: 1 (blue)-only chemical processes are taken into account; 2 (red)-chemical processes plus phytoplankton production; 3 (green)-the same with the addition of bottom seaweeds community.  . Figure A3. Averaged ammonium concentration in the upper (a) and lower (b) layers in the experiments when: 1 (blue)-only chemical processes are taken into account; 2 (red)-chemical processes plus phytoplankton production; 3 (green)-the same with the addition of bottom seaweeds community.