Modeling and Spatiotemporal Mapping of Water Quality through Remote Sensing Techniques: A Case Study of the Hassan Addakhil Dam

: With its high water potential, the Ziz basin is one of the most important basins in Morocco. This paper aims to develop a methodology for spatiotemporal monitoring of the water quality of the Hassan Addakhil dam using remote sensing techniques combined with a modeling approach. Firstly, several models were established for the different water quality parameters (nitrate, dissolved oxygen and chlorophyll a) by combining ﬁeld and satellite data. In a second step, the calibration and validation of the selected models were performed based on the following statistical parameters: compliance index R 2 , the root mean square error and p -value. Finally, the satellite data were used to carry out spatiotemporal monitoring of the water quality. The ﬁeld results show excellent quality for most of the samples. In terms of the modeling approach, the selected models for the three parameters (nitrate, dissolved oxygen and chlorophyll a) have shown a good correlation between the measured and estimated values with compliance index values of 0.62, 0.56 and 0.58 and root mean square error values of 0.16 mg/L, 0.65 mg/L and 0.07 µ g/L for nitrate, dissolved oxygen and chlorophyll a, respectively. After the calibration, the validation and the selection of the models, the spatiotemporal variation of water quality was determined thanks to the multitemporal satellite data. The results show that this approach is an effective and valid methodology for the modeling and spatiotemporal mapping of water quality in the reservoir of the Hassan Addakhil dam. It can also provide valuable support for decision-makers in water quality monitoring as it can be applied to other regions with similar conditions.


Introduction
Over the last two decades, Morocco, as a Mediterranean country affected by climate change, has pursued an economic and social policy characterized by numerous development programs such as the policy of dam construction [1]. These hydraulic infrastructures provide a variety of services to both humans and the environment by organizing agricultural practice [2,3], as well as ensuring an efficient mobilization of water resources and improving the living conditions and environment of citizens [3]. These dams also provide habitat for fauna and flora and play a very important role in the global carbon cycle and climate change [4,5]. However, they are facing the interannual variability of precipitation and the succession of droughts and floods [6][7][8][9]. In order to monitor the water quality and observe the biophysical and biochemical conditions of the Hassan Addakhil dam and to prevent serious damage from occurring to the ecological system, the Guir-Ziz-Rheris Hydraulic Basin Agency (HBAGZR), in charge of water resources management in the Errachidia region, conducts in situ measurement surveys. The implemented system of in situ measurement ( Figure 1) and monitoring is not practical due to its limitations in time and space [10]. It is expensive and has deficiencies that prevent accurate and complete results. Therefore, it is essential to have a complete, accurate, fast and inexpensive monitoring system to follow the water quality of the dam in order to avoid any degradation by applying prompt treatments. Recently, geospatial tools have been widely used for the spatiotemporal monitoring of environmental phenomena [6,11,12], especially the monitoring of lake water quality parameters [3,[13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29][30]. Such application is mainly enabled by the high spatial resolution data [21,24,26] as well as the temporal resolution. However, this aspect has always encountered problems due to the lack of appropriate sensors [31,32]. Moreover, moderate resolution sensors that are characterized by frequent revisit time and high radiometric resolution have been used [31], but the spatial resolution of these sensors does not allow for small lakes [31]. Several works have been carried out using Landsat TM and ETM+ data, but these satellites are limited in terms of revisit time [21,31] for very frequent monitoring. However, with the availability of new satellites with higher spatial, spectral and temporal resolution, such as Landsat OLI and Sentinel-2, retrieval and mapping of water quality from the satellite orbit has become more accessible. In 2008, Kallio et al. [31] conducted a study with the main purpose of monitoring turbidity and colored dissolved organic matter (CDOM) through ETM+ images in lakes in two river basins in southern Finland. The results showed that despite limitations in spectral and radiometric resolution, these images can be an effective and useful tool for water quality monitoring of small lakes (<1 km 2 ). Toming and his collaborators [18] conducted a study in Estonia in which they evaluated Sentinel-2 Multispectral Imager (MSI) data in the mapping of different lake water quality parameters such as chlorophyll a (Chl-a), water color, CDOM and dissolved organic carbon (DOC). Therefore, field data of different parameters were compared to the Sentinel-2 derived band ratio algorithms. The obtained results showed a strong correlation between the Sentinel-2 MSI ratio bands and the different lake water quality parameters such as Chl-a (R 2 = 0.83). In the Czech Republic, a study was carried out by Saberioon and his collaborators [33]. It aimed at developing a semiempirical model for predicting water quality parameters such as Chl-a and total suspended solids (TSS) by combining Sentinel-2A data and machine learning methods. The results showed an adequate prediction accuracy for both Chl-a (R 2 = 0.85, RMSE p = 48.57) and TSS (R 2 = 0.80, RMSE p = 19.55).
Jerry C. Ritchie et al. [29] conducted a study aimed at providing the capability of remote sensing technology in mapping water quality parameters (suspended sediments (turbidity), chlorophyll and temperature). As a result, in situ measurements have been used to assess water quality, and empirical relationships between spectral properties and water quality parameters have been established. Another study was carried out by Carly Hyatt Hansen et al. [30] in the USA at three lakes in the Great Salt Lake surface water system (namely the Great Salt Lake, Farmington Bay and Utah Lake), the objective of which was to improve techniques for the development of algal mapping models through the use of field sampling methods. This study has shown that Landsat, SENTINEL-2 and MODIS sensors are suitable for monitoring water quality in the lake system. In some cases, temporal variability may be an obstacle to detecting short-term events, but it may be sufficient in other areas where short-term variability is lower.
In Morocco and in another context, El Hafyani et al. [34] conducted a study in the Tafilalet plain aiming at modeling and mapping soil salinity through Landsat Oli images. The results showed a strong fitting of this technique with R 2 of models ranging from 0.53 to 0.75 and root mean square error of 0.62 to 0.82 dS/m. Karaoui et al. [3] carried out a study aiming at estimating and mapping the water quality parameters in the Bin El Ouidane reservoir through better understanding the relationship between the latter and digital data. The correlation results showed that all the studied parameters have an R 2 greater than 0.52 and that they can be transformed into predictive models by stepwise regression. This work carried out at the Bin El Ouidane reservoir is of considerable importance for the water resource managers of the Oum Er-Rbia Hydraulic Agency. Thus, the present study was carried out at the level of the Hassan Addakhil dam, in collaboration with the Guir-Ziz-Rheris Hydraulic Basin Agency (HBAGZR). It aims at the validation of this method and the strengthening of its results by comparing them with other studies in the same context.
The objective of this study is to conduct modeling and spatiotemporal mapping of water quality of the Hassan Addakhil reservoir by combining the high spatial resolution data (Sentinel-2) and field measurements. In fact, 20 samples were collected on 14 March 2021, at the same Sentinel-2 satellite transit time. Measurements of nitrate, dissolved oxygen and Chl-a were carried out. Next, a statistical study was performed to select the bands correlated with the quality measurements, and a stepwise regression analysis was elaborated to model each parameter. Finally, a spatiotemporal mapping was made for water quality.

Study Area
The Hassan Addakhil reservoir is located in the southeast of Morocco at a longitude of 4 • 28 50.98 W, latitude of 31 01 00.44 N and altitude of 1125 m ( Figure 2). It accurately lays at Foum Rhiour on the Ziz River, to the north of Errachidia city. It was built in 1970, five years after the devastating flood of October 1965, which ravaged the Ziz valley, leaving 25,000 people homeless. Its retention capacity is 312.8 million m 3 . The objective of its construction was to ensure protection against floods and to achieve agricultural development of the Ziz valley and the Tafilalet plain by regulating its floods. This dam receives the water of the Ziz River and its tributaries, which drain the Upper Ziz watershed.
The latter is rich in fertile valleys but with low development of perennial courses. The geology is of Jurassic type [35] with limestone and dolomitic limestone formations that constitute good water reservoirs [36][37][38][39]. The climate is semiarid with short and brutal precipitation. The rainwater that escapes infiltration and evapotranspiration flows into the Hassan Addakhil dam ( Figure 3). Downstream of the dam, aridity increases and evaporation phenomena increase. The dry period often lasts up to eight months, with maximum temperatures obtained during the months of June, July and August. The winter is relatively wet and very cold with minimum temperatures in January [40].

Ground Data
Ground truth samples were taken at 20 points distributed over the reservoir of Hassan Addakhil dam (Figure 2), where nitrate, dissolved oxygen and Chl-a were measured by chemical process at the laboratory of the Guir-Ziz-Rheris Hydraulic Basin Agency in Errachidia and Gaya Laboratory in Rabat, Morocco, according to the Moroccan law adopted for aquatic waters [41] ( Table 1). The Chl-a indicates the stage of eutrophication in the reservoir, while the nitrates' concentration is directly related to the agricultural practices upstream of the reservoir, as well as to wastewater discharge. Dissolved oxygen was measured in situ using a portable dissolved oxygen meter (BANTE Instruments 821). For the determination of Chl-a, a volume of samples between 0.1 and 2 L was first filtered under vacuum through a glass fiber filter without organic binder with a diameter greater than 1 µm, depending on the algal content, after shaking. Then we proceed to the extraction step by pouring a small volume of acetone (20 mL to 30 mL) into the tube containing the filtered pieces. This step was followed by shaking the extract contained in the extraction tubes for at least 3 min. Finally, we proceeded to the reading of a part of the clear extract by UV-Vis spectrophotometry (Lovibond), which provides double-beam operation with a scattered light rate of 0.01%, wavelength accuracy of +/−0.1 nm and stability of 0.00015. The measurements were made at two wavelengths, A1 = 665 nm and A2 = 750 nm, by comparison with a reference cell filled with acetone.
The determination of nitrates was done by UV-Vis spectrophotometric calibration (Lovibond). In fact, after the preparation of the solution noted, it was smothered by dissolving 129 mg of ammonium nitrate (of raw formula NH 4 NO 3 ) in 1.0 L of distilled water. A solution of mass concentration (or content) equal to 100 mg L -1 was then obtained. Then, we subtracted the absorbance of the blank from the absorbance of each standard solution and plotted the calibration curve showing absorbance versus mass of nitrate, in milligrams per liter. Finally, the nitrate concentration C was determined from the UV-visible calibration curve, established following the Beer-Lambert law.
The analyses of the samples were measured in three replicates, and the average was calculated. The Table 1 shows the average of the three measured values.

Satellite Data
Twelve images obtained from the Sentinel-2 sensor of the European Space Agency (https://sentinel.esa.int/web/sentinel/sentinel-data-access (accessed on 10 August 2021)) were used in this study. These images are characterized by a high spatial resolution of 10 to 60 m from the visible to mid-infrared range and a revisit time of 10 days ( Table 2). The March image was used for calibration with field data and model validation, while the other images were used for spatiotemporal monitoring of different parameters. These images have been uploaded for the period April 2020-March 2021 ( Table 3). The QGIS software was used to process the Sentinel-2 satellite images through the interface (Semi-Automatic Classification Plugin) developed by Luca Congedo [42]. There were several preprocessing steps, including the conversion of digital number (DN) to top of atmosphere reflectance (TOA) and the subsequent atmospheric correction by the dark object subtraction (DOS) algorithm [43].  Figure 4 shows the different phases of this work. A field mission was carried out in the Hassan Addakhil dam on the same day of the satellite visit in order to calibrate the extracted models for the different water quality parameters, for which the image of 14 March 2021 has been used. This mission was done in collaboration with the staff of the Guir-Ziz-Rheris Hydraulic Basin Agency, and the analyses were realized in its laboratory. Later on, a statistical study was carried out to extract the different correlated bands with the different parameters, and a multiple stepwise analysis modeling approach was used in order to set the models. Several models were extracted for the different parameters, and the selection of a suitable one was made on the basis of the compliance index R 2 , the root mean square error (RMSE) and p-value. Finally, after the models' validation and the extraction of their equations, spatiotemporal monitoring of the reservoir water quality was performed through multitemporal images.

Model Assessment and Validation
Modeling is a representation of reality in order to demonstrate some of its properties. Therefore, there are several types of models, such as stochastic models, optimization models, dynamic simulation models and empirical statistical models, that allow predicting the outcome of a categorical variable using a set of quantitative and/or qualitative predictors.
In this case, a statistical model based on a stepwise multiple regression analysis was developed for the models' creation in order to estimate different water quality parameters using the RStudio open source software, using the following equation: Y is the predicted variable with regression coefficients b 1 to k and Y-intercept b 0 when the values for the predictor variables are X 1 to k .
Firstly, a correlation study was conducted between the different water quality parameters and the satellite image bands in order to select the appropriate bands for the elaboration of the models (Table 4). For Chl-a, bands B5, B6 and B7 showed a strong correlation with this band with correlation coefficients of 0.81, 0.71 and 0.73, respectively. The bands B1, B3 and B4 showed a strong correlation with nitrates with correlation coefficients of 0.73, 0.69, and 0.73, respectively. Dissolved oxygen measurements showed a positive correlation with bands B2 and B3 with correlation coefficients of 0.71 and 0.75, respectively. The bands that were chosen in the first step were later integrated into the equations of the different models ( Table 5). The choice of the suitable model was based on the three statistical parameters, namely the compliance index R 2 , the root mean square error (RMSE) and p-value. The priority of choice was given to the models that have the strongest conformity index and the lowest root mean square error, while the threshold of p-value was fixed at a value of 0.05. Table 5 represents the different developed models along with their equations and the different statistical parameters for each. For dissolved oxygen, the chosen model is the one that combines band 2 and band 3, with a compliance index R 2 of 0.56, a root mean square error of about 0.65 mg/L and a p-value of about 0.0009. For nitrates, the chosen model is the one that combines band 1, band 3 and band 4, with a compliance index R 2 of 0.62, a root mean square error of about 0.16 mg/L and a p-value of about 0.0011. Lastly, for Chl-a, the chosen model is the one that groups band 5, band 6 and band 8, with a compliance index R 2 of 0.58, a root mean square error of the order of 0.07 µg/L and a p-value of the order of 0.0024.
In order to verify the accuracy of the proposed models, the measured values in the field and the observed values of the different parameters were presented with their equations ( Figure 5).  Table 5. Statistical parameters of the best performance models.

Spatial Variation of Water Quality
The dissolved oxygen levels measured during the field campaign vary between 5.8 and 9.7 mg/L, while the values estimated by the model show a minimum value of 6.39 mg/L and a maximum one of 9.39 mg/L ( Figure 6). The spatial variation of this parameter shows a well-oxygenated zone in the northeast of the reservoir. This area represents the water inlet to the reservoir. For the spatiotemporal variation, the maps of different months show high values in the northeastern part of the reservoir with a decrease moving away from this area ( Figure 6). Except for few months such as January, October and December, this variation can be explained by the coincidence of these periods with that of water supply for agriculture downstream of the dam which allows the movement of water in the reservoir and consequently an agitation of the water leading to an increase in the values of this parameter.  (Figure 7). The spatial variation of nitrate shows a decrease in values from the northeastern part of the reservoir, representing the outlet, to the southeastern part (Figure 7).
The temporal variation shows that nitrate values do not exceed 10 mg/L throughout the year. This proves the excellent water quality of this reservoir. This variation in the reservoir can be explained by the leaching from agricultural soils and also by domestic discharges of the agglomerations upstream.
Generally, the samples show an excellent quality compared to the quality standards for surface water in Morocco with Chl-a concentrations varying between 0.47 and 0.77 µg/L. The estimated values for the model range between 0.48 and 0.73 µg/L (Figure 8).

Discussion
The combination of field data, high spatial resolution images and modeling shows a strong efficiency in the spatiotemporal monitoring of water quality at the reservoir scale. On the other hand, the measured values of the different proposed models showed in most cases a strong correlation with those measured in the field. Three water quality parameters were selected in this study: dissolved oxygen, nitrates and Chl-a. The choice of these parameters is based on their importance in the eutrophication of fresh or coastal water [44,45]. The most visible phenomena are the appearance in spring and summer of the green tides in coastal marine water and the water in lakes and rivers. These manifestations correspond to an ecological imbalance linked to excessive inputs of phosphorus (including in the form of phosphate PO 4 3 -) and nitrogen (nitrate NO 3 -). In fact, these inputs lead to an explosion in the development of aquatic plants, which leads to an excessive local accumulation of biomass and is the cause of various undesirable effects such as impoverishment of biodiversity, visual and olfactory nuisance, inconvenience for bathing, difficulties in water treatment (drinking water), gas emissions and colonization by algae producing toxins such as certain Cyanophyceae.
Several estimation models have been developed based on the multiple stepwise regression analysis, while the choice of the suitable model was based on the largest compliance index (R 2 ) and the smallest root mean square error (RMSE). The estimation of nitrate was done by applying the model that groups bands B1, B3 and B4 with the largest R 2 and the smallest RMSE among all the extracted models (R 2 = 0.62, RMSE = 0.16 mg/L). For the estimation of dissolved oxygen, the model chosen is the one that combines the two bands B2 and B3 (with R 2 = 0.56 and RMSE = 0.65 mg/L). For Chl-a, the model chosen is the one that includes the bands B5, B6 and B8 (with R2 = 0.58 and RMSE= 0.07 µg/L).
The choice of the bands integrated into the model was made on the basis of a statistical study that was carried out between in situ measurements and satellite data. For chlorophyll a, a correlation was obtained between the in situ measurements of this parameter and band 5 of the Sentinel-2 sensor, which is located in the 704.1 nm spectral range. This result is in agreement with the results obtained by Toming [18], who used the peak reflectance between 700 and 720 nm for the estimation of this parameter. For nitrate, this study showed that the estimation of this parameter is very efficient when using the spectral interval from 442.7 to 664.6 nm (Table 4). For the estimation of the dissolved oxygen, the results show that the spectral interval of 492.4 to 559.8 nm is more appropriate (Table 4). Another work that was carried out by Vanhellemont and Ruddick [23] has shown that one of the main advantages of Sentinel-2 over Landsat-8 is the presence of the band B5 (704.1 nm) with a spatial resolution of 20 m to determine chlorophyll absorption. Eventually, these images will be useful for many aquatic water quality monitoring applications, and they can also be combined into a virtual constellation to improve temporal coverage.
In Morocco, satellite images have been widely used for modeling and spatiotemporal monitoring of several environmental phenomena, but the application of satellite images in spatiotemporal monitoring of lake water quality is still not well developed. The only study is the one carried out by Karaoui and his collaborators in 2019 [3], which aimed to map water quality parameters using Sentinel images. Indeed, the spectral interval from 559.8 to 740.5 nm for the mapping of Chl-a, the spectral interval from 832.8 to 1373.5 nm for dissolved oxygen and the spectral interval from 442.7 to 864.7 nm for nitrate had R 2 indices of 0.78, 0.74 and 0.67, respectively. Therefore, our work involves a complementarity and a recognition of what has been done by these authors, obviously applying it with a different approach and in a different context, adding the aspect of spatiotemporal monitoring which allows for continuous survey throughout the year.
In addition, the results can contribute indirectly to the quantification of the impact of both the agriculture and the discharges in the upstream part of the reservoir. This system represents a very effective and economical solution for monitoring water quality and could be applied by hydraulic basin agencies under several restrictions to travel or other activities or in periods that require remote work (e.g., at the time of COVID-19). Ultimately, this approach is more efficient and not only can be used under similar conditions but also provides vital information on water quality parameters in a faster, more accurate and less computationally expensive way. As a perspective, a seasonal analysis is required to evaluate, calibrate and validate the models obtained in a temporal way.

Conclusions
In this study, a new method of combining high-resolution and field data was applied for the spatiotemporal mapping of certain surface water quality parameters, namely nitrate, dissolved oxygen and Chl-a in the Hassan Addakhil dam in southeastern Morocco. The field results show an excellent quality for most of the samples. In terms of the modeling approach, the models selected for the three parameters have shown a good correlation between the measured and estimated values with compliance index values of 0.62, 0.56 and 0.58 and root mean square error values of 0.16 mg/L, 0.65 mg/L and 0.07 µg/L for nitrate, dissolved oxygen and Chl-a, respectively. After the calibration, the validation and the selection of the models, the spatiotemporal variation of water quality was determined thanks to the multitemporal satellite data.
In summary, this research represents an efficient and useful solution for the hydraulic basin agency in charge of water resources management in the region. Indeed, it will help to minimize the costs of quality surveys carried out throughout the year. It can also contribute to decision-making regarding agricultural profitability and its relation with water quality, as well as to the development of strategies for efficient water resources management.

Acknowledgments:
The authors gratefully acknowledge the support of the staff of the Guir-Ziz-Rheris Hydraulic Basin Agency and Gaya Laboratory in Rabat for equipment and field mission assistance.

Conflicts of Interest:
The authors declare that they have no conflict of interest.