Ontogenetic shifts in social aggregation and habitat use in a temperate reef ﬁ sh

. Cover, both from physical structure or association with social groups, can reduce predation risk and increase foraging, leading to enhanced growth and survival, and is therefore a critical aspect of the niche for many organisms. However, the need for cover, or the need for a speci ﬁ c type of cover, may change as an individual grows in size, leading to niche shifts throughout development to meet these changing needs. In this study, we examine ontogenetic shifts in cover use by wild populations of a temperate reef ﬁ sh, the southern hula ﬁ sh, Trachinops caudimaculatus , a small, abundant planktivorous social aggre-gator found on temperate reefs in southern Australia. Through repeated in situ surveys, we found clear evidence of ontogenetic shifts in both microhabitat use and aggregation patterns by T. caudimaculatus juveniles in the ﬁ rst three months on the reef. The microhabitat associations of juvenile T. caudimaculatus became more similar to those of adult conspeci ﬁ cs over the study period, and over the same time frame, juveniles increasingly aggregated with adult shoals. Our ﬁ ndings also suggest that trade-offs between structural and social cover are context-dependent, with juveniles relying on structural cover longer when adult conspeci ﬁ c density (and thus intra-speci ﬁ c competition) and/or habitat complexity (and thus the availability of shelter) is high. These ﬁ ndings provide rare and important observations into the complex interplay of social aggregations, habitat use, and ontogeny in wild ﬁ sh populations.


INTRODUCTION
For many organisms, cover-anything that veils, conceals, shelters, or protects (McElroy et al. 2018)-is a critical aspect of the niche, and the availability of appropriate cover can enhance growth and survival (e.g., Birney et al. 1976, Caddy 2008, Ktitorov et al. 2008. Like most requirements, the need for cover is not static, and aspects that provide cover may become less important, or change, as an individual grows in size, leading to niche shifts throughout development to meet these changing needs (e.g., Stamps 1983, Dahlgren andEggleston 2000).
Many animals rely on structure provided by abiotic and biotic physical features of the habitat (e.g., vegetation, topography) for cover (e.g., Stamps 1983, Vehanen and Hamari 2004, Pratchett et al. 2012. Structural cover can both decrease predation risk, if the cover provides a refuge from predators Dill 1990, Tabor andWurtsbaugh 1991), and/or increase predation risk, if the cover conceals or obstructs the view of an approaching predator or hinders an escape (Savino andStein 1989, e.g., Lazarus andSymonds 1992). Studies have shown that many animals prefer to feed near structural cover (e.g., Lima 1990, Beck andWatts 1997), and that foraging effort increases, and vigilance levels decrease, with increasing proximity to protective structural cover (Caraco et al. 1980, Lazarus andSymonds 1992). Structural cover that provides refuge from predation can thus have many benefits for prey organisms; however, remaining near structural cover can come at a growth and fitness cost, if resources become limited (e.g., Ford et al. 2016).
Structure is not the only source of cover; cover can also be created when individuals aggregate with conspecifics (or sometimes heterospecifics) to form social groups (e.g., flocking, herding, schooling; Johannes 1993, Thiollay and Jullien 1998, King et al. 2012. Social aggregation is a common strategy found throughout the animal kingdom and can provide similar benefits as association with structure. This social cover strategy is frequently considered the outcome of selection, driven by a number of well-studied anti-predator benefits gained by an individual when closely associated with a larger group of similar individuals (Krause and Ruxton 2002).
Members of a social group typically benefit from the dilution of individual risk (dilution effect hypothesis; e.g., Foster andTreherne 1981, Roberts 1996), increased vigilance, and early response to threats (many-eyes or safety in numbers effect; e.g., Elgar 1989, Lima 1995, improved coordination of anti-predatory behaviors (Pitcher and Parrish 1993), the confusion effect, where the sheer number of prey creates cognitive difficulty for a predator in targeting a specific individual for attack (Krakauer 1995), and the selfish herd effect, where individuals seek cover behind other group members (Hamilton 1971, Orpwood et al. 2008. Additionally, social aggregation has been shown to increase foraging efficiency through information transfer and social learning (Pitcher et al. 1982, Pitcher and Magurran 1983, Day et al. 2001, and have physiological benefits such as reduced stress levels (Nadler et al. 2016) and increased swimming efficiency (Hemelrijk et al. 2015, Marras et al. 2015. The benefits of social cover tend to increase with group size, and the confusion and selfish herd effects are often enhanced when group members are phenotypically similarmorphologically, behaviorally, or physiologically (e.g., Landeau and Terborgh 1986, Theodorakis 1989, Killen et al. 2017. However, the fitness benefits gained by an individual exploiting social cover also come at a cost. While predation risk decreases with increasing group size, competition and density-dependent effects increase as a result of resource limitation (Pitcher and Parrish 1993, Krause and Ruxton 2002, Ford and Swearer 2013b. While some animals may be highly specialized for using either social or structural cover, others are capable of successfully using both types of cover to reduce predation risk, depending on the circumstances and/or life stage. For many marine and freshwater teleost fishes, trade-offs between social and structural cover are common throughout ontogeny (Lawson et al. 1999, Pereira and Ferreira 2013, McElroy et al. 2018. The use of social cover is a prevalent strategy among marine fishes in early life stages, when juvenile fish are small and extremely vulnerable to predation. As fish grow, social cover often becomes less favorable due to increased competition for food; however, an estimated 25% of fish species continue to shoal or school throughout their adult stage (Hoare et al. 2000).
Structural cover also plays a critical role in early life stages for many fish species. Most benthic or demersal marine fishes undergo a series of ontogenetic niche shifts-changes in habitat, diet, or other resource use during ontogeny-in the first few days to months of their life. In these early life stages, propagules or larvae first undergo a pelagic dispersal phase, after which larvae settle back to benthic habitat (Caley et al. 1996). During this transition phase, many fish use an intermediate nursery habitat with structurally complex vegetative cover (e.g., seagrass beds, mangroves; Nagelkerken et al. 2002), which provides food resources and refuge from predation and can facilitate growth and survival during this particularly vulnerable life stage v www.esajournals.org (Tupper and Boutilier 1997). These distinct nursery habitats are often spatially separated from the species' adult habitat; however, less is known about ontogenetic shifts in habitat use at a much smaller spatial scale, that is, shifts in the reliance on structural cover within a habitat.
In this study, we examine ontogenetic shifts in cover use by wild populations of a temperate reef fish, the southern hulafish Trachinops caudimaculatus. We followed T. caudimaculatus juveniles from settlement through recruitment to the adult stage, across three populations on natural reefs that varied in habitat complexity, to investigate changes in microhabitat use and social aggregation patterns in their first three months on the reef. The specific aims of the study were to examine changes in (1) composition and/or (2) size of social aggregations throughout ontogeny, and (3) microhabitat associations with time and as social aggregation patterns change. We hypothesized that juvenile T. caudimaculatus will trade-off between social and structural cover, depending on the social and environmental context on the reef, and this balance will shift with ontogeny.

Study species and location
Our field study was conducted on temperate reefs in Port Phillip Bay (PPB), a semi-enclosed embayment on the southeast coast of Australia (surface area 1930 km 2 ; mean depth 12.8 m; Black et al. 1993). The reef habitat in PPB is characterized by discrete patches of rocky reef surrounded by soft sediment; reef patches can be macroalgal dominated (Ecklonia radiata and Fucoids-primarily Sargassum spp.) and have high biological complexity, species diversity, and productivity (Jung et al. 2011). The study species, Trachinops caudimaculatus, is a small-bodied (<100 mm), short-lived (1-5 yr) zooplanktivorous fish found in high abundance on reefs throughout Victoria, Tasmania, and extending west to the Great Australian Bight in South Australia (Kuiter 2004). In PPB, Trachinops caudimaculatus occupy 89% of the reefs in the shallow rocky reef system (Ford 2014), forming a metapopulation of discrete local sub-populations connected through larval dispersal.
T. caudimaculatus is a social aggregator, forming large shoals often in thousands, at high densities (>100 fish per m 2 ; Hunt et al. 2011). T. caudimaculatus found in small groups are less likely to forage in the water column; below a certain group size, shoaling does not occur, and T. caudimaculatus are more likely to forage as individuals close to the substrate, whereas above this minimum threshold shoaling is initiated (Fumei 2011, Ford andSwearer 2013a). For this study, however, we use the term shoal to collectively refer to all social aggregations of T. caudimaculatus (i.e., groups of fish, regardless of shoaling activity). T. caudimaculatus larvae hatch from benthic eggs and generally settle back to rocky reef habitat between November and January (Austral summer) after a pelagic larval dispersal period of 30-45 d (Ford 2014). Once settled, T. caudimaculatus are highly reef attached for the remainder of their life, and individuals are highly unlikely to migrate across open water distances greater than 20 meters Swearer 2013a, Fobert andSwearer 2017).
Following settlement, different ontogenetic stages of T. caudimaculatus can be easily distinguished by variation in size, color, and behavior (personal observation). We categorized three ontogenetic stages of T. caudimaculatus that were present on reefs during the study period: (1) new settlers (<1 week post-settlement), which are distinguishable by their small size (~10 mm) and lack of pigmentation; (2) juveniles (~1 week to 3 months post-settlement), which are pigmented (dark brown coloration) and increasingly larger in size (~10-30 mm); and (3) reproductive adults (>~6 months), which are larger (>40 mm; personal observation) and pink-orange in coloration. Due to the seasonality of settlement and recruitment in temperate reefs, the size differences between young-of-year and T. caudimaculatus that recruited the previous year (i.e., reproductive adults) are distinct, making it easy for an observer to identify ontogenetic stage (e.g., the youngest adult T. caudimaculatus in our study would have been~9 months post-settlement at the beginning of the study period and 12 months post-settlement at the end of the study period, when juvenile ages would have ranged from only 1 week up to 3 months postsettlement throughout the same period).
v www.esajournals.org For this study, three T. caudimaculatus populations were surveyed, across three reefs along the Mornington Peninsula, the southeast side of PPB: Schnapper Point (38°12' S; 145°01' E), Point Linley (38°13' S; 145°01' E), and Royal Beach (38°13' S; 145°01' E) reefs (Fig. 1). The Schnapper Point population was chosen for this study as it is one of the largest T. caudimaculatus populations in PPB (Ford 2014) as well as being a site with high numbers of T. caudimaculatus recruits (Hunt et al. 2011, Ford 2014). Due to their proximity to Schnapper Point, all three populations are likely well connected through larval dispersal (Ford 2014) and potentially through movement of adults between Schnapper Point and Royal Beach as the reef is continuous between these two sites.

Establishing context
Prior to the beginning of the recruitment season, the three reefs were assessed for baseline microhabitat availability and to determine placement of three 50-m permanent transects at each site. This was done by running a transect perpendicular to the shore, from the waterline to the reef's edge, and recording depth, macroalgal cover (percent cover of Fucoids, Ecklonia radiata, or understory-non-habitat forming algae), substrate type (flat rock >1.0 m, large boulder 0.5 < 1.0 m, medium boulder 0.25 < 0.5 m, small boulder 0.05 < 0.25 m, cobble 0.01 < 0.05 m, and sand), and T. caudimaculatus density within a 1-m quadrat, every 1 m along the transect. Based on these initial data, three depths thought to be ecologically relevant were chosen to place three visual search transects at each site, which corresponded to (1) the edge of the E. radiata dominant habitat, (2) the start of T. caudimaculatus shoals, and (3) the end of T. caudimaculatus shoals (along the reef's edge). Three permanent 50-m transects running parallel to shore and each other were then established at these three depths at each site (Schnapper Point 8, 15, and 23 m; Royal Beach 11, 18, and 25 m; Point Linley 15, 26, and 35 m from the waterline). To establish any differences in social context between the three populations, the size of the adult T. caudimaculatus populations (total number of adults encountered, number of adult shoals, number of fish per shoal, and v www.esajournals.org density of adult shoals) were assessed along the permanent transects on each of the three survey dates, as described further below.

Assessing aggregation patterns
Following initial set up of transects, all three populations were surveyed on SCUBA on three separate occasions (~1 month apart) in the morning (between 8:00 am and 11:00 am) of December 10, 2014 (day 0), January 10 (day 32), and February 5, 2015 (day 58), to record changes in the use of social cover by juvenile T. caudimaculatus throughout ontogenetic development. Visibility was >8 m at all three sites for all sampling dates. At each site and on each sampling date, all three permanent transects were surveyed for T. caudimaculatus shoals by visual census extending to 2.5 m on either side of the transect belt (survey area = 250 m 2 per transect; 750 m 2 per reef). When a shoal was encountered within the visual search transect, visual counts of T. caudimaculatus in the shoal were recorded, and each fish was classified into 1 of the 3 ontogenetic categories (new settlers, juveniles, adults). T. caudimaculatus shoals are relatively static, and fish did not flee when observers moved slowly, which made counting the numbers of fish in a shoal feasible. When shoals had fewer than 50 individuals, accurate counts of fish were possible. When shoals had between 50 and 200 individuals, the total number of fish was estimated to the nearest 10 individuals; and for larger shoals, counting became more difficult and total number of fish per shoal was estimated to the nearest 100 individuals.

Quantifying microhabitat use
Following the fish census, markers were dropped to identify the boundaries of shoals larger than 1 m 2 , and transect lines were laid to measure and record the length and width of the area under the shoal. As shoals would often slowly move away from an approaching diver, to estimate the boundaries of large shoals, divers would remain still for 1 min at a distance of >2 m, and observe the shoal to visually identify habitat features at four points to mark the longest and widest points of the shoal. Divers would then slowly swim to drop markers at the identified habitat features. Microhabitat characteristics within the defined shoal area were then assessed within a grid, defined by the length and width of the shoal; for every 1 m along the length axis of the shoal, a single quadrat (1 m 2 ) position was determined by random number from all possible positions along the shoal width axis. Percent cover of substrate type (flat rock >1.0 m, large boulder 0.5 < 1.0 m, medium boulder 0.25 < 0.5 m, small boulder 0.05 < 0.25 m, cobble 0.01 < 0.05 m, and sand) and macroalgal cover (percent cover of Fucoids, Ecklonia radiata, or understory-non-habitat-forming algae) were visually estimated within each quadrat. In addition, we recorded depth (m) and a rugosity index, calculated as the ratio of contoured surface distance to linear distance (the chain-andtape method; McCormick 1994), of each quadrat.

Statistical analysis
Establishing context.-To establish the environmental context on the reefs supporting the three populations, differences in habitat availability were assessed using a single-factor permutational multivariate analysis of variance (PERMANOVA; Anderson 2001Anderson , 2005 with population as a fixed factor, and based on 9999 permutations of a Euclidean distance resemblance matrix obtained from non-standardized square-root transformed data for the baseline microhabitat assessments (five substrate and three algal cover types, rugosity and depth) at each survey site. Significant terms were further investigated with a posteriori pairwise comparisons using the PERMANOVA t statistic, and the habitat characteristics contributing most to dissimilarity were revealed using a SIMPER (similarity percentage) analysis.
To test for differences in the size of T. caudimaculatus populations at the three survey sites, we compared the total number of adult T. caudimaculatus surveyed, the number of adult shoals, the size of adult shoals, and the density of fish in a shoal in each of the three populations using four separate single-factor linear models. Pairwise tests of significant terms were conducted using Tukey's HSD with the package lsmeans (Lenth 2016).
Aggregation patterns. -Due to relatively low T. caudimaculatus recruitment during the study year, it was decided a posteriori to group new settlers with juveniles into one classification-hereafter referred to only as juveniles-for all statistical analyses. To assess how composition of juvenile T. caudimaculatus shoals (i.e., any shoal containing at v www.esajournals.org least one juvenile) changed throughout ontogeny, we converted segregated and aggregated shoal classifications into binary data (i.e., juvenile or adult only shoals = 0; mixed shoals = 1) and used a binomial generalized linear model (GLM; package lme4; Bates et al. 2015) with logit link function with survey date (day 0, 32, and 58) and population (Schnapper Point, Royal Beach, and Point Linley) as fixed factors. We first ran the full model, and if the interaction term was non-significant, it was dropped from the model. P-values were obtained using likelihood ratios, and pairwise tests of significant terms were conducted using the package lsmeans.
To assess how the size of juvenile T. caudimaculatus shoals changed throughout ontogeny, we used a linear model with log-transformed shoal size (total number of fish in a shoal) as the response variable, and survey date and population as fixed factors. Type II sums of squares were used to account for unbalanced design resulting from different numbers of shoals encountered at different sites and on different survey days. We first ran the full model, and if the interaction term was non-significant, it was dropped from the model. Pairwise tests of significant terms were conducted using lsmeans.
Relationships between the proportion of juveniles in a shoal, for both segregated (juvenile only and adult only) and aggregated (juvenile and adult mixed) shoals, on each survey date (day 0, day 32, and day 58) and the ten microhabitat variables (depth, rugosity, flat rock, large boulder, medium boulder, small boulder, sand, Fucoid, Ecklonia, and understory algae) were analyzed by Pearson correlation coefficients and by distance-based linear models (DistLMs) based on Euclidean distance resemblance matrices. Optimal models were ranked based on stepwise procedure using adjusted R 2 as the selection criterion, and P-values were calculated using 9999 permutations. Patterns in microhabitat use in relation to shoal composition were explored with non-metric multidimensional scaling (nMDS), which allowed for a comparison of habitat associations for juvenile only, aggregate, and adult only shoals throughout ontogeny. The same correlation and DistLM methods were also used to determine if habitat associations changed with shoal size (total number of fish in a shoal) for both juvenile and adult shoals, or shoal density (number of fish per m 2 ) across shoal all types.

Establishing context
Microhabitat availability differed among populations, and a pairwise comparison showed that Point Linley reef had significantly different microhabitat characteristics than Royal Beach reef, and marginally non-significant differences compared to Schnapper Point (Appendix S1: Table S1). Characteristics contributing the most to dissimilarity in microhabitat availability at Point Linley relative to Schnapper Point and Royal Beach were higher numbers of large boulders and flat rocks, higher abundance of both understory and macroalgal cover, and less reef composed of medium and small boulders, relative to Schnapper Point and Royal Beach (Appendix S1: Table S2).
The size of the T. caudimaculatus populations also differed between the three reefs. Schnapper Point supported a significantly larger T. caudimaculatus population, with more than 3 and 50 times as many adult fish than Point Linley and Royal Beach, respectively ( Fig. 2a; Appendix S1: Table S3). Point Linley also supported a significantly larger population than Royal Beach, with more than 20 times as many adult T. caudimaculatus. Additionally, there was a non-significant trend for greater shoal numbers at Schnapper Point, followed by Point Linley and Royal Beach populations, respectively ( Fig. 2b; Appendix S1: Table S4). The estimated number of fish per shoal also differed across populations (Fig. 2c), with the highest number of fish per shoal at Schnapper Point (mean = 639.0 AE 184.7), an intermediate number at Point Linley (mean = 244.7 AE 92.2), and the lowest number at Royal Beach (mean = 23.7 AE 12.8); the difference between Schnapper Point and Royal Beach sites was non-significant when adjusted for multiple comparisons (Appendix S1: Table S5). The density v www.esajournals.org of fish within each shoal was also significantly greater in the Schnapper Point population compared to Royal Beach, with Point Linley T. caudimaculatus forming aggregations of intermediate shoal densities ( Fig. 2d; Appendix S1: Table S6).

Aggregation patterns
The composition of juvenile T. caudimaculatus shoals changed significantly throughout ontogeny (Table 1), as juvenile fish aggregated progressively more with adult shoals over time. On the first survey date, no aggregate shoals were recorded. Shoal composition shifted significantly in the first month after settlement, with 49% of juveniles recorded shoaling with adults during the second survey date, and more than 60% of juveniles found in aggregate shoals during the last survey date (Fig. 3a). The composition of social aggregations was also found to differ between populations, where juveniles at Schnapper Point were significantly more likely to be found in groups segregated from adult T. caudimaculatus compared to juveniles at the other two sites, which more frequently aggregated with adult shoals (Fig. 3b).
The size (total number of fish) of juvenile shoals also changed throughout ontogeny (Table 2), with a significantly greater number of T. caudimaculatus in juvenile shoals recorded on day 32, and a non-significant increase in shoal size on day 58, compared to day 0 (Fig. 4).

Microhabitat associations
On the first survey date, the proportion of juvenile T. caudimaculatus found in a shoal was positively correlated with understory algae, and negatively correlated with medium boulders, and lesser so with small boulders, and Fucoids (Table 3), determined by stepwise selection. These habitat variables accounted for a total of 53% of the variation in the composition of juvenile shoals at the beginning of the recruitment season. One month after the first survey date, the strongest correlations for proportion of juveniles in a shoal were depth (positive) and Fucoids (negative), followed by weaker positive correlations with reef rugosity and sand, and a negative correlation with medium boulders, explaining a cumulative 49% of the variation. By the last survey date and the end of the recruitment season, microhabitat associations shifted significantly; the proportion of juveniles in a shoal was only weakly correlated with large boulders (positive) and Ecklonia (negative), accounting for only 18% of the variation in shoal composition. NMDS plots were used to visually display the separation of shoals based on proportion of juveniles in the shoal (0% = adult only, 0% <100% = aggregate shoal, 100% = juvenile only) and associated microhabitat characteristics (Fig. 5). On day 0, when no aggregate shoals were observed, there is clear separation of juvenile only and adult only shoals based on microhabitat associations. On day 32 and day 58, juvenile only and adult only shoals remain tightly grouped, whereas aggregate shoals were associated with microhabitat characteristics similar to both juvenile and adult shoals.

Size of shoals (juvenile and adult) and shoal density
The size of juvenile T. caudimaculatus shoals showed strong negative correlations with both large boulders and sand, and to a lesser extent with understory algae, and a positive correlation with Ecklonia (i.e., as the total number of fish in a shoal increased, fish moved away from large boulders, sand and understory algae, and became more associated with Ecklonia). The size of adult shoals was weakly, positively correlated with large and medium boulders, Ecklonia, and understory algae; however, all habitat characteristics only explained a small percentage of adult shoal size variability (21%). The density of a shoal (number of fish per m 2 , including all shoal types) was positively correlated with medium and small boulders and to a lesser extent flat rock (i.e., higher density shoals were more associated with rocky substrate), and negatively correlated with depth (i.e., denser shoals were found over shallower reef). Overall, however, correlations were weak, and these habitat characteristics only explained 25% of the variance in shoal density.

DISCUSSION
Microhabitat preferences and structural dependence of juveniles T. caudimaculatus juveniles in this study were more dependent on substrate compared to their v www.esajournals.org adult conspecifics. In the first two months of the study, shoals composed of a high percentage of juveniles were positively associated with understory algal cover, as well as depth and rugosity index, and were negatively associated with medium boulders, small boulders, and Fucoids. Rocks and boulders, as well as dense or tall vegetation, such as Fucoids and Ecklonia radiata, are often perceived as obstructive cover as these features can hinder an individual's ability to detect an approaching predator (Metcalfe 1984, P€ oys€ a 1994, Fobert and Swearer 2017. On the other hand, less dense or shorter vegetation is often perceived as protective cover (Lazarus andSymonds 1992, Ingrum et al. 2010) and may be used by newly settled T. caudimaculatus as structural cover. The positive association with depth and rugosity reflects the location on the reef where the majority of juvenile shoals were found -along the reef edge, in sandy or flat patches often neighboring a vertical section of the reef which provided crevices for refuge. This strong association with cover-providing habitat in the juvenile stage is common among fishes (both in freshwater (e.g., Werner and Hall 1988) and temperate and tropical marine systems (e.g., Eggleston 1995, Laegdsgaard and Johnson 2001, McDermott and Shima 2006, as small juvenile fish often benefit from the crypsis or small refugia that complex habitats provide (e.g., Beukers and Jones 1998).

Ontogenetic shifts in microhabitat associations
Over the survey period, microhabitat associations of juvenile T. caudimaculatus changed, reflecting a shift from a strong association with substrate (explaining~50% of the variation in shoal composition on day 0 and 32), to a weakening of substrate dependence for cover (explaining only 18% of variation in shoal composition by day 58). Ontogenetic shifts in habitat use are common in marine fishes (MacPherson 1998, Dahlgren andEggleston 2000, Huijbers et al. 2011), as age-specific preferences for microhabitat characteristics change with the evolving needs of juvenile fish as they grow and re-evaluate the trade-offs between minimizing predation risk and maximizing growth (Dahlgren and Eggleston 2000). Similar to our findings, Macpherson (1998) found the clear habitat preferences of three fish species (Diplodus. puntazzo, D. sargus, and D. vulgaris) at settlement decreased as the juveniles grew in size. The interesting shift seen in microhabitat use by juvenile T. caudimaculatus by day 58 is the increasing association with Ecklonia radiata as the proportion of juveniles in a shoal decreased (i.e., as they aggregated more frequently with adult shoals). This association is an indication that juvenile T. caudimaculatus had shifted away from a reliance on structural cover to gaining social cover from the shoal. This is because macroalgal cover, and in particular, E. radiata is associated with increased mortality for T. caudimaculatus recruits (Fobert and Swearer 2017), likely as it provides cover for ambush predators. Furthermore, as the size of juvenile, aggregate, and adult only shoals increased, T. caudimaculatus became even more associated with Ecklonia radiata cover, suggesting larger shoals, regardless of ontogenetic stage, are less reliant on structure for cover.

Ontogenetic shifts in aggregation patterns
The observed temporal changes in microhabitat associations of juvenile T. caudimaculatus in this study coincides with a shift in shoaling strategies, as juveniles increasingly aggregated with adult shoals over the study period. Although we did not measure total lengths of fish in this study, these shifts most likely correspond to reduced vulnerability of juveniles with increased body size, and a shift in the perceived costs and benefits of shoaling (predation risk, inter and intra-specific competition, access to shifting food resources) as ontogenetic growth results in juveniles that are phenotypically more similar in size to their adult conspecifics. However, this tipping point in ontogeny, where social cover outweighs structural cover for juvenile T. caudimaculatus, also depends on the environmental and social context of the reef. On Schnapper Point, a reef which supports a large T. caudimaculatus population with a high conspecific density, as well as high structural complexity, juveniles were found primarily in segregated groups near the substrate throughout the entire survey period. In contrast, at Point Linley and Royal Beach, reefs with low structural complexity (Point Linley) or low conspecific density (Royal Beach) aggregated shoaling with adults occurred much more frequently-with juveniles aggregating with adult shoals~50% of the time at both reefs. These findings suggest that the timing of transitions between structural and social cover are also likely cryptic density-dependent, where the quality of habitat at a site is interacting with density-  Osenberg 2003, Ford et al. 2016).
Many laboratory-based studies have investigated the trade-offs between dilution and oddity effects in shoaling fish, and findings suggest the benefits of dilution (i.e., aggregating with large shoals of adults) outweigh the benefits of reduced oddity (i.e., remaining in smaller groups with similar-sized juveniles), and as predation risk increases, the importance of phenotypic matching decreases (e.g., Hoare et al. 2004, Rodgers et al. 2011. Although dilution effects may outweigh reduced oddity effects when it comes to reducing vulnerability, ontogenetic and sizeassortative shoaling is common among fish species (e.g., MacPherson 1998, Hoare et al. 2000, Huijbers et al. 2011) because shoaling behavior is driven by two underlying processes: (1) reducing vulnerability and predation risk, and (2) increasing foraging efficiency. In large shoals, competition for food resources is much higher than in smaller shoals and thus can cancel out the benefits of increased dilution (Ford and Swearer 2013b). In addition, younger, smaller fish can be outcompeted in a shoal of larger fish and therefore do not gain a foraging advantage from the shoaling behavior (e.g., Peuhkuri et al. 1997, Ward andKrause 2001). On Schnapper Point, where T. caudimaculatus experienced a higher conspecific density compared to the two other populations, the interaction between the quality of the available habitat and the high intra-specific competition from the adult fish population was driving the differences in shoal composition at this site-as the perceived costs and benefits of shifting to social cover did not outweigh structural cover during the study period.
Not surprisingly, the size (total number of fish) of juvenile shoals also increased over the study period, from day 0 to day 32. This difference in shoal size could be driven by new recruits settling to the reef and aggregating with older groups, as T. caudimaculatus are attracted to conspecific cues at settlement (Fobert and Swearer 2017). However, recruitment was exceptionally low during this settlement season, and the change in shoal size is more likely explained by juveniles aggregating more frequently with Notes: Numbers represent the percentage variation explained when added stepwise to DistLM models. Significant variables are indicated in bold, with level of significance denoted by * at P < 0.05 and ** at P < 0.01, and *** at P < 0.001 as assessed using 9999 permutations. Cells without values denote situations where a trialed variable was not added to the model in the stepwise procedure. Total variation of the model is the sum of variability for each included term. Numbers in parentheses indicate Pearson correlation coefficients (R) for shoal characteristics and each habitat variable included in the model. v www.esajournals.org larger adult shoals in the latter half of the season. Shoal size is not static, however, and optimally, shoal size will shift to best suit the immediate required activity (Hoare et al. 2004).
While the current study did not investigate the mechanisms behind the observed shoal characteristics and aggregation patterns, it is possible that the dual shoaling strategies (i.e., both segregated and aggregated shoals) observed in both Point Linley and Royal Beach populations is a result of shifting trade-offs. Under increased perceived threat of predation, juvenile T. caudimaculatus aggregate with adults to form larger, safer shoals, whereas if there is no predatory threat detected, juveniles segregate into size-matched shoals where they may benefit more from foraging with similarly competitive individuals and still benefit from limited protection by remaining in a phenotypically homogeneous shoal. This hypothesis fits with optimal foraging theory, where an animal's foraging strategy is adapted to maximize fitness gains (growth and survival) under the immediate constraints of the environment (Pyke et al. 1977). Similar, but opposite shifts in foraging strategies and habitat use were observed in a juvenile freshwater fish species, Lepomis macrochirus, where in the absence of predators, the juvenile fish occupy the open water habitat that supports the highest foraging (and thus growth) rate, but retreat to safer, vegetated habitats in the presence of predators (Werner and Hall 1988). Future research that quantifies both prey availability within microhabitats and predation risk (e.g., the number of predators present on a reef during a survey) would be needed to assess how the perceived threat of predation is influencing the trade-offs between structural and social cover for T. caudimaculatus.

Conclusions
Our study showed clear evidence of ontogenetic shifts in both microhabitat use and aggregation patterns in a free-ranging temperate reef fish. The ontogenetic shifts observed were consistent with trade-offs between reliance on structural cover or social cover for protection from predation. Over the three-month study period, the microhabitat associations of juvenile T. caudimaculatus became more similar to those of adult conspecifics, and over the same time frame, juveniles increasingly aggregated with adult shoals. The difference in aggregation patterns observed across the three populations also suggests that these trade-offs are context-dependent, with juveniles relying on structural cover longer when adult conspecific density, and thus, intra-specific competition is high. Findings also suggest that the timing of transitions between structural and social cover also likely differ among reefs that vary more greatly in habitat quality, such as in the availability of shelter (i.e., in a cryptic density-dependent manner). These findings provide important observations into the complex interplay of social aggregations, habitat use, and ontogeny and lay the foundation for future studies of how social and habitat context influence aggregating behaviors in wild fish populations.

ACKNOWLEDGMENTS
Field assistance for this study was provided by Chris Taylor. We thank Christos Ioannou and anonymous reviewers for providing feedback on earlier versions of the manuscript. This work was supported by the Victorian Government's Seagrass and Reefs program and by a Holsworth Wildlife Research Endowment-Equity Trustees Charitable Foundation grant to EKF. EKF formulated original idea; EKF, SER and SES developed methodology; EKF conducted fieldwork; EKF and SER analyzed the data; EKF wrote the manuscript; SER and SES provided editorial advice. The authors confirm no conflict of interest.