Biodiversity is one of the key mechanisms that facilitate the adaptive response of planktonic communities to a fluctuating environment. How to allow for such a flexible response in marine ecosystem models is, however, not entirely clear. One particular way is to resolve the natural complexity of phytoplankton communities by explicitly incorporating a large number of species or plankton functional types. Alternatively, models of aggregate community properties focus on macroecological quantities such as total biomass, mean trait, and trait variance (or functional trait diversity), thus reducing the observed natural complexity to a few mathematical expressions. We developed the PhytoSFDM modelling tool, which can resolve species discretely and can capture aggregate community properties. The tool also provides a set of methods for treating diversity under realistic oceanographic settings. This model is coded in Python and is distributed as open-source software. PhytoSFDM is implemented in a zero-dimensional physical scheme and can be applied to any location of the global ocean. We show that aggregate community models reduce computational complexity while preserving relevant macroecological features of phytoplankton communities. Compared to species-explicit models, aggregate models are more manageable in terms of number of equations and have faster computational times. Further developments of this tool should address the caveats associated with the assumptions of aggregate community models and about implementations into spatially resolved physical settings (one-dimensional and three-dimensional). With PhytoSFDM we embrace the idea of promoting open-source software and encourage scientists to build on this modelling tool to further improve our understanding of the role that biodiversity plays in shaping marine ecosystems.

Numerical models are simplified abstractions of complex phenomena. They are
engineered for the problem at hand and cannot be designed to maximize
simultaneously the three key requirements of generality, precision, and
realism, because one of these must be sacrificed in favour of the other two

In the past 2 decades, trait-based models of planktonic ecosystems have
become important tools for elucidating the fundamental mechanisms behind
emergent patterns of community structure and diversity. Most of these models
describe the phytoplankton community by a

The simplification of both types of trait-based models (i.e. discrete and
aggregate) relies on the use of a key trait, for which relationships with
other traits can be formulated. Cell size is recognized as one of the most
important traits for characterizing phytoplankton communities

Here we present the new Phytoplankton Size and Functional Diversity Model (called PhytoSFDM) that allows for five different ways of describing the size composition of phytoplankton communities in the upper mixed layers of the world oceans. In the first variant, the phytoplankton community is described according to the classical approach that resolves the discrete assemblage of many different species and then we present four alternative ways of expressing aggregate community properties of phytoplankton based on four different ways of treating size diversity. We provide this model as open-source so that it can be used, modified, and redistributed freely with the aims of fostering reproducibility and encouraging investigations about the impact of environmental conditions on properties of phytoplankton community structure and diversity.

PhytoSFDM is developed from the study of

The zero-dimensional physical set-up consists of two vertical layers, the
upper mixed layer containing the pelagic ecosystem and the abiotic bottom
layer with nitrogen concentration as forcing. Following

Zooplankton are considered capable of maintaining themselves within the upper
mixed layer; thus, their mixing term simplifies to

The description of the phytoplankton community is a trait-based variant of
the classical nutrient–phytoplankton–zooplankton–detritus (NPZD) model

The current version of our model does not specify any size dependence for light absorption, although we provided suggestions on how this could be done (Sects. 4 and 6).

The nutrient-limiting term

The loss term

The loss term

Our model formulation does not specify an explicit size dependence for the
phytoplankton maximum growth rate (

Parameter definitions, their units, and their default values as provided in PhytoSFDM.

The loss term

Differential equations for the nutrient (N), zooplankton (Z), and
detritus (D) complete the model system:

The phytoplankton community comprising many distinct morphotypes
(Eqs.

Here the whole phytoplankton community is characterized by the morphological
trait cell size and by a trade-off that emerges from three allometric
relationships described by Eqs. (

Alternatively, one can use the approximated model to focus only on changes in
the mean trait, thus ignoring changes in the variance by fixing it to an
arbitrary constant value:

While using these two formulations (i.e. unsustained and fixed variance) can
be acceptable in some special cases (e.g. in experiments that lead to
competitive exclusion or where diversity is being manipulated), it is clear
that they fail to account for changes in the adaptive capacity of the
community, which requires allowing the size variance, and thereby functional
diversity, to vary over time

Within our modelling tool we also provide two alternative ways of treating
the size variance: immigration

The treatment of the size variance based on trait diffusion

The system of differential equations for all variance treatments is completed
by equations describing gains and losses in nitrogen (N), zooplankton
(Z), and detritus (D):

The first term in Eq. (

We compiled monthly climatological forcing data for mixed-layer depth (MLD),
photosynthetic active radiation (PAR), sea surface temperature (SST), and
concentration of nitrogen immediately below the upper mixed layer (

Environmental forcing variables considered in PhytoSFDM. The data
shown are the annual average of mixed-layer depth (MLD), photosynthetic
active radiation (PAR), sea surface temperature (SST), and nitrogen
concentration below the mixed layer (

A test-case model configuration is provided for a location of the North
Atlantic Ocean at 47.5

Within PhytoSFDM, we provide a practical example of how to implement and
compare phytoplankton community models that aim to describe (a) a full
assemblage of species or morphotypes (see Sect. 2.1.2), and (b) an aggregate
community (see Sect. 2.1.3). The aggregate community model is an
approximation of the full assemblage of species or morphotypes

Figures

Temporal variation of the environmental variables. The monthly
climatology data (red dots) are spatially averaged over the test location
(square boxes in Fig. 1). The interpolation (continuous line) is obtained
with a third- (MLD and PAR) and a fifth-order (SST and

Computation time in seconds for the full model with 10 and 100 morphotypes and the four variants of the aggregate model.

NPZD dynamics of the full model (Sect. 2.1.2) and of its equivalent
aggregate model (Unsustained variance, Sect. 2.1.3) for the last year of the
simulations. The total phytoplankton in the full model corresponds to the sum
of all P

Number of morphotypes and size variance over the first year of the
simulation. Here we included the morphotypes with a biomass greater than
0.01 mmol N m

Nutrient, phytoplankton, zooplankton, and detritus dynamics over a seasonal cycle for the four variants of the aggregate model (see Sect. 2.1.3), named unsustained and fixed variance, trait diffusion, and immigration.

The key aspect of trait-based models is their ability to describe the
phytoplankton community in terms of mean trait and trait variance.
Figures

As already discussed, the system loses diversity over time when variance is
unsustained. The loss of diversity reduces the capacity of the community to
adapt to changing environmental conditions via shifts in species composition,
as a flat year-round mean trait shows (Fig.

Dynamics of the size-structured phytoplankton community and its functional size diversity for the four variance treatments (see Sect. 2.1.3), named unsustained and fixed variance, trait diffusion, and immigration.

Sensitivity of four variance treatments to an increase and a decrease by 25 % in the default parameter values. The values and definitions of all parameters are given in Table 1.

Trait diffusion and immigration show similar results for the mean size but
not for the size variance (Fig.

We tested the sensitivity of the annual mean in P,

The four treatments of size variance respond similarly to changes in
parameter values (Fig.

Trait-based models that aim at resolving the complexity of natural
communities by incorporating many different species or functional types can
be expensive in terms of computational time

Components of the size variance (

Models are simplifications of reality and, as such, are based on assumptions.
For example, the simple exponential growth model is based on a number of
assumptions that do not hold in all circumstances (many factors affect the
intrinsic growth rate, which is often not time-invariant, not all individuals
within a population are identical, nothing can grow indefinitely, etc.).
However, this model is widely used within its range of validity. Likewise,
the approximation of full models with moment-based approaches requires an
assumption about the shape of the phytoplankton trait distribution

It is unclear whether unimodality in size distributions is a robust feature
in the oceans. Observational evidence from recent work

An aspect that our model does not include in its current version is the
dependency of light acquisition on phytoplankton cell size. Given that the
effect of cell size on light harvesting is well understood

Uncertainty remains about how to describe the zooplankton population, which
we simplified as an assemblage of identical individuals. This has been the
standard approach in plankton ecosystem modelling for decades and we based
the first version of PhytoSFDM on this simple and classical formulation. In
recent years, however, significant efforts have been made to increase the
level of detail of the zooplankton component in ecosystem models. Approaches
are numerous and include the consideration of different zooplankton
functional types, different size classes, and different feeding preferences
and strategies

Biological communities are complex adaptive systems

A key decision in modelling is choosing an appropriate level of detail for
the problem at hand. For example, a species-explicit model offers obvious
advantages, which aggregate models cannot offer, when the interest lies in
understanding the relative importance of particular species in providing
certain ecological services or in quantifying the effect of disruptive
selection. Aggregate models, instead, can be more useful at a higher level of
abstraction, when the interest lies in macroecological properties. In
addition, as we have shown, aggregate models present an advantage with
respect to computation time when compared to full models. The advantages in
terms of reducing complexity and computation time remain unproven in
spatially explicit settings (e.g. in 1-D and 3-D), although preliminary
applications have shown promising results

PhytoSFDM provides a set of methods, under the open-source concept, to quantify macroecological properties of phytoplankton communities, as an alternative to the traditional discrete, species-explicit approach. This effort, we hope, will foster our understanding about the role that biodiversity plays in shaping marine ecosystems.

PhytoSFDM is written in Python (version 2.7.x) as a lightweight and
user-friendly package to facilitate use and re-distribution. We provide
PhytoSFDM as free software under GNU General Public License version 2. The
python package is hosted in (a) GitHUB
(

The package consists of three main modules:

The module

In the above example, the model is executed at a location in the North
Atlantic Ocean centred at 47.5

The last module,

Additional information on the usage of the package is contained in the Readme
file and in the repository webpage in GitHUB. The source code of our model is
fully and freely accessible. Users can modify or add new model variants. This
can be done by manipulating the

We would like to thank Jorn Bruggeman for his support on earlier versions of the model and for his suggestions while we were preparing the draft of this paper. Esteban Acevedo-Trejos and Agostino Merico are supported by the German Research Foundation (DFG) through priority programme DynaTrait (DFG-Schwerpunktprogramm 1704, subproject 19). S. Lan Smith received support from the Japan Science and Technology Agency (JST) through a CREST project. We are also grateful to Andrew Yool, Mark Baird, and an anonymous reviewer whose constructive suggestions helped improve our manuscript. Edited by: A. Yool Reviewed by: M. Baird and one anonymous referee