Modularity explains large-scale reef booms in Earth’s history

Drivers of reef decline are well known both today and in the geological past. Considerably less is known about the preconditions for a pantropical expansion of coral reefs. The geological record of reef building is characterised by considerably long intervals with very limited reef expansion and geologically brief (< 20 million years) episodes of prolific, pantropical reef growth. Here, we propose a new "co-occurrence hypothesis" (COH), which posits that reefs thrive when fast-growing hypercalcifiers co-occur with encrusting organisms such as calcifying microbes or coralline algae to construct wave-resistant structures. While there is little evidence of the effect of abiotic drivers on reef proliferation, we find that positive co-occurrence patterns are significantly more common in reefal as compared to non-reefal communities, suggesting that biological interactions are more relevant in reefs than in non-reefs. Supporting COH, we also show that reefs after the end-Permian mass extinction became more modular in nature with limited membership in reef assemblages during reef booms than in typical periods of reef growth (background intervals). Modularity in reefs may have led to the stabilisation of reef ecosystems, giving them the ability to recover from small perturbations, promoting reefal carbonate accretion and prolific reef growth.


Introduction
Coral reefs are highly complex and biodiverse ecosystems, accounting for at least one-quarter of total marine diversity in an area limited only to shallow tropical marine waters (< 0.2% of the seafloor) (Reaka-Kudla 1997; Knowlton et al. 2010). Reef-building corals may be the foundation for the structurally complex habitats that are observed in modern coral reefs, but it is the complex interactions among multiple organisms, such as crustose coralline algae (CCA), sponges and other encrusters, that result in the hydrodynamically stable structures that sustain the abundant and diverse reef species (Weiss and Martindale 2017;Teichert et al. 2020). CCA are key carbonate producers, and they also act as consolidators and binders of loose sediment in reefs. Sponges, even when not calcifying, may also act as transient binders of reefal debris, thereby facilitating reef development (Wulff and Buss 1979). The geological record similarly contains evidence of the importance of microbial activities in reef frameworks (Riding 2002;Yao et al. 2016;Huang et al. 2019), in producing frameworks, as well as encrusting and binding reefal sediment.
The geological record of reefs, broadly defined as laterally constrained limestone structures built by sessile aquatic organisms, is generally characterised by considerably long (> 50 million years) intervals with very limited reef expansion separated by shorter (< 20 million years) episodes of prolific, pantropical reef growth, referred to here as 'reef booms', or reef crises (Kiessling 2009). Notably, most major reef crises experienced by post-Cambrian metazoan reefs have been associated with hyperthermal events marked by rapid warming that also coincided with changes in the carbon and water cycles, anoxic conditions and ocean acidification (Pandolfi and Kiessling 2014;Kiessling et al. 2022). While we have a good understanding of the causes of reef crises in the geological record, less is known about the geological intervals during which reefs have been significantly more widespread and productive than normal. On geological time scales, such reef booms were nearly as rapid as reef declines, but they have received much less scientific attention. The reef boom over the last ~ 23 million years is just one of several major reef booms which occurred during the last 540 million years and this one has already lasted longer than most previous phases of reef expansions. The expansion of reefs during this period has previously been attributed to (1) the greater availability of low-nutrient habitats, resulting from a decrease in equatorial upwelling (Perrin and Kiessling 2012), (2) suitable climatic conditions and (3) an increase in shallow marine substrate area in the tropics as a result of plate tectonics (Jones et al. 2022).
Previous hypotheses for successful reef building have also focused on the invention or efficacy of photosymbiosis and the biodiversity of potential reef builders (Kiessling 2005(Kiessling , 2009(Kiessling , 2010Stanley and van de Schootbrugge 2009). However, the evolution of photosymbiosis in ancient reef builders remains somewhat speculative (Zapalski 2014). Previous analyses also have suggested that reef proliferation is not strongly cross-correlated with earth system parameters such as temperature or ocean chemistry (Kiessling 2002(Kiessling , 2009. Biotic interactions might thus be more important. Specifically, ecological interactions among reef-building organisms may be important to uphold the structure and functioning of the reef framework.
The structure of ecological communities is heavily determined by the specialisation of different taxa and the number as well as the nature of the connections that are shared among these taxa (Bascompte et al. 2003;Bastolla et al. 2009;Sanders et al. 2018). These interaction networks are the product of evolutionary and ecological processes that act at both the individual and collective levels (Thompson 2005) and have an influence on community persistence (Cenci et al. 2018). The stability of communities can be attributed to the network architecture of a community, more specifically the degree of modularity in an ecological network, i.e. the extent to which the network can be divided into structurally and functionally independent subgroups or 'modules` (Grilli et al. 2016;Landi et al. 2018). In changing environments, the success of a community is not only dependent on the response of individual species to environmental fluctuations but the degree of asynchronicity in these responses (Yachi and Loreau 1999). Modularised communities buffer against declines and extinctions as not all species occupy the exact same niche space and hence are likely to respond differently to environmental disturbances (Yachi and Loreau 1999). Modularised communities tend to be insured against these disturbances through this asynchronicity in their responses to disturbances. On the other hand, in ecosystems without this asynchronicity, i.e. where species all respond similarly, the whole ecosystem behaves as a single species and is more prone to collapse (Landi et al. 2018). At the organismal level, many reef builders, such as scleractinian corals, bryozoans or hypercalcified sponges, tend to be highly modular organisms that depend on colonial growth allowing them to build large reefal frameworks with architectural complexity, flexibility and diversity, making them tolerant to some disturbances (Wood et al. 1992;Wood 1995Wood , 1999.
Here, we test the hypothesis that reef proliferation was self-organised in the sense that certain assemblages of potential reef builders self-enforce the construction of large reef structures. Our "co-occurrence hypothesis" posits that reefs thrive when fast-growing hypercalcifiers co-occur with encrusting organisms such as calcifying microbes or coralline algae to construct hydrodynamically stable structures. We examine the environmental conditions that allow these community assemblages to persist during reef booms and the structure and nature of interactions among reef-building organisms, focusing on the co-occurrence of these organisms in reefs during periods of prolific reef growth.

Data
We downloaded data on all reefs occurring during the Phanerozoic (~ 541 million years) from the PaleoReefs Database (PARED) (Kiessling and Krause 2021) on 30 October 2021. All reefs that were categorised as 'mud mounds' were excluded from the original dataset, because they are probably governed by different ecological factors than true reefs. In total, there were 3159 observations comprising reefs categorised as 'true reef', 'reef mound' and 'biostrome'. The biotic composition for each reef provided in PARED comprises one of 96 types of biotic associations where reef-building groups are defined at the supra-ordinal level (Table S1). Reef-building groups were extracted from these associations and re-categorised in standard groups to ensure consistency among the different biotic associations (Table S1). In the case of red-algae, reefs with red algae listed as being the main or secondary reef builder were classified as containing CCA, following Teichert et al. (2020).
Cumulative reef volume in a geological time interval was used as a proxy for reef proliferation. The PARED dataset contains information on fossil reef thickness, width and extension (Table 1). Only 3% of the data comprised full data of actual sizes (width, thickness and extension) of the reefs. However, most reef sites were categorised in size classes (Table 1). Ordinal and ratio data can be empirically related. Mean reef volume for each size class was calculated to fill missing values and the reef volume was computed following a previous approach (Kiessling et al. 2000). In the case where size classes are not reported, we used an arbitrary, conservative estimate. For example, if no reef thickness was reported, we assumed a thickness of 10 m, which is a conservative estimate for a reef to be reported in the literature (the mean thickness of all measured reef sites is ~ 75 m). If reef width was unknown, we conservatively estimated it to be the same as reef thickness and if lateral extent was unknown, we assumed 100 m (mean extent of measured reefs is ~ 2000 m). The number of observed reefs in the geological record is of course strongly dependent on sampling and preservation, but the biological pattern of waxing and waning is likely maintained in the rock record (Kiessling 2006(Kiessling , 2008. Reef booms were then categorised as intervals where the total volume is above the 75th percentile and reef depressions as intervals where the total volume is below the 25th percentile. Background reef intervals were those where the total reef volume is between the 25th and 75th percentile. Taxonomic occurrences of reef builders were compiled from the Paleobiology Database (PBDB, https:// paleo biodb. org/) on 30 October 2021 and assigned to groups matching the same classification as in Table S1. The environmental data and palaeo-coordinates were obtained from the PBDB and the occurrences were categorised as being in "shallow" or "deep" water and in "reef" or "non-reef" settings based on criteria used in previous studies (Kiessling and Aberhan 2007;Kiessling 2010; Table S2). The occurrences were also categorised as being "tropical" (located between 35° N and 35° S) or "non-tropical". To allow for a comparison between reefs and non-reefs, shallow, tropical, non-reef occurrences were retained, along with all of the reef occurrences. In total, there were 51,848 reefal occurrences and 24,436 non-reefal occurrences of potential reef builders. Both the PARED and PBDB data were resolved to the level of stratigraphic stages of the 2020 Geological Time Scale (GTS 2020; Gradstein et al. 2020). To re-investigate the influence of abiotic factors on reef proliferation, we also compiled environmental data based on palaeogeographical reconstructions and geochemical proxies ( Table 2). All the abiotic variables were recalibrated to GTS 2020 to avoid any biases that may incur due to different timescales used.

Influence of abiotic factors on reef proliferation
We applied a multivariate linear regression model to investigate the relationship between reef proliferation and the selected abiotic variables ( Table 2). As the variables exhibited positive autocorrelations for multiple lags (Table 3), we used an AutoRegressive Integrated Moving Average (ARIMA) algorithm to identify and remove the effect of any autocorrelation on the observations. We used the auto. arima() function from the 'forecast' package (Hyndman and Khandakar 2008) for this purpose. ARIMA performs backfitting optimisation routines to account for temporal autocorrelation and this allows the correction of the non-stationary characteristics of a time series. The auto.arima() function automates this process by testing multiple permutations of different model specifications and returns the best-fitting ARIMA model. We used a stepwise model selection framework based on minimising values of Akaike information criteria (AIC) to select the most parsimonious model. The predictor variables were included as single interval time-lagged variables, i.e. all predictor variables were shifted backward by one time interval to investigate the cross-correlations between reef volume and the predictor variables. The same modelling approach was applied without including any time lag in the models for comparative purposes.

Quantifying co-occurrence of taxa
We used a probabilistic model (Veech 2013) implemented in the R package 'cooccur' (Griffith et al. 2016) to explore the associations between pairs of different taxonomic groups across all sites and time intervals. This approach makes use of a presence-absence matrix to calculate the expected frequency of two taxa occurring together given that they are independently distributed of each other across different sites, in our case, across different reefs. The expected probability (p exp ) of two taxa co-occurring is then compared to the observed probability of co-occurrence (p obs ). A positive association between two taxa is said to occur when p obs > p exp , and a negative association when p exp > p obs . The association is said to be random when there is no significant difference between p exp and p obs .   S A positive δ 34 S excursion may indicate increased deposition of bacterial sulfide (mostly pyrite) in predominantly anoxic marine basins and hence can be a proxy for the (an)oxic conditions of the ocean. It can also represent decreased output from weathering Low oxygen conditions can be a critical factor limiting reef growth. The development of anoxic conditions in the ocean is also controlled by eutrophication and productivity, pointing to the importance of nutrient levels (Kiessling 2002) Prokoph et al. (2013) GTS 2004 (Gradstein et al. 2004) Tropical δ 13 C δ 13 C is a proxy for marine productivity with positive excursions representing increased productivity and carbon sequestration in marine sediments Increased burial rate or organic carbon correlates with a higher potential for reefs (Kiessling 2002) Prokoph et al. (2008) GTS 2004 (Gradstein et al. 2004) To investigate co-occurrence beyond just two groups of organisms, we also carried out a modularity analysis by creating a unipartite taxonomic network where any two groups that co-occur more frequently than expected by chance were linked. In these networks, modules correspond to subsets of taxa whose probability of co-occurring across reefs is higher when compared to the probability of co-occurring with other groups in the wider reef-building community. We used the modularity() in the 'igraph' R package (Csardi and Nepusz 2006) to identify sub-communities within the network structure. The importance of co-occurring potentially reef-building organisms in a reef was also examined by comparing the co-occurrence patterns between reefal and non-reefal sites using the PBDB data. These occurrences were further binned into 0.01 × 0.01 degree grid cells. The type of association (positive, random or negative) between reef-building organisms in these hexagonal cells and each time bin were then evaluated. This analysis was repeated for different cell sizes, namely 0.05°, 0.1°, 0.5°, 1° and 5°, for comparison purposes.

Results
The total volume of reefs, excluding purely microbial reefs, remained relatively low in the Cambrian and Ordovician, with reef volume values remaining close to or below the 25th percentile (considered as reef depressions) of reef volume data across the Phanerozoic (Fig. 1). The first reef boom appeared in the Silurian, which was followed by the longest episode of a reef boom across the Devonian. Otherwise, reef booms were relatively short-lived, lasting ~ 20 million years or less. The reef booms identified here differ from previous patterns reported in the literature, e.g. Kiessling (2009) as (1) reef volume rather than the number of reefs are used to characterise intervals of reef proliferation, (2) mud mounds were not included in our analyses, and (3) we used a statistical definition for the reef booms-those intervals where the total volume is above the 75th percentile were classified. In total, we counted 13 intervals with reef booms across the Phanerozoic and a similar number of reef depressions, and 23 background intervals. All intervals with reef depressions were omitted from subsequent analyses as we aimed to explain the causes of reef booms relative to background times.
We first investigated the relationship between preserved reef volume and reconstructed environmental factors, namely continental shelf area, sea-surface temperature, 87 Sr/ 86 Sr, δ 34 S and δ 13 C (Table 2), using a multivariate framework. The model with the lowest AIC (AIC = 1954.38, Table 2) with an adjusted R 2 of 0.032 (p = 0.12) only included one  (Table 4). The model with temperature and 87 Sr/ 86 Sr as predictor variables, however, was chosen as the "best" model as it had a higher R 2 of 0.038 but only marginally higher AIC (AIC = 1954.98) ( Table 4). All other models similarly showed low or negligible explanatory power (Table 4). Temperature showed a negative relationship with reef volume, where reef volume decreased with increasing temperature, whereas the opposite is true for 87 Sr/ 86 Sr (Table 5).
There are more positive co-occurrences of potential reef builders in reefal sites than in non-reefal sites at a spatial resolution of 0.01 degrees (Fig. 2a). Similar patterns are observed at coarser resolutions but are not statistically significant for resolutions of greater or equal to one degree (Fig. 2b-f). Cooccurrences were also compared between intervals of reef booms and background intervals. During background intervals, modularity in reefs remained low. There was a tendency to have more reef builders co-occurring in background intervals as compared to reef boom intervals (Fig. 3a). Over the Phanerozoic, pooled modularity values of the interaction networks of reef-building organisms during reef booms were significantly higher than those during background times (Fig. 3a,  b). Modularly structured reefs only became common in  respectively. Error bars represent 95% confidence intervals. W represents the Wilcoxon test static and p the association p value post-Permian reef-building communities during the Mesozoic and Cenozoic (Fig. 4), with modularity values significantly higher during reef booms than during background intervals (Fig. 3c, d, Table 6). Individual intervals of reef booms showed high modularity but could not be statistically differentiated from random (Table 6), most likely due to limited sampling in individual time slices.

Environmental control on reef proliferation
We did not find any strong associations between global abiotic variables and reef volume, which suggests that global  (Table 4). This is consistent with previous studies that showed a decoupling between carbonate productivity and environmental factors over the Phanerozoic (Kiessling 2002(Kiessling , 2005. Abiotic factors, individually or in combination, can alter the internal dynamics of ecosystems by influencing the competition balance among key groups (Conversi et al. 2015), such as reef-building organisms in this case, leading to a decrease in ecological resilience and the restructuring of a community, e.g. phase shifts from coral to algal dominance in modern reefs as a result of anthropogenic stress (Fung et al. 2011). Small changes in physical or chemical conditions may be enough to give one group an edge over the another. For example, in modern reefs, the degradation of coral reefs as a result of environmental disturbances leading to large-scale coral mortality can lead to phase shifts where benthic organisms such as macroalgae, sea urchins or sponges become the dominant life form, inhibiting coral recovery (Norström et al. 2009). Similarly, in the geological record, there were changes in the prevalence of reef builders, which may have been triggered by environmental changes. For example, the long-term replacement of dominant microbes and sponges as the dominant reef builders by corals in the Triassic is thought to be triggered by climatic changes (Kiessling 2010;Dal Corso et al. 2020). Another example is the shift from corals to rudists in Cretaceous reefs (Gili et al. 1995;Scott 1995;Pandolfi and Kiessling 2014). This shift has been attributed to a series of environmental changes that favoured rudists.

Cooperative competition
Our results show that positive associations between organisms were more common and negative associations less common in reefs compared to non-reefs, whereas no difference was observed in the number of random associations between reefs and non-reefs (Fig. 2). These associations are only observed at finer spatial resolutions, suggesting that they tend to be localised in reefs and that co-occurrence matters at the scale of individual reef sites but not beyond. Competition for space is severe in reefs and can be considered one of the reasons why reefs have topographical relief in the first place (Fagerstrom et al. 2000). Spatial competition may lead to overgrowth or overtopping of corals over one another, as a result of limited space and availability of hard substrates on the seafloor (Muscatine and Porter 1977;Fagerstrom et al. 2000). The survival strategies of competing organisms can be reflected in their mode of life, habitat, morphology or growth rates (Fagerstrom et al. 2000). In space-limited environments, the winners typically are colonial, sessile and large, have fast growth rates and/ or have morphological flexibility such as corals, calcareous sponges or bryozoans. For example, some reef builders  have developed fast growth rates that can exclude competitors through upward growth or the overtopping of other reef builders (López-Victoria et al. 2006), whereas others are compensated for their losses through indirect effects, such as grazing (Harborne et al. 2016;Wilson et al. 2021).
In the face of competition, reef-building organisms have also developed several mechanisms for coexistence, which we refer to as cooperative competition, a concept adopted from game theory (Fort 2020;Herring 2021). Within ecological game theory models, several organisms interact, directly or indirectly, with each other, while acting in their own interests (which could be in conflict with the interests of, or commonly shared by, other organisms) (Fort 2020). Ecological interactions can be in the form of positive cooperative interactions such as mutualism or conflict-based interactions such as pure competition. In some cases where both types of interaction occur between two organisms, ecological dynamics may result in a state of cooperative equilibrium (Herring 2021). This cooperative equilibrium seems to be especially prevalent after the end-Permian mass extinction (Fig. 3b), which significantly altered the taxonomic and functional composition of reefs, with the rise of scleractinian corals as the main reef builders. In pre-Triassic reefs, hypercalcifying calcareous sponges are observed together with corals and microbes (Fig. 3c), e.g. during the Silurian-Devonian and in the Middle-Late Permian, while corals in modern oceans mostly co-occur with red algae, more specifically CCA; 85% of Mesozoic and Cenozoic reefs listed as being composed of red algae had CCA as reef builders. Biological interactions between these different organisms on reefs, although individually competitive, might lead to cooperative equilibrium within a reef, leading to its success. The positive role of CCA on coral larval recruitment (Ritson-Williams et al. 2014 or as consolidators of modern reefs (Weiss and Martindale 2017;Teichert et al. 2020) is well documented, but many CCA, especially thick crust CCA, compete for space with corals in reefs and this may lead to overgrowth in some cases (Buenau et al. 2012). However, as a result of preferential grazing pressure from herbivorous fishes, they tend to grow in crevices in coral reefs for protection and end up acting as binders or consolidators of reefs and facilitating coral reef formation. Similar cases of cooperative competition, where competition between taxonomic groups has beneficial results for all competitors involved (Fort 2020;Herring 2021), are also observed in the past.

Limited membership in modern reefs
Reefs during reef booms (Fig. 1) were characterised by higher modularity than those in background intervals during the Mesozoic and Cenozoic (Figs. 3, 4). The end-Permian mass extinction wiped out all the Palaeozoic corals and led to a complete restructuring of reef-building communities.
Scleractinian corals expanded during the Triassic as the main reef builders replacing calcifying sponges and microbes in reef environments, leading to the reef boom during the Norian that has been suggested to be due to the spread of photosymbiosis (Kiessling 2010), but could also be the consequence of climatic changes . Scleractinian corals generally aligned with calcareous sponges or more recently with CCA during reef booms, while reefs with noncoral reef builders were commonly associated with microbes (Fig. 3), such as the siliceous sponge-microbial biotic associations observed in the Upper Jurassic (Reolid 2011). The alignments among these reef-building organisms which are all primary producers and contributors to the reef carbonate budget (Kiessling et al. 2000;Lange et al. 2020;Teichert et al. 2020), and therefore promote reefal carbonate accretion and prolific reef growth.
Just like competitive cooperation, modularity can also lead to the stabilisation of ecological networks, giving them the ability to recover from small perturbations (Grilli et al. 2016). During reef booms, the interactions between specific reef-building organisms that are simultaneously competing with each other, as well as favourable environmental conditions, contribute to the increased volume of reefs. Modularity in reefs is not only confined to the higher level organisation of a reef but also at lower taxonomic scales and even at the organismal level (Wood et al. 1992;Wood 1995Wood , 1999. Limited membership among reef-building communities has also been suggested, where similar taxonomic composition is observed in reefs of different ages, despite evidence of environmental disturbances during the Pleistocene (Pandolfi 1996). The evenness of reef-building communities is known to decrease as the number of reefs globally increased during the Phanerozoic (Kiessling 2009) whereby reef expansion can be interpreted to be associated with limited community membership. The Pleistocene is part of the most recent interval of reef boom observed in the geological record (Fig. 1). The persistence of a particular reef composition can also be attributed to the limited community membership observed in the reef (Pandolfi 1996). Increased modularity of the community structure during intervals of reef booms (Fig. 3) indicates close interactions between certain reef-building groups. Limited membership thus confirms the alignment of the same organisms in reefs over time, in spite of environmental perturbations, suggesting that such membership in reef-building communities and subcommunities is crucial not only for building successful reefs but also for surviving environmental disturbances. At the organismic level, modular organisation in reef-building organisms, i.e. the ability to grow vertically or laterally, as is observed in many coral and sponge taxa, provides several advantages to the individual, such as regeneration capabilities and the ability to grow to larger sizes, resulting in modular organisms with greater longevity than solitary forms of the same group (Wood et al. 1992;Wood 1995). Modular organisms are also longer-lived and are better able to survive overgrowths than solitary organisms. These advantages may scale up to the community level as observed here and may explain why massive reefs are able to persist and flourish on long time scales.

Conclusions
Consistent with previous research, this study finds little effect of global abiotic variables on reef volume across the Phanerozoic. Reef-building communities have undergone complex evolution and transitions, with various reef-building organisms being dominant at different times over the Phanerozoic. Instead, we show support for the co-occurrence hypothesis whereby the co-occurrence of and interactions among reef builders are considered crucial for the success of a reef. Positive associations between reef builders are more common in reefs than in non-reefs, although this is only relevant at the scale of the individual reef. While these reef builders may compete with each other for, e.g. space, in reef environments, we propose that reef-building organisms have developed cooperative competition to coexist while building large reefal structures. This is especially true for reef-building communities that emerged in the aftermath of the end-Permian mass-extinction, which coincided with the rise of scleractinian corals as the main reef-builders. Post-Permian reef-building communities were not only highly modularised but also had limited membership in terms of taxonomic composition during reef booms. Reef-builders, such as scleractinian corals, specifically aligned with, e.g. calcareous sponges or more recently with CCA, conditions that favoured reefal carbonate accretion and prolific reef growth.
Acknowledgements This work was supported by the Deutsche Forschungsgemeinschaft (KI 806/17-1) and the Australian Research Council (DP130100250) and is embedded in the Research Unit TER-SANE (FOR 2332: temperature-related stressors as a unifying principle in ancient extinctions).
Author contributions NBR, JMP and WK designed research; NBR performed research and analyses and wrote the manuscript with input from JMP and WK.
Funding Open Access funding enabled and organized by Projekt DEAL.

Data availability
The source code and data used to produce the results and analyses presented in this manuscript are available from: https:// doi. org/ 10. 17605/ osf. io/ ud25t.

Conflict of interest The authors declare no competing interest.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.