## 3 Results and Discussion
### SOM and Hierarchical Clustering as a Tool for Identification of Groundwater Sources  
The use of SOMs coupled to PCA has the additional advantage that the projection of the similarities among variables contains also semi quantitative information about the distribution of the parameters analyzed in the space of the sampling locations; SOM visualization is also able to present simultaneously similarities between positive and negative correlated variables and it also allows the detection of chemical variables that do not associate to a well-defined group [5]. Keeping this in mind, a careful analysis of the similarities between component planes was carried out. There are clear trends in the concentrations of Ca2+, Mg2+, Na+, SO42- and Cl-, where higher concentrations are located in the lower area of the neural map (Figure 4). For the same ions, between two and three groups could be easily identified based on visual inspection. A similar differentiation was not possible for the component plane associated with HCO3-, possibly reflecting the fact that this ion exerts an important control over the chemistry of the groundwaters throughout the area, a hypothesis previously suggested based on the ionic relationships shown in Figure 6. Following the proposed workflow, the neurons were hierarchically clustered, and the number of clusters was chosen according to the output from the _Nelclust_ code. Since seven tested indices proposed three as the best number of clusters (Table 2), a number that also coincided with the visual differentiation of the component planes initially carried out, this was the number of clusters considered. The clustering obtained is shown in Figure 7. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **KL** & **Hart** & **TrCovW** & **TraceW** & **Rubin** & **Ratk** & **Ball** \\ \hline Number of clusters & 3 & 3 & 3 & 3 & 3 & 3 \\ Index value & 2.0 & 3.4 & 104.5 & 15.1 & 0.1 & 0.4 & 34.7 \\ Number of clusters & 3 & 3 & 3 & 3 & 3 & 3 \\ Index value & 2.0 & 3.4 & 104.5 & 15.1 & 0.1 & 0.4 & 34.7 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Indices compared by Nbclust to determine the best number of clusters. KL: maximum value of the index [33]; Hart: maximum difference between hierarchy levels of the index [34]; TrCovW: maximum difference between hierarchy levels of the index [35]; TraceW: maximum value of absolute second; Rubin: minimum value of second differences between levels of the index [36]; Ratk: maximum value of the index [37]; Ball: maximum difference between hierarchy levels of the index [38]. Figure 6: Distribution of the major ions in the first and second component space. Wilcoxon-rank and Kruskal-Wallis non-parametric tests were carried out using the dedicated codes in R [17] as an additional validation of the groupings defined after SOM clustering. Both tests confirmed the results obtained with the _Nbclust_ indices and provided further evidence of the fact that these groups had different distributions and could be considered as different populations. The \(p\)-values obtained for both tests by testing any possible combination of clusters were lower than 0.05. In Figure 7, the result of the clustering is shown superimposed to the counts map obtained after constructing the SOM. Each cluster has a specific chemical composition, and reflects the trends previously observed in the component planes. Cluster 1 (149 observations) is characterized by an intermediate chemical composition, having concentrations of all the major ions that fall within the maximum and minimum values for the dataset analyzed. This is by far the largest cluster obtained and could possibly be reflecting the importance of HCO\({}_{3}\)\({}^{-}\) in the chemistry of this SSWB's groundwaters. On the opposite side, there are Clusters 2 and 3, which correspond to waters with more \"extreme\" chemical compositions. Cluster 2 (38 observations) groups waters that show higher concentrations of all ions, particularly Na\({}^{+}\), Cl\({}^{-}\) and SO\({}_{4}\)\({}^{2-}\) possibly reflecting saline intrusion.