Development of transient habitat modeling for stream Macrozoobenthos

In addition to the hydromorphological pressure on the ecological conditions of free‐flowing river courses, increasing water temperature is affecting the water bodies, particularly by changing freshwater community compositions. The low discharge of numerous European rivers in the dry and hot hydrological year 2022 proves this relevance. Therefore, ecological assessment tools such as habitat modeling should take these factors into account when assessing the quantity and quality of habitats. In this paper, the habitat modeling tool “Transient River Habitat Modeling for Macrozoobenthos” (TRiMM) is improved by incorporating a fuzzy logic approach and adding water temperature to the set of parameters determining habitat suitability for macrozoobenthos. Habitat‐relevant parameters, including hydromorphological factors (depth, velocity, mineral and organic substrate) and a water quality factor (temperature), are combined in the habitat model so that it can more broadly characterize river physical conditions and their interactions with biological indicators. Habitat modeling employed the mentioned parameters to simulate suitability for the macrozoobenthos in a small river in central Saxony, Germany. Due to its deteriorated condition, this river was selected as a representative for thousands of kilometers of small rivers across the region, which have been restored. The model simulated the status quo of river conditions from spring to summer for three macrozoobenthos species (Ancylus fluviatilis, Ephemera danica and Gammarus fossarum). The results showed that the natural flow resulted in dynamic habitat suitability both spatially and temporally, which differs for each species. Remarkably, the five‐parameter model (depth, velocity, temperature, mineral, and organic substrate) generally performed better compared to a similar model without temperature.

many river ecological quality assessment tools, such as habitat modeling, to assess the effects of environmental characteristics and potential modifications on a river's ecological status (Melcher, Hauer, & Zeiringer, 2018;Yi et al., 2017).
Although aquatic habitat modeling has been developed for many decades, fewer models focus on macroinvertebrates (Poff & Zimmerman, 2010;. Nevertheless, due to its importance in ecological functions and the increased impacts of hydromorphology on riverine ecosystems, several habitat assessments have emerged in which benthic macroinvertebrates are used as key indicators. PHABSIM (Waddle, 2001), CASiMiR (Schneider, Noack, & Gebler, 2010) and BITHABSIM  are examples of existing habitat models for benthic species. These models simulate changes in flow-related physical habitat (e.g., depth, velocity and substrate) with different discharge schemes.
Essentially, hydraulic models are used to predict the distribution of depths and velocities influenced by changes in flow rates. Then, the habitat model couples the results with species-habitat suitability or preference curves to simulate the relationship between discharge and habitat conditions for target species (Jowett, Hayes, & Duncan, 2008;Schneider et al., 2017;Yi et al., 2017).

Tatis-Muvdi and Stamm (2019) developed Transient River Habitat
Modeling for Macrozoobenthos (TRiMM). The model overlays hydromorphological information (depth, velocity, and substrate composition) to determine the spatiotemporal supply of stream habitat for Macrozoobenthos (MZB). TRiMM uses a long-term unsteady analysis instead of static flow scenarios to evaluate habitat suitability (HS) for MZB. This aligns with the fact that a riverine ecosystem is maintained not only by flow quantity but also by its duration and frequency, which should be accounted for the species' life cycle requirement.
TRiMM focuses exclusively on the morphological-hydraulic factor and does not account for the temperature effects, another essential physical habitat factor (Poff & Ward, 1990;Schuwirth & Reichert, 2013). Over the past decades, the water temperature of many rivers has increased, resulting in changes in the compositions of biodiversity in freshwater ecosystems (EEA, 2016) as thermal extreme limits oxygen supply and stresses aquatic species (Dallas & Rivers-Moore, 2012). Therefore, this study developed an integrated framework, in which temperature and morphological-hydraulic parameters are combined to simulate HS.
The previous version of TRiMM uses a hydromorphological template as a limiting factor, assuming that there is no interaction between variables. However, the literature suggests that species selection of their habitat is a multivariate process based on several interacting factors (Hirzel & Le Lay, 2008). For this reason, the model developed in this study converted numerical data obtained from twodimensional hydrodynamic (2D-HN) models (e.g., depth, velocity and temperature) and field mapping (e.g., mineral and organic substrate) into nature-like linguistic descriptions using a fuzzy system to interrelate these parameters to quantify HS for target species.
TRiMM's habitat simulation is not restricted to specific discharge conditions. Rather, it aims to dynamically assess habitat quality under the EU Water Framework Directive (WFD) goal of long-term persistence of type-specific taxa in the river reach (Tatis-Muvdi & Stamm, 2019). Due to the limitations in available sampling data, the study encompasses only two seasons, spring and summer, in this paper. Nevertheless, this is enough to achieve the study's objective of developing a benthic-invertebrate-specific habitat model that shows how flows, river morphological characteristics and temperature affect spatiotemporal changes in HS.

| Habitat model description
TRiMM was developed in R scripts (R Core Team, 2020) to analyze HS for the target species using a hydro-ecological relationship between environmental parameters and the biological indicator. The model applies fuzzy logic for calculating suitability from mineral substrate, organic substrate, depth, velocity, and temperature. The substrates are interpolated using a classification adjusted from the microhabitat categories (see Table 1). It should be noted that besides CASiMiR, traditional habitat models consider substrate as a single layer while this model separates substrates into two layers, mineral and organic. This is because in a microhabitat, organic substrate (e.g., aquatic plants, algae, etc.) usually covers mineral substrate (e.g., sand, gravel, stones, etc.). Contrarily, an organic bed structure is less dynamic than the other four parameters and can be obtained from field observation, so one map can be used for several time steps (e.g., changing seasonally) depending on the river reach.

| Methodological framework
Habitat modeling must be performed at spatial and temporal scales relevant to the indicator species' organisms or ecological processes (Schmidt, Radinger, Teschlade, & Stoll, 2020;Yi et al., 2017). In this study, the model's temporal resolution of one day and spatial of 0.25 m Â 0.25 m were chosen to conform with the hydrodynamic model and standardized MZB samplings, respectively (Jowett et al., 2008;Melcher et al., 2018). This is also to align with the fact that the hydrodynamics of aquatic ecosystems should be studied on organism-relevant scales. However, it can be adjusted according to the variation of discharge and relevant flow patterns of the studied streams.

| Fuzzy logic
Fuzzy logic in TRiMM has five inputs as the antecedents and one output as the consequent. Following the quality classes defined by WFD, HS is classified into a five-class scheme. In a fuzzy system, depth, velocity, temperature, and suitability are converted to overlapping trapezoidal fuzzy sets described by the membership degree, which linearly increases from 0 to 1 for each set, while mineral and organic substrates are converted to singleton fuzzy sets (Figure 1, upper middle box). These sets are the linguistic description of the model parameters (fuzzy classification).

| Model evaluation
As fuzzy rules depend on hydro-biota relationships, which in this study were derived from literature data, a validation of these relations in habitat model results was required. In this study, the statistical method, Area Under the Curve (AUC) of Receiver Operating Characteristic (ROC) curves (Fawcett, 2006), was used to verify the HS estimated by the model. These indices use presence/absence data for model assessment. However, they are chosen because although TRiMM predicts HS ranging from 0 to 1, it is not expected that a certain number of individuals would be present in particular HS values.
Instead, the species must be absent from low predicted HS areas where habitat conditions are unfavorable for their occupation.
An ROC graph depicts true positive and false positive rate (i.e., presence results occur among all presence samples and incorrect T A B L E 1 Mineral and organic substrate classification adjusted from microhabitat categories proposed by Schmedtje and Colling (1996)

| Study area
The study site, Mortelbach, is a small river in the State of Saxony in east Germany ( Figure 2). The river is approximately 10 km long, origi- inside the tunnels, in which a concreted river bed is present).

| Hydromorphological and biological data
The hydrological data were derived from a pressure sensor in an upstream cross-section of the studied section. The sensor recorded water depth and temperature at 10-minute intervals. The discharge time series was derived from a rating curve. The daily mean temperature was calculated and the time-series graph was also plotted in the hydrograph ( Figure  project, the instream structures were constructed. Different hydromorphological characteristics (riffles, pools) and river bed materials (e.g., fine-medium sized gravels, stones) were placed in the stream.
From this, substrate composition was visually estimated and digitalized using the classification of the microhabitat categories shown in Table 1.
Biological samplings were conducted in spring (21/4/2022) and summer (5/08/2022) at several transects. A total of 52 samples associated with different microhabitats were taken from the study reach.
The dominant mineral substrates in samples were akal (11 samples

| Macrozoobenthos
Three MZB species were investigated: Ancylus fluviatilis, Ephemera danica, and Gammarus fossarum. These species were selected due to their frequent occurrence at the sampling sites in both seasons, their status as indicator species for stream ecological quality and their wellknown physiology. Moreover, they are widespread in European rivers, and the knowledge on their habitat requirements is available.
A. fluviatilis, a freshwater limpet, is frequently found in small to large rivers that do not freeze in winter. It prefers oxygen-rich, fastflowing water, and algae cover (Welter Schultes, 2013). It adheres to hard substrates such as stones and, therefore, tolerates a wide range of flow velocity (Anderson, 2016). However, it is sensitive to pollution and extreme low temperatures could limit its activity (Pfenninger, Staubach, Albrecht, Streit, & Schwenk, 2003 G. fossarum, a freshwater amphipod, is one of the most common species in small and medium-sized water bodies. The species feeds on fallen leaves and has mass reproduction; thus, an accumulation of thousands of individuals per square meter is normally found in favorable river conditions. G. fossarum inhabits headwaters and occurs mostly in streams with high currents velocities (Pöckl, Webb, & Sutcliffe, 2003). The optimal temperature for its reproduction is 12 C (Pöckl & Humpesch, 1990). The values were adjusted during calibration to ensure that the predicted and measured depth and velocity were in good agreement.

| Hydrodynamic and heat model description
The mean daily discharge and water temperature were included in the inflow boundary conditions (Figure 3). For the exit boundary condition, the local bed slope was used. In this study, meteorological data, including cloud cover, air temperature, dew point temperature,

| Substrate composition
In this study, mineral and organic substrate distributions were mapped from field survey data. TRiMM converts substrate maps showing the main morphological features of the river into raster maps using the indices described in Table 1. Figure 5d,e shows mineral and organic substrate in raster maps. Substrates were constant in this study, so the same maps were used for all discharge. Simultaneously, the predictions of A. fluviatilis and E. danica were reasonable, with an AUC of 0.709 and 0.761, respectively (Figure 6a).

F I G U R E 4 SRH-2D model calibration results of (a) water depth (H); (b) velocity (V); and (c) temperature (T)
However, the AUC values generated from calculated HS from field data of input parameters using the second and third model showed lower statistical accuracy (see Figure 6b,c). From these results, the habitat models with five-input-parameter were simulated for Mortelbach, and the results are shown in the next sections.

| Spatiotemporal variations in HS for MZB in the study area
HS for three species were simulated over six months. Mortelbach provided less favorable conditions for A. fluviatilis during these months.
Medium suitability (0.4 < HS < 0.6) ranged from 43% to 70% and low suitability (0.2 < HS < 0.4) from 2% to 45%. High suitability (0.6 < HS < 0.8) for A. fluviatilis occurred throughout the simulation period. However, higher portion was found from May to August, particularly when the temperature raised above 15 C (Figure 7a). The best condition with high suitability of 47% (Figure 8a1) was on a relatively hot day of 17 C at 0.49 m 3 /s. The worst condition with low suitability of 45% (Figure 8a2) was on a cold day of 7 C at 0.03 m 3 /s (<MNQ).
For E. danica, the percentages of suitability classes have a low variance compared to the other two species (Figure 7b). Throughout the study period, the river was mostly in medium suitability (generally 70% to 90%) while providing less than 5% of low suitability. High suitability accounts for approximately 10% to 30% of the reach, except for few days when temperature exceeded 18 C. On these hot days, low suitability increased above 10% (Figure 8b1, with 15% of low suitability). In the End of May to August, high suitability was mostly greater than 30% (Figure 8b2, with 34% of high suitability).
For G. fossarum, a high proportion of high suitability was found in springtime. Particularly, from March until the end of May, the high suitability area ranged between 40% and 60%. In summer, these areas were reduced to 20% and were replaced mainly by medium suitability, except for the days with temperature lower than 15 C (Figure 7c).
The poorest situation had only 5% low suitability, while the largest area (80%) was in medium suitability (Figure 8c2). In the best situation, the river provided a habitat with 71% high suitability and 29% medium suitability (Figure 8c1).

| Habitat distribution and stream's dynamic conditions
At Mortelbach, G. fossarum was recorded as the most abundant species among the three taxa investigated; therefore, we expected a higher portion of suitable habitat for this species. The model results confirmed this assumption, as this amphipod's HS was distributed medium-to-high across the river sections. Also, it was observed that habitat variability for A. fluviatilis and G. fossarum were linked to hydrograph variations to some degree. Nevertheless, the results showed suitability can vary even at the same discharge, and the situation before and after the high peak can be markedly different. The flood event (e.g., in May) created inundated areas, providing habitat for species and high water (>MQ) remains for days. This resulted in an increase in high suitability for all species during this period. However, discharge was not the only factor contributing to this increase. Less high suitable areas for A. fluviatilis were found in the same discharge with low temperature (e.g., in spring).
The influence of temperature on habitat distribution was evident for all studied species. Particularly, the seasonal and diurnal patterns of stream temperature are of high importance as the spatial variations showed a deviation only within 1 C. HS in summer for E. danica was F I G U R E 6 Evaluating habitat modeling performance using AUC (a) including five input parameters; (b) excluding temperature parameter; (c) using all substrate as a single parameter for (1) A. fluviatilis; (2) E. danica; (3) G. fossarum rather consistent. However, low suitability increased on days with temperatures exceeded its threshold of 18 C. A percentage of high suitability for G. fossarum was relatively low in summer since the temperature increased. The opposite happened for A. fluviatilis habitat as high suitability had a positive correlation with temperature. This could be expected as both species have pronounced seasonal and temperature-related patterns regarding their density and life span (Hadderingh, Van Der Velde, & Schnabel, 1987;Pöckl et al., 2003).
There was no habitat scarcity (the whole area has low or very low suitability) during the studied period. The reach supplied a continuously suitable habitat for taxa from spring to summer. However, spatial discontinuity occurred and was prominent for A. fluviatilis habitat. From the simulation, river segments D1 and D2 suffered the most from low suitability, particularly in a period of low flow (<MQ). For E. danica and G. fossarum, these segments also provide lower suitability values compared to the remaining ones. As each taxon has a certain affinity for a specific organic substrate, the fact that D1 and D2 had fewer organic and more artificial substrates ( Figure 5)

| Method discussion
This study investigated how hydromorphology and heat variables change habitat qualities for MZB taxa. The substrate conditions were assumed to be constant for this study as the reach was morphologically restored and the river beds were mostly covered with coarse gravel and stones. Furthermore, organic cover did not change significantly from spring to summer. Nevertheless, the results showed that mineral and organic substrate contributed quite significantly to spatial HS variation. This is because TRiMM is a process-based habitat model, running at the scale equivalent to a hydraulic cell, which makes the model more accurate in determining spatially explicit biotic processes . Moreover, temporal variation of HS suggests that habitat quality and quantity are strongly linked with the stream's flow dynamics, which is an important factor in maintaining diverse assemblages (Johnson, Hering, Furse, & Clarke, 2006).
The findings corroborate that a transient habitat model can capture both the spatial and temporal effects of these conditions. Therefore, the habitat model is useful for the ecological assessment of the river and for the design/management of river restorations (Zingraff-Hamed et al., 2018). For instance, modifications to the substrate distribution and hydrograph with consideration of heat variations can be modeled to improve situations for MZB. It should be noted that the approach is based on existing knowledge of the ecological preferences of macroinvertebrates (Schmidt-Kloiber & Hering, 2015). The uncertainties of these preferences require careful consideration when implementing them in habitat models, and the model outputs should also be properly interpreted (Vermeiren et al., 2021). Moreover, the suitability assignment applied here is limited to small rivers. In future applications on different scales, some parameters, such as fuzzy  Also, the previous TRiMM used hydraulic variables with the capacity to restrict the availability of suitable habitat for species without considering their interrelations. Therefore, five parameters (depth, velocity, temperature, mineral, and organic substrate) were combined in fuzzy system to calculate HS in this study. Fuzzy logic has been widely used in habitat modeling since it was first introduced by Jorde, Schneider, and Zöllner (2000). However, the fuzzy-based MZB habitat model is not as well developed. So far, only CASiMiR has transformed species preference into a fuzzy rule-based system. However, the model focuses only on hydraulic parameters in a steady-state simulation. Therefore, this model presents an improvement from the previous models developed for benthic species.

| CONCLUSIONS
This paper presents transient habitat modeling for three selected MZB taxa in a small river in the State of Saxony, Germany. The results showed that habitat quality fluctuates as a result of discharge variations, substrate distribution, and changes in water temperature. There were spatiotemporal gradients of HS that varied for different species.
TRiMM successfully captured these gradients across the stream, showing the model's potential use as a basis in river ecological management. Long-term spatiotemporal effects on the habitat of river or watershed from dam or weir construction, sediment accumulation, or warm water are usually a few kilometers to a few tens of kilometers long (Yi et al., 2017). Thus, its spatiotemporal outputs enable TRiMM to be up-scaled and used in catchment assessment.
Using numerical modeling to obtain ecologically relevant hydromorphological information can provide a better representation of stream conditions. Even if the presented study was based on constant substrate conditions, the developed method can include sediment transport/morphological dynamics and a longer simulation period, which enables a more complete picture of what may happen during long periods of unfavorable conditions or extreme events such as long periods of low/high temperature and low/high discharge.

ACKNOWLEDGMENTS
This work was scientifically coordinated within the funding program

DATA AVAILABILITY STATEMENT
The data that support the findings of this study are available from the corresponding author upon reasonable request.