{'fraction_non_alphanumeric': 0.04011205908569973, 'fraction_numerical': 0.01827327136126321, 'mean_word_length': 4.828200371057514, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Assessing temporal and spatial patterns of surface-water quality with a multivariate approach: a case study in Uruguay

The ecological state of inland waters of the Santa Lucía watershed, the primary drinking water source of Uruguay, has raised interest since it presents the seasonal phenomenon of eutrophication. For this reason, an in-depth understanding of the behaviour in time and space of the water-quality variables that characterize this stream is essential. Therefore, this study aims to evaluate the occurrence of spatial and temporal patterns of water-quality variables (Q, turbidity, T, TN, NO3 -, NO2 -, NH4 +, TP, DO, BOD5) in the Santa Lucía Chico watershed with the aid of multivariate statistical tools. The principal component analysis, coupled with k-means cluster analysis, helped to identify a seasonal variation (fall-winter and spring-summer). The hierarchical cluster analysis allowed us to classify the water-quality monitoring stations in three groups in the fall-winter season. The loadings values of the cluster analysis highlighted the most significant pollutants at each monitoring station. The outcomes of this work are expected to contribute valuable knowledge for determining effective management strategies to reduce stream pollution and protect the aquatic ecosystem health of the study area.


Introduction
Water quality is considered worldwide as a measure that can assess the usage of water for different purposes (drinking, industrial, agricultural, habitat, and recreational) using several parameters, like physical, biological, and chemical. Water quality plays a crucial role in all aspects of living organisms on the earth, which attracts the attention of environmental researchers. Water quality varies based on time, location, weather, and the presence of different types of pollution sources [1]. Preserving adequate water quality is a challenging task mainly due to point and non-point sources (NPS) of pollution.
Land use is one of the components of the landscape that plays a critical role in the generation of pollution. In particular, agricultural and urban land use are the primary NPS of nutrients that degrade surface-water quality [2]. Degradation of water quality intensifies phytoplankton biomass and algal bloom, the odor of water, and drinking water purification cost, which finally negatively impacts aquatic and terrestrial ecosystems [3]. Therefore, an effective and comprehensive long-term management of water resources requires a thorough understanding of the entire system, including hydro-morphological, chemical, and biological characteristics.
Water quality is influenced by numerous factors, including all the aspects related to the interaction of the stream with its contributing catchment. Multivariate-statistical techniques, such as cluster analysis (CA) and principal component analysis (PCA), are strategic approaches for i) characterizing water quality; ii) discovering spatial and temporal variations produced by natural and anthropogenic factors;  [7].
Based on these aspects, the goal of this study is to explore the spatial and temporal variability of water quality related to land use in the Santa Lucí a Chico (SLC) watershed (Uruguay). To analyze these variations, the occurrence of spatial and temporal patterns was assessed with the aid of multivariate statistical methods (CA and PCA). The application of these techniques will offer a valuable tool for reliable management of water resources and efficient solutions to pollution problems.

Study watershed description
The Santa Lucí a (SL) catchment (Figure 1 -on the left, highlighted in light brown) is one of the principal sources of potable water of Uruguay. It provides water for more than half (60%) of the country population and maintains numerous agricultural and industrial activities [8] [9]. The Paso Severino (PS) reservoir is positioned in Santa Lucí a Chico (SLC) watershed, a sub-catchment of SL ( Figure 1 -on the right). It is characterized by a lake surface equal to 15 km 2 , a maximum level of 20 m, and an accumulation capacity equal to 65 hm 3 . Its contributing area is equal to 2500 km 2 . A water-treatment plant is situated 35 km-downstream the PS.
Considering the national importance of this catchment, to satisfy all water uses, it is crucial to have suitable water-resource management strategies to assure the appropriate water-quality standard. For this reason, SLC was chosen as a case study. The SLC-watershed surface is equal to 2570 km 2 . Here, the total annual precipitation ranges between 1.0 m and 1.5 m, and the average temperature can fluctuate between 3º C and 30º C, respectively in winter and summer. SLC elevation varies between 25 m a.s.l. (PS lake) and 200 m a.s.l. (north-eastern area of the catchment). The soil is mainly formed by Bruno Sols with loam texture and it has a high content of soil organic matter. The southern part of the watershed is characterized by higher clay and silt proportions. The actual land use/cover is mainly natural and cultivated pastures for dairy and beef cattle grazing (60%) followed by rainfed croplands (30%) and forest (5%) [10].

Data collection
For this work, we adopted the freely downloadable water-quality database of the Uruguayan National Environment Board (DINAMA) (National Environmental Observatory (OAN)) [11]. It provides waterquality variables collected from 2004 to 2018, twice a month, from six monitoring stations placed along   Figure 1). It is important to remark that three of these stations (SLC01, SLC02, and PS01) are positioned upstream the PS reservoir, while PS03, PS04, and PS02 can be found in the lake.
The streamflow dataset was developed by the Uruguayan National Water Board (DINAGUA). The water level was measured three times a day during 2004-2018 from the hydrometric station placed in the city of Florida ( Figure 1).
It is important to remark that the mentioned-above water-quality attributes are aligned with the predominant agricultural land use of the study area.

Data analysis
Traditional multivariate-data analysis, PCA and CA (like k-means and hierarchical cluster analysis (HCA)), were used in this study to detect spatial similarities of the monitoring sites and the occurrence of temporal trends in water-quality parameters. Both PCA and CA were programmed and run in R by adopting the libraries "cluster," "HSAUR," "vegan," "devtools," and "ggbiplot." These are unsupervised methods, e.g., any information about other response variables, or cluster belonging, are not involved in getting the outcomes. For this reason, these techniques are appropriate for exploratory data analysis, whose goal is assumption creation more than assumption confirmation [12].
The cluster analysis aims to divide a multifaceted database into different groups so that the withincluster similarities are higher than the between-cluster ones [13]. These groups are able to identify patterns related to the studied process. The similarity between observations is measured by a distance function. First of all, the similarity is calculated among all data points. Afterward, once the latter starts grouping, the similarity is calculated among clusters too. Numerous metrics exist to calculate this similarity, and its choice could affect the results. A priori and arbitrary choice of the group number (k) is also required for this technique.
PCA is a method that reduces and transforms measured data into new uncorrelated variables known as principal components (PCs). It has the aim of revealing possible patterns among data points and variables [14]. The raw measured data are considered as independent variables. Every single PC is a linear combination of the original variables. The PCs make the basis of the respective vector space and they are organized by decreasing variance. Consequently, PC1 (the first PC) carries the most information about the original data, and so on [15].

Temporal patterns
A PCA associated with k-means clustering was conducted at each water-quality monitoring site to evaluate temporal trends in water quality. With this aim, ten attributes were taken into account: Q, turbidity, T, TN, NO3 -, NO2 -, NH4 + , TP, DO, and BOD5. Taking into account the different monitoring frequency of the variables involved in this analysis, the monitoring dates of water-quality variables were taken as a reference along with an antecedent period (AP) equal to one month, one week, and one day. Since the results obtained for these three cases were quite similar, in this work, we are just presenting the results obtained for AP=1 week. The flow rate considered was the cumulative flow rate during the AP. Since the six monitoring locations do not have the same number (n) of samples, six matrices with a dimension of (n × 10) were used to run PCA/k-means, being n=63 at SLC02; n=39 at SLC01, PS03, PS04, PS02; and n=51 at SLC03. Before the classification, the variables (raw-data) were normalized (mean = 0, standard deviation = 1) to give equal weight to each of them and deal with their various measurement units. The k-means was run for the first and second dimension (called Dim in Figure 2) or PC since they covered 46.4% of the variance. In Figure 2, the spider plot obtained for the sampling site  In Figure 2, we can detect two distinct groups: Winter Cluster (k1), which incorporates fall and winter water-quality observations, and Summer Cluster (k2), which includes spring and summer water-quality observations. In particular, the month grouping chosen for the two detected seasons was arbitrary and it consists of Apr. Hence, October and April are "transition months," that can belong indistinctly to the Winter or Summer Cluster, based on the month grouping. The latter clarifies the presence of two data points from April in k1. It is worth remarking the occurrence of two main seasons (spring/summer and fall/winter) in the water quality of SLC. Similar outcomes were achieved at the remaining five water-quality monitoring sites.

Spatial similarity
HCA was adopted to spatially compare water-quality sampling stations and eventually identifying the occurrence of spatial similarities among them. Considering the seasonal trend previously discovered, two matrices with a dimension of (6 × 9) were used as input of the HCA, where six are the sampling stations and nine are the hydrologic/water-quality attributes (Q, turbidity, T, TN, NO3 -, NO2 -, NH4 + , TP, and DO). An extra column was used as a label for the sampling site identification. The two data matrices were constructed by dividing all data points into two groups depending on the season (fall-winter and spring-summer) and, for both of them, calculating the median of each attribute at each sampling station. The variable BOD5 was not taken into account for this analysis since it was not measured at three stations (PS02, PS03, and PS04). Also for this analysis, the input matrices were normalized. In Figure 3, the dendrograms resulted from the two periods (fall-winter and spring-summer) using Euclidean distance and Ward linkage are presented. In Figure 3, we can notice that, from the water-quality point of view, PS04 and PS03, the two sites positioned in the PS lake, are very similar all year long. The most downstream station, PS02, comes immediately after. It is also possible to detect, on the other side of the dendrogram, the similarity that exists all year long between SLC02 and PS01, which are two consecutive stations, situated immediately upstream the lake. In Figure 3(a), we can see three groups (ki): k1 is characterized by PS04 and PS03 (mentioned above); k2 is formed by PS02, the station placed at the reservoir outlet; k3 is composed by PS01, SLC01, and SLC02, that are the three stations positioned upstream the PS lake, whose contributing watersheds are characterized by natural and cultivated pastures. This net cluster partition can not be detected in the warm season (Figure 3(b)). The rationale is represented by the water balance as the driving force for contaminant delivery at the catchment scale. Mainly, during the cold season, extreme events are more frequent. The latter, along with higher soil-moisture content, produce a higher surface and sub-surface runoff and, consequently, a major amount of pollutant wash-off.
To deliver a comprehensive analysis of spatial similarities of water-quality sampling stations and validate or include further information to the outcomes previously achieved (Figure 3), we run a PCA as a supportive analysis at each sampling site. The six input matrices had a dimension of (n × 10), being n the water-quality sample number at each station (n=51 at PS01; n=39 at PS02, PS03, PS04, SLC01; and n=63 at SLC02) and ten the variables (Q, turbidity, T, TN, NO3 -, NO2 -, NH4 + , TP, DO, and BOD5,). Before running this analysis, matrices were normalized. In this way, all variables were mean-centered and had unit variance. PC1, PC2, PC3, and PC4 were considered as they covered at least 70% of the variance (69.7% at PS01, 79.9% at PS02, 82.7% at PS03, 80.2% at PS04, 69.0% at SLC01, and 73.1% at SLC02). The loadings results found for each monitoring site are described in Table 1.
In this work, PCA loadings higher than 0.5 were assumed to have a significant influence on the related factor [16]. Attributes that significantly contribute to the water-quality spatial characterization at each monitoring site are summarized in Table 2.
It is worth noting that PC1 is contributed by turbidity and T at all monitoring stations. This component can be interpreted as representative of the physical water characteristics. PC2 can be explained mainly with TN. This can justify the presence of turbidity, for the particle-bound nitrogen, and NO3 -, for the dissolved nitrogen, as significant variables to represent PC2. The lower the variance of a PC, the more water-quality attributes characterize that PC. An example is represented by PC3 and PC4, where it is impossible to identify a single contributing variable.
It is also worth remarking that SLC01, SLC02, and PS01 (the three upstream stations) are always characterized by turbidity and Q with the same sign (positive or negative) in PC1 and PC2. This confirms The the previous outcome of the net cluster founded in winter for these three stations, justified by the fact that water balance is considered as the driving force of sediment transport. In Table 2, it is clear the lack of spatial patterns of the water-quality variables. This reflects the results obtained with the HCA in the spring-summer season. Overall, it exists a spatial distribution in the fallwinter season. However, this spatial pattern is not clear anymore when a comprehensive analysis is run at each monitoring station and for each pollution. Table 2. Most representative water-quality/hydrologic variables at each monitoring site. SLC01  T, NO2 -SLC02  NO2 -, NH4 +  PS01  Turbidity, NO3 -, BOD5, DO  PS03  T, TN, TP, Q, NO3 -PS04 Turbidity, T, NH4 + , NO2 -, NO3 -PS02 Turbidity, TN, NO3 -, DO, NH4 +

Conclusions
Multivariate exploratory analyses were used in this study to assess variations in the surface-water quality of SLC watershed. The following main conclusions can be summarized: • The PCA/k-means categorized the hydrologic/water-quality attributes in Winter and Summer Cluster, which respectively represent fall-winter and spring-summer periods. • The HCA revealed spatial similarity during the cold season (fall-winter) between PS04 and PS03, the two monitoring stations positioned in the PS lake, and among PS01, SLC01, and SLC02, that are located upstream the reservoir, whose contributing watersheds are characterized by natural and cultivated pastures.