1 Introduction

In most of the arid and semiarid regions of the world, the availability of sufficient freshwater has become a factor limiting growth [1,2,3]. In parts of North Africa, where water scarcity has always been a dominant problem, interference with the natural hydrological cycle through overexploitation of groundwater resources and changes in land use has caused not only reduction of available water, but also degradation of water quality [4,5,6].

The geochemistry of groundwater in coastal aquifers represents previous geological conditions and current anthropogenic processes that affect the quality of groundwater [7,8,9,10]. However, the local and regional meaning of these aquifers, the key hydrogeological trends, hydrochemical characteristics and groundwater origins remain poorly known [11,12,13]. The combination of geochemistry and isotopic tools can lead to relevant information on the origin of mineralization of karst water [14,15,16,17]. Stable isotopes integrated with major ions in groundwater have been employed in regional groundwater studies at different locations across the world. The works of [18,19,20,21,22,23,24] have demonstrated effectiveness of this approach in understanding recharge pattern, origin and residence time of groundwater from specific sites to basin-scale hydrogeological investigations. Most of these studies have contributed vital information and knowledge that are useful in global groundwater resource management. Dissolved major ions and stable environmental isotopes (δ18O and δ2H) have been used to describe the sources of salinization and hydrogeochemical processes affecting groundwater quality in this complex system [25,26,27]. In addition, the objective of this research is to determine the main source(s) of groundwater mineralization in different aquifers (Plio-Quaternary and Cenomanian–Turonian). The goal of the current study system is to provide baseline information on: (1) the hydrochemical characteristics of groundwater, (2) the key processes that deteriorate the quality of groundwater and (3) the sources of groundwater recharge and their mixing pathways.

2 Climate

The Meskala–Ouazzi sub-basin is located in the north-eastern part of Essaouira city (Fig. 1). It is bordered on the north by Jbel Hadid, on the south by Igrounzar Wadi, on the east by the Bouabout region and on the west by the Atlantic Ocean (Fig. 1). This study is crossed by Wadi Ouazzi and Wadi Igrounzar whose natural outlet is the Atlantic Ocean and has a total area of 1260 km2. The basin is under semiarid climate with irregular rainfall of about 300 mm year−1 and the temperature oscillates around 20 °C [9, 22].

Fig. 1
figure 1

Study area and locations of groundwater samples

3 Geological and hydrogeological settings

Geologically, the upstream part of the study area (Fig. 2) is dominated by the middle and upper Cretaceous outcrop (Albian, Vraconian, Cenomanian and Turonian). These formations consist of banks of limestone and dolomitic intercalated with marls and sandstones. The Albian and Vraconian are represented by green marls (thickness 160 m) and dolomitic limestones (thickness 140 m). The Cenomanian is characterized by an alternation of grey marls with anhydrite, lumachellic limestones and sandstones in small proportions (thickness 200 m) [28, 29]. The Turonian consists of limestones where silica is very abundant. The downstream part of the study area is characterized by the outcrop of the Plio-Quaternary formations. These are represented by conglomerates, alluviums, colluvium and sandstones (Fig. 2).

Fig. 2
figure 2

Geology map in the study area

Hydrogeologically, two major aquifer systems have been identified: the first is a multi-layered aquifer consisting primarily of Plio-Quaternary detrital deposits (sandstones, conglomerates and sands), responsible for much of the population’s water supply. This comes into close contact with the formations of the Triassic and Cretaceous below. The second is the calco-dolomitic layers of the Cenomanian–Turonian age [28, 29], reflecting the karstic aquifer; according to [28, 29], the Turonian horizon flourishes between 400 and 700 m altitude (a.s.l.) on the Jbel Kchoula, while the Plio-Quaternary layers grow between sea level and 300 m altitude (a.s.l.). Transmissivity levels are approximately 4.5 × 10–5 to 6 × 10–2 m2/s from pumping experiments conducted inside the Plio-Quaternary aquifer [28], while the hydraulic has a permeability of 3.2 × 10–2 m/s in the downstream part of the study area [29].

4 Methodology

Four water sampling campaigns (112 boreholes, wells and springs) were performed in 1995 (18 samples), 2007 (25 samples), 2016 (19 samples) and 2019 (50 samples) in the Meskala–Ouazzi region of Essaouira basin (Fig. 1). Measurements of physico-chemical parameters (temperature, pH, electrical conductivity and TDS) were taken in the field using the multi-parameter HI9828. The depth to water in each well was measured using a sound piezometric probe. The water samples were taken after pumping for 10–15 min to obtain representative values under ambient aquifer conditions. Samples were collected in clean polyethylene bottle of 500 mL and then stored at a temperature below 5 °C before analysis in the laboratory.

Chemical analyses were carried out at the Laboratory of Geosciences and Environment of the Ecole Normale Superieure of Marrakech (Morocco). The contents of chloride (Cl) and sulphate (SO42−) anions were determined to adopt the Mohr technique and the nephelometric technique, respectively. Ca2+ and Mg2+ concentrations were determined using the EDTA titrimetric method. HCO3 and CO3 contents were analysed by titration using 0.1 M HCl acid. Na+ and K+ were measured by flame spectrometry at the University Center for Analysis, Technology Transfer & Incubation Expertise (CUAE2TI) at the Faculty of Sciences (Ibn Tofail University, Kenitra, Morocco). The ionic balance for all samples was within ± 10%.

Stable isotope levels were measured by laser spectroscopy. The measurements are expressed in per mille compared to the international Standard Mean Ocean Water (SMOW) with an analytical uncertainty of ± 0.1‰ for δ18O and ± 1‰ for δ2H. The analyses of stable isotopes (δ2H and δ18O) were carried out at Centro de Ciências e Tecnologias Nucleares laboratory (CTN/IST, Universidade de Lisboa).

The methodology adopted thus makes it possible to explore the potentials of a multidisciplinary approach, centred on the use of stable isotopes, to determine the recharge areas of the main sources studied. The technique of interpolation (IDW) via a geographical information system (GIS) was used to compile spatiotemporal distribution maps of electrical conductivity.

5 Results and discussion

5.1 Piezometry

Four piezometers (a-d) were used to track the Meskala–Ouazzi sub-basin piezometric level. Furthermore, Fig. 3 shows that heavy rains cause a continuous increase in the piezometric level, indicating that groundwater levels are highly dependent on precipitation. The four piezometers studied display a general downward trend, despite a small increase in the piezometric level with intense precipitation [4]. Like other basins in coastal areas [30], the Essaouira basin has not been spared the effect of climate change, which is added to the effect of the overexploitation of groundwater. This effect is manifested by (a) an increase in population of 9% leading to an increase in irrigated land (1300 ha), (b) upward trend in temperatures with 1.5 °C warming and a general downward trend in precipitation of 12% and (c) a deterioration in the quality of groundwater with an increase in salinity. This depletion is due to marine intrusion and a decline in aquifer recharge rates due to the drop in precipitation result of climate change [4, 17].

Fig. 3
figure 3

Piezometric levels for the period 2006–2016 in the study area

5.2 Hydrochemistry

The results of chemical analyses are plotted on the Piper diagram [31] (Fig. 4a). This diagram shows that there are four chemical facies in the groundwater of the Meskala–Ouazzi: HCO3–Ca–Mg, Cl–Na, Cl–Ca–Mg and SO4–Ca, with domination of the Cl–Ca–Mg water type. This transition from one facies to another illustrates the importance of the hydrogeochemical processes that control the salinity of the aquifer’s waters. For 24 years, the groundwater in the study area retains the same facies.

Fig. 4
figure 4

Hydrochemistry of the four campaigns 1995, 2007, 2016 and 2019 in the study area. a Piper diagram; b correlation between Ca2+ + Mg2+ (meq/L) and HCO3 + SO42− (meq/L)

The Ca2+ + Mg2+ versus SO42− + HCO3 plot (Fig. 4b) shows that the cation exchange is not the only process controlling the composition of groundwater. The diagram (Fig. 4b) can be divided into three groups. Samples fall along the 1:1 equiline showing the dissolution of gypsum, calcite and dolomite [32]. The second group is represented by samples showing slight dominance of Ca2+ + Mg2+ over HCO3 + SO42−, and the third group is represented by samples showing a marked increase in the concentration of Ca2+ + Mg2+. The high concentration of Ca2+ + Mg2+ relative to SO42− + HCO3 can be a result of reverse ion exchange [30].

Similarly, increasing calcium and bicarbonate levels in the groundwater are considered to be responsible for the dissolution of carbonate minerals. This suggests that reverse ion exchange reactions and weathering are the dominant processes controlling the groundwater chemistry due to the excess HCO3 [33], and this is confirmed by Fig. 8.

To determine the major elements that contribute to water mineralization, a correlation between major element content and EC was established (Fig. 5). For the groundwater from Meskala–Ouazzi sub-basin, Ca2+, Mg2+, SO42− and Cl were found to be the main contributors to groundwater mineralization. For the groundwater from the study area, the main elements responsible for groundwater mineralization were Mg2+, SO42−, Na+ and HCO3[6, 21].

Fig. 5
figure 5

Bivariate plots of electrical conductivity (EC) plotted against chemical constituents of groundwater

The diagram of Ca2+ vs Mg2+ (Fig. 6a) indicates that most points are aligned on the straight line of slope 1. This reflects the contribution of dolomite dissolution to the mineralization of groundwater, especially in waters sampled in 2016. If the samples plot close to the 1:1 line, calcite, dolomite and gypsum dissolution is prevailing in the aquifer. If the samples fall below the 1:1 line, it reflects the dominance of ion exchange reactions, but if they plot above the 1:1 line, then there is the presence of reverse ion exchange reactions [32].

Fig. 6
figure 6

Correlation diagram: a Ca2+ vs Mg2+, b Na+ vs Cl, c Ca2+ vs HCO3, d Ca2+ vs SO42

The Na+ vs Cl diagram (Fig. 6b) indicates that most samples are aligned or before on the 1:1 axis, and the concentration of Cl is correlated with Na+ with a strong correlation R2 = 0.9, indicating that halite dissolution may be the major reaction influencing the water chemistry; high values of Cl and Na+ can be resulted from evaporation and the seawater intrusion in groundwater in coastal areas. The water sample points with low densities of Na+ and Cl are basically distributed near the 1:1 line under the action of atmospheric precipitation and rock–water interactions. When entering the discharge area (downstream area), the groundwater is gradually affected by surface water recharging, human activities and evaporation. Both Na+ and Cl begin to increase and the distribution of the groundwater sample points along y = x also begins to show a trend of unevenness [34]. This is also confirmed by the plot shown in Fig. 8. No relation had been mentioned between Ca2+ and HCO3. For the four campaigns (1995, 2007, 2016 and 2019), the interaction between Ca2+ and HCO3 (Fig. 6c) is poor. This illustrates the negligible involvement of calcite dissolution in groundwater mineralization in the study area.

On a plot of Ca2+ and SO42− (Fig. 6d), majority of the samples for the four campaigns (1995, 2007, 2016 and 2019) plot close to the 1:1 line and thus, with high correlation R2 = 0.8, indicate gypsum dissolution. However, the samples that plot below and above the 1:1 line suggest interplay of ion exchange and reverse ion exchange reactions due to excess SO42− and Ca2+, respectively (Fig. 6d).

5.3 Spatiotemporal evolution of electrical conductivity

Electrical conductivity (EC) values range from 615 to 5738 μS/cm with an average of 2449 μS/cm for 2019 samples, 803 to 4450 μS/cm with an average of 2345 μS/cm for 2016 campaign waters, 900 to 3880 μS/cm with an average of 2044 μS/cm for 2007 campaign waters and 382 to 3060 μS/cm with an average of 1495 μS/cm for 1900 campaign waters (Table 1). However, an increase in EC values has been observed from 1995 to 2019. The spatial distribution of EC values (Fig. 7a–d) for the four campaigns indicates that the salinity of groundwater in the study area where groundwater discharges into the Atlantic Ocean has risen over time, especially in 2019.

Table 1 Chemical composition of analysed samples of four campaigns 1995, 2007, 2016 and 2019
Fig. 7
figure 7

Spatial distribution of EC in 1995 (a), 2007 (b), 2016 (c) and 2019 (d)

5.4 Mechanisms controlling groundwater chemistry

The Gibbs diagram is an important tool for identifying these geochemical processes [35]. This consists of a plot of the ratio of dominant cations Na/(Na + Ca) and anions Cl/(Cl + HCO3) against the TDS to determine the general mechanisms controlling the chemical composition of the studied groundwater. Essentially, groundwater chemistry is controlled by three dominant natural mechanisms, including rock weathering dominance, evaporation dominance and precipitation dominance [36, 37]. As indicated in Fig. 8, the possible causes of cations and anions dominance in groundwater samples are the water–rock interaction and evaporation processes. The dominance of calcium and bicarbonate ions in the groundwater samples is due to weathering process in aquifer rocks. Evaporation greatly increases concentrations of ions formed by chemical weathering, leading to higher salinity.

Fig. 8
figure 8

Gibbs diagrams for the major ion composition of the groundwater in the study area

5.5 Environmental isotopes (δ2H and δ18O)

A total of 19 samples collected in 2016 were analysed for stable isotopes (δ18O and δ2H). Seven samples represent the downstream of study area (Plio-Quaternary aquifer), and 12 samples represent the upstream of study area (Cenomanian–Turonian aquifer). For the upstream samples, the oxygen-18 contents vary between a minimum of − 6.01‰ vs SMOW and a maximum of − 3.28‰ vs SMOW, with an average of − 5.04‰ vs SMOW. For deuterium, the maximum value is − 21.2‰ vs SMOW and the minimum value equal to − 34.5.8‰ vs SMOW with an average of − 29.8‰ vs SMOW (Table 2). As for the downstream samples, the contents of oxygen-18 vary between a minimum of − 5.08‰ vs SMOW and a maximum of − 3.9‰ vs SMOW, with an average of − 4.63‰ vs SMOW. For deuterium, the maximum value is − 20.2‰ vs SMOW and the minimum value equal to − 28.7‰ vs SMOW with an average of − 24.87‰ vs SMOW (Table 2). The results of isotopic analysis, the global meteoric water line [38] and the local meteoric line [39], were reported on the deuterium–oxygen 18 diagram; this diagram (Fig. 9a) shows that two groups of water can be distinguished.

Table 2 Isotopic composition of analysed samples campaign 2016 in Meskala–Ouazzi sub-basin
Fig. 9
figure 9

Isotopic data in the study area. a δ18O versus δ2H for 2016 campaign; b δ18O versus Cl diagram

For the isotopic characterization of study area, two reference lines were used: the global meteoric water line (GMWL) following Eq. (1) [38],

$$ \delta^{2} {\text{H }} = 8*\delta^{18} {\text{O}} + 10. $$
(1)

And the local meteoric water line of Essaouira basin (LMWL) according to Eq. (2) [39]:

$$ \delta^{2} {\text{H}} = 7.95*\delta^{18} {\text{O}} + 11.3. $$
(2)

The first group is characterized by the most enriched samples, generally from the upstream of study area, that plot below the two reference lines (GMWL and LMWL), as like samples (El 4, El 2, El 1, El 5, El 7). These water samples are located in the zone of the aquifer recharge, which are mainly characterized by the absence of soil (Fig. 1). This trend could indicate recharge of the aquifer by evaporated meteoric water and/or the return flow of evaporated irrigation water. Evaporation can be produced either before recharging when precipitation passes through the atmosphere with low water content or after recharging by leaching heavy isotopes accumulated during the dry season in the unsaturated zone. The upstream study areas, which are characterized by an altitude above 350 m a.s.l [40], constitute the beginning of the recharge chain.

The second group represents the majority of samples, situated close to the LMWL and GMWL. These waters come from rapid meteoric water infiltration without any modification of their content isotopic. The values of δ2H and δ18O on the intersection were the recharge (initial) isotope values from precipitation to the groundwater [41].

The plot of Cl versus δ18O is utilized to identify the dominant mechanism controlling groundwater salinization (Fig. 9b). From the plot of Cl vs δ18O, some number of groundwater showed fairly constant δ18O with increased chloride concentration. This suggests that dissolution of minerals is significant in this area. Furthermore, the analysis of the Cl vs δ18O relationship (Fig. 9b) shows that the most groundwater samples recorded low chloride concentration with high δ18O values. This may suggest that such groundwaters are likely recharged by an enriched source or maybe interacting with some surface water with low chloride and enriched δ18O.

On this basis, three distinct trends can be observed which reflects the impacts of the mixing process and evaporation on the isotopes and salinity of groundwater (Fig. 9b).

As shown in Fig. 9b, the increase in the values of δ18O is greater than that of the concentration of Cl, indicating a recharge of groundwater (i.e. irrigation water, river water or precipitation) with a low Cl the concentration contributes to the enrichment of isotopic values as like in samples El 3 and El 4.

The increase of the δ18O values along with Cl concentrations enrichment could be a result of evaporation (either during recharge, from shallow water levels, or seepage of sewage from the village of Meskala due to the absence of sanitation channels) as like in sample EL7, as the evaporation process enriches both δ18O values and Cl concentrations [42]. The δ18O values of groundwater are enriched by surface water recharge (Wadi Igrounzar), while the variation of Cl concentrations depends on the salinity of the infiltration water that is ultimately attached to the water table. Infiltration water salinity is derived from both the surface water and the soil along the paths [43, 44]. Furthermore, independently of the isotopic exchange, high concentrations of Cl with low values of δ18O are associated with the processes of salt accumulation inside the aquifer (mineral dissolution and transpiration) as in samples El 16 and El 17.

6 Conclusion

The socio-economic development in the Essaouira basin depends heavily on groundwater resource; thus, the hydrochemical and isotopic studies made in this article aim to assess the process of salinization and recharge of the Plio-quaternary aquifer and Cenomano-Turonian aquifer given its strategic importance in the study area. Regarding hydrochemistry, with the observed increases in salinity, the chemical composition of groundwater at a given sampling point did not improve. Furthermore, groundwater is mineralized, since EC values are between 1495 μS/cm for 1995 to 2449 μS/cm for 2019, explained by the decrease in the precipitation due to climate change and overexploitation. The main phenomenon controlling the salinity of the groundwater seems to be the dissolution of evaporites (halite, gypsum and anhydrite) in the study area of Meskala–Ouazzi sub-basin. The results obtained in the isotopic study showed that the groundwater of the Cenemano-Turonian and Plio-Quaternary aquifer comes from precipitation. According to the reports on deuterium and oxygen-18, water quickly enters the aquifer without major change in the relative abundances of these two elements due to the phenomenon of evaporation, except for a few samples which are located in the recharge zone. The combination of chemical and isotopic parameters, in particular Cl and δ18O, supports the hydrochemical approach's results by confirming that the dissolution process is one of the key phenomena leading to groundwater mineralization in the study area. Knowledge of sources of groundwater recharge is essential for the protection and management of global aquifer systems, especially in regions where rainfall is likely to be significantly affected by climate change.