Introduction

Groundwater is crucial in sustaining human livelihoods, supporting agricultural activities, and preserving ecosystems (Derdour et al., 2023a, 2023b, 2023c; Valdes-Abellan et al., 2020). The biggest advantage is its reliability, unlike unreliable water sources that are susceptible to seasonal changes and pollution (Alcalá et al., 2018). Groundwater plays a pivotal position in maintaining communities, economies, and ecosystems especially in periods in which other water sources (i.e., precipitation) are scarce (Alcalá et al., 2018; Eamus & Froend, 2006; Eekhout et al., 2018)). However, aquifer over-exploitation and inadequate management have led to groundwater depletion and quality deterioration, highlighting the pressing need for effective regulation and monitoring (Chang et al., 2017; Pokhrel et al., 2016; Priyan, 2021). This issue is especially relevant in dry regions with limited surface water availability (Batarseh et al., 2021; Eekhout et al., 2018, 2024). Groundwater is a common source to irrigate crops and to maintain agricultural productivity among other uses (Pokhrel et al., 2016; Pardo et al., 2020). Nevertheless, persistent and excessive withdrawal of groundwater can generate multitude of challenges. One major concern is the increase in saltiness (salinization) of groundwater caused by salt deposits when water evaporates from irrigated soil (Pulido-Bosch et al., 2018). In particular, salinization can reduce soil productivity and limit correct crop development (Bailey & Hosseini, 2023; Park et al., 2023). Therefore, effective groundwater management requires limiting extraction, monitoring water levels and quality, and promoting efficient irrigation methods (Jódar-Abellán et al., 2017; Alcalá et al., 2021).

Assessing groundwater quality in arid areas/zones is important for sustainable agriculture and water management (Rupérez-Moreno et al., 2017). Several studies have proposed water quality indices (WQIs) to evaluate the suitability, in terms of contamination, of different water sources to be used in agriculture. Artificial neural networks (ANN) along with multiple linear regression (MLR) models have been proposed to predict the irrigation water quality index (IWQI) with great accuracy (M'nassri et al., 2022). In addition, GIS zoning maps show how IWQI is distributed, helping decision-makers manage groundwater sustainably (Batarseh et al., 2021). Inverse distance-weighted techniques combined with GIS have been employed to categorize the quality of irrigation water into distinct classes, offering a precise evaluation of its suitability for agricultural purposes (El Behairy et al., 2021). Recent research has shown that principal component analysis (PCA) is effective in identifying important water quality parameters for managing water quality in specific areas (Muniz et al., 2020). Furthermore, hydrochemical analysis has been used to evaluate groundwater suitability for irrigation, by identifying contaminants and salinity problems (Kumari & Rai, 2020). Studies have revealed that groundwater in arid zones is not suitable for farming, highlighting the need for effective water management strategies (Gaagai et al., 2023; Moussaoui et al., 2023; Reghais et al., 2023). Excessive groundwater use has increased soil salinity and harmed agricultural productivity (Abdessamed et al., 2023; Asadollah et al., 2024). For instance, recent studies in Tunisia have applied hydrogeochemical and statistical methods to assess groundwater salinization processes (Dhaoui et al., 2021, 2024, 2023a2023b). Their findings highlight the predominance of sodium chloride and sulfate in groundwater, attributing salinization to the dissolution of Triassic evaporites and other geological factors (Dhaoui et al., 2024). Similarly, Gonçalves et al. (2021) conducted a study in Cape Verde, assessing the impact of agricultural intensification on groundwater quality. They observed varying mineralization levels, nitrates and nitrites, indicative of diffuse pollution patterns influenced by irrigation practices (Gonçalves et al., 2021).

In Algeria and neighboring dry areas, various methods and measurements have been used to study and predict surface and groundwater quality for irrigation watering including the assessment of IWQIs, ANN, support vector machines (SVM), and statistical analysis (Belkhiri & Krakauer, 2023; Fartas et al., 2022; Gaagai et al., 2023; Kouadri et al., 2021). However, scientific studies on the presaharian zone of the Ksour Mountains, part of the Saharan Atlas, remain limited even when their groundwater sources are undergoing profound transformations (Morsli & Habi, 2016). Hence, in this agro-pastoral area where agriculture has been practiced for millennia in the Ksour perimeters (oases), inadequate practices threaten the main economic activity, agro-pastoralism (Morsli & Habi, 2016). Similarly, the agricultural region of Dzira, evaluated in the present study, which is located near the dunes of Ain Sefra in Algeria, faces sustainability threats due to overuse of groundwater, resulting in higher salinity levels that harm soil fertility and agriculture (Derdour et al., 2023c). Thus, in the present study, these relevant issues have been addressed by evaluating irrigation water quality in the region building upon previous research (Bahri & Saibi, 2012; Derdour, Abdo, et al., 2023b; Moussaoui et al., 2023). In particular, the present study’s objectives were to assess groundwater’s suitability for irrigation in the study area, employing various water quality indices such as SAR, NA%, Kelly’s ratio, and PI. Additionally, the study aimed to elucidate hydrogeochemical processes and patterns through the application of multivariate statistical methods, including PCA and HCA, thereby enhancing the understanding of groundwater dynamics and chemistry in the region. Finally, an irrigation water quality index (IWQI) was calculated obtaining the appropriateness of groundwater for irrigation. Our step-by-step approach aims to assess groundwater quality and its suitability for sustainable agriculture in the Dzira area. By thoroughly assessing water quality and its impact on agricultural soil, our research provides critical insights into the agricultural environments crucial to the Ain Sefra region. Therefore, the main outcomes of our study have the potential to influence the decisions of policymakers, urban planners, and government entities. By adhering to international standards set by the FAO and providing a region-specific IWQI, our research could serve as a guide for implementing water resource management strategies and promoting sustainable agricultural practices in Dzira and similar arid regions.

Study area

The study area of the present study, the Dzira region, is a traditional agricultural landscape of paramount significance near the dunes of Ain Sefra. This area is well-known for its diverse farming practices that support food self-sufficiency and provide income for the local community (Bouarfa et al., 2022). Geographically, the study zone spans latitudinal coordinates of 0°34′46.56″ and 0°37′39.29″W, and longitudinal coordinates of 32°42′47.52″ and 32°44′57.12″N, encompassing a 12.8 km stretch from north to south and covering an area of 2.88 km2 (Fig. 1). This territory forms part of the Ain Sefra watershed, sourced by Wadi Breidj (Rahmani et al., 2017). The region has a semi-arid climate with hot, dry summers and occasional cool to very cold winters with scarce rainfall amounts (Derdour et al., 2022). Because of its high elevation and steep slopes, the region is prone to flash floods, even with minimal rainfall, causing substantial damage (Derdour et al., 2022). Agriculture is practiced on alluvial deposits along the riverbanks. Traditional irrigation system, characterized by collective management, was abandoned in the 1970s in favor of the gradual adoption of individual motor pumps (Morsli & Habi, 2016). The traditional system involved capturing runoff water from the river via “Seds” along the river and distributing it through the “Seguia” to the plots. The “Sed” is a water storage structure upstream of a small dam, typically made of earth, transverse or lateral across a water course. It is repaired or entirely reconstructed after each significant flood by the “Touiza,” a collective labor organization (Morsli & Habi, 2016). Groundwater serves as the primary irrigation source for the traditional farming community, supplemented by surface resources of the Wadi Breidj during heavy rainfall periods (Rahmani et al., 2017). However, recurring droughts in recent years have strained water resources, affecting agricultural productivity and sustainability, causing innovative solutions to secure the area’s agricultural heritage amidst mounting challenges (Yousfi et al., 2014). The watershed has three different aquifer systems for groundwater: the Jurassic sandstone aquifer, the lower Cretaceous sandstone aquifer, and the quaternary aquifer. Groundwater in the area is accessed through wells, boreholes, and springs (Derdour et al., 2022). The study area is part of the Plio-Quaternary alluvial aquifer, also known as the “Plio-Quaternary Fill.” This aquifer represents the filling of depressions in the hydrogeological basin with Plio-Quaternary sandstones, red clay, a tertiary limestone cap, and Quaternary alluvium and colluvium (Yousfi et al., 2014). Several wells tap it, particularly in the Ain Sefra sub-basin, where its thickness exceeds 50 m. It communicates with the Continental Intercalary aquifer (Yousfi et al., 2014). The study by Moussaoui et al. (2024) showed that the alluvial terraces in the riverbeds of the Ain Sefra region primarily comprise clays, pebbles, gravels, and sands. These relatively thin formations serve as minor aquifers, exploited by many wells for land development purposes. Wells tapping into these shallow aquifers typically produce low-to-moderate flow rates. In March 2017, observers noticed a significant decline in the water level of traditional wells within the agricultural perimeter of Dzira (Ain Sefra), next to the Oued Breidj. They attributed this decline to the increased presence of new boreholes. The dunes of Ain Sefra, located to the south of the agricultural perimeter of Dzira (Fig. 1), also function as an aquifer where some perennial springs appear, especially along the city’s periphery (spring of the dune). Following heavy rains, multiple springs commonly emerge in the dunes.

Fig. 1
figure 1

Study area: the Dzira region (Algeria)

Material and methods

Samples collection and laboratory processing

In the autumn of 2022, 38 groundwater samples were collected and analyzed from various boreholes and wells in the study area. To evaluate water quality for irrigation, pre-cleaned polyethylene bottles were used. The precise coordinates of each sampling point were recorded using a Global Positioning System (GPS). Likewise, water samples were quickly taken to the lab and kept them at approximately − 4 °C to preserve their condition. The Laboratory for the Sustainable Management of Natural Resources in Arid and Semi-arid Zones in Naama analyzed the samples following the methods described in the manual for Soil and Plant Analysis Laboratories by the International Center for Agricultural Research in the Dry Areas (ICARDA) (George et al., 2013). Thus, flame photometry (PFP7/C Clinical Flame Photometer-Jenway) was used to determine the potassium and sodium levels in the water samples. Calcium and magnesium ions were also examined because they affect water hardness. The disparity between the total hardness and the concentration of Ca2+ facilitated the computation of magnesium concentration. Both measurements were conducted by titration using an EDTA-disodium salt solution along with indicators like Murexide and Eriochrome Black (Lucchesi & Hirn, 1958). Similarly, to quantify carbonates (CO3) and bicarbonates (HCO3) in the water samples, a titration method was employed (Anderson & Yang, 1992). In particular, we subjected a known volume of water to a reaction with standard H2SO4 using phenolphthalein and methyl orange indicators for the respective analyses. The determination of chloride ions (Cl-) was achieved through the AgNO3 method, commonly known as Mohr’s titration, which capitalizes on the interaction between Cl- and chromate (Cr) in a solution. Meanwhile, the concentration of sulfate ions in the water was determined by precipitating in a hydrochloric medium as barium sulfate. The precipitate obtained was stabilized using a solution of Tween 20 or (650 ny) polyvinylpyrrolidone, and the homogeneous suspensions were measured with a UV–Vis Spectrophotometer Model SpectroScan 40. This detailed water analysis method helps assess the chemical elements in groundwater samples, providing useful information about water quality and suitability for irrigation in the research area (Saadatpour et al., 2022). The ion-balance error was calculated to verify the electroneutrality of the samples. Based on this data, 37 out of the 38 samples collected were selected for statistical analysis (1 sample was rejected as it presented an ion-balance error above ± 10%).

Methods for evaluating groundwater quality data

Agrohydrology requires assessing groundwater suitability for irrigation using different groundwater indices which help to optimize irrigation strategies by measuring different aspects of water quality allowing to know water’s chemical properties and their impact on soil and crops (Saeedi et al., 2010). Key indices considered in this study were sodium percentage (Na%), sodium adsorption ratio (SAR), magnesium hazard (MH), permeability index (PI), potential salinity (PS), and Kelly’s ratio (KR). These indices were calculated using precise formulas that consider the concentrations of ions in water, providing a scientific basis for assessing irrigation water quality (Panneerselvam et al., 2021). At the core of this research lies the principled application of fundamental formulas, each governing the computation of the aforementioned indices. These equations, firmly grounded in scientific rigor, provide the means by which Na%, SAR, PI, MH, PS, and KR values are calculated, with all ion measurements expressed in meq/l (Selmane et al., 2023). The consolidation of these equations bears significant ramifications, enabling a nuanced assessment of water quality characteristics while illuminating potential repercussions for soil structure, permeability, and salinity levels (Cui et al., 2021). The following equations, spanning from 1 to 4 in Table 1, were used to derive the parameters relevant to irrigation.

Table 1 The suitability indices for evaluating irrigation water quality

Evaluation of irrigation water quality

Factors such as crop patterns, soil types, and climate conditions determine the varied suitability of irrigation water (Derdour et al., 2023a). In this work, to evaluate its appropriateness, the IWQI (Meireles et al., (2010) was used. This well-established index has been employed in numerous studies over the globe (Ahmed et al., 2021; Batarseh et al., 2021; Ghazaryan et al., 2020; Ghosh & Bera, 2023; Hussein et al., 2024; Mukate et al., 2019; Thapa et al., 2020; Q. Zhang et al., 2021) experiencing also important modifications and improvements, regarding the original expression suggested by Meireles et al. (2010), which validated its applicability and reliability (Hussein et al., 2024; Zhang et al., 2021). Incorporating parameters like EC, SAR, chloride ion concentration (Cl −), bicarbonate ion concentration (HCO3 −), and sodium ion concentration (% Na), as described by Batarseh et al. (2021), our analysis was conducted in two phases. Initially, it was imperative to find out the most pertinent irrigation parameters. Following that, weights for aggregate (wi) and values for quality measurement (qi) were established. Thus, the irrigation water quality criteria for agricultural uses, approved by the Food and Agriculture Organization (FAO) and outlined by Ayers and Westcot (1994), were used to calculate the values of qi for each chemical parameter, as detailed in Table 2. Equation (6) was used to compute the irrigation water quality parameter (qi), which is defined according to the tolerance limits specified for the parameters outlined in the study.

$${q}_{\text{i}}={q}_{\text{max}}-\left(\frac{\left({x}_{\text{ij}}-{x}_{\text{inf}}\right)\times {q}_{\text{imap}}}{{x}_{\text{amp}}}\right)$$
(6)

where \({q}_{\text{max}}\) denotes the maximum value inside the respective class of qi; \({x}_{\text{ij}}\) indicates the observed values of each parameter, which are the data points; \({x}_{\text{inf}}\) denotes the minimum class value to which the observed parameter belongs; \({q}_{\text{imap}}\) denotes the class amplitude for qi classes; and \({x}_{\text{amp}}\) represents the amplitude of the category to which the parameter fits (Thapa et al., 2020). Likewise, Eq. (7) presents the computation of the irrigation water quality index (IWQI):

$$\text{IWQI}=\sum_{1}^{n}{q}_{\text{i}}{w}_{\text{i}}$$
(7)

where \(\text{IWQI}\) represents the irrigation water quality index, \({q}_{\text{i}}\) signifies the quality measurement values calculated using Eq. (6), and \({w}_{\text{i}}\) denotes the aggregation weights associated with each parameter (depicted in Table 2).

Table 2 Weights of the IWQI parameters

Hydrogeochemistry characterization, statistical methods, and GIS assessment

In this study, hydrogeochemical characterization was conducted using the Piper method (Piper, 1944) and the renowned Gibbs diagrams proposed by Gibbs (1970) in order to visualize water chemistry and understand the geochemical processes affecting water quality. This approach enhances the analysis by offering insights into water types and the mechanisms governing their chemistry (Abdessamed et al., 2023).

Through the R software, multivariate statistical methods including principal component analysis (PCA; Hotelling (1933), hierarchical cluster analysis (HCA; da Silva Torres et al., 2006), and correlation matrix analysis, following the principles of Pearson (1900), were conducted, respectively, to reduce the dimensionality of the dataset underlying patterns within the collected data along with simplifying complex datasets for better understanding and decision-making, to group comparable data points (clusters) based on their features, and to identify potential cause-and-effect connections or dependencies (Ahmed et al., 2021; Machiwal et al., 2018; Reghais et al., 2023).

In order to better understand the spatial distribution of water quality levels in the Dzira area, Geographic Information System (GIS) zoning maps were developed. These maps are important for understanding the spatial distribution patterns of key indices like the irrigation water quality index (IWQI) and parameters such as electrical conductivity (EC), sodium adsorption ratio (SAR), sodium percentage (Na%), permeability index (PI), and bicarbonate ion concentration (HCO3). The construction of these zoning maps was executed through the utilization of the inverse distance weighting (IDW) technique (Shepard, 1968) within the ArcGIS environment (ArcGIS, 2021). In particular, 11 interpolation methods, such as the global polynomial interpolation, radial basis function, universal kriging, and diffusion kernel (Cui et al., 2021; Selmane et al., 2023), were tested at the Ksour Mountains region. Finally, the IDW method was chosen as it reached the best results (Abdessamed et al., 2023). The IDW approach estimated water quality values where direct monitoring was not possible, using existing data points as a reference (Pardo et al., 2020; Naimaee et al., 2024).

This comprehensive approach integrates various indices, statistical methods, and GIS hydrogeochemical characterizations, offering a robust framework for assessing and managing irrigation water quality (Derdour et al., 2023a, 2023b, 2023c; Machiwal et al., 2018; Wani et al., 2024), ensuring the sustainability of agricultural practices in the face of environmental and hydrological challenges.

Results

Essential water quality indicators for irrigation were evaluated in the arid agricultural region of Dzira, in the Ain Sefra Wilaya of Naama. Monitored parameters alongside the main descriptive statistics and the FAO standards are shown in Table 3.

Table 3 Chemical parameter results in the groundwater of the Dzira region

TDS levels in the region ranged from 208.50 to 1856.50 mg/l, with a mean value of 635.16 mg/l (Table 3). Most wells fell within the FAO standards range of 600–1000 mg/l. It is noteworthy that 10.81% of wells exceeded these limits, showing elevated mineral content in some areas. All wells’ pH levels were within the permissible range of 6.5 to 8.5, suggesting suitable groundwater pH for irrigation. EC values showed significant variation, with a mean of 1270.32 µS/cm and 67.57% of wells exceeding the FAO standard of 1000 µS/cm. Elevated EC values indicate an increase of salinity, potentially affecting soil quality and plant growth (Cui et al., 2021). Major ions including HCO3, Cl, SO4, Na+, K+, Ca2+, and Mg2+ levels were measured (Table 3). Several wells showed ion concentrations surpassing FAO standards, particularly Mg2+ and SO4, which exceeded standards in 43.24% and 64.86% of wells, respectively. These findings indicate elevated mineral content in the groundwater. Therefore, our results underscore the necessity for a comprehensive evaluation of water quality in irrigation planning for the Dzira region. Elevated concentrations of ions, EC, and TDS can profoundly impact crop health, productivity, and soil properties.

Suitability indices for irrigation results

Table 4 displays the results for the suitability indices for irrigation, including SAR, Na%, PI, and Kelly’s ratio.

Table 4 Classification of groundwater for irrigation based on physicochemical and statistical parameters

Sodium adsorption ratio (SAR)

Evaluating groundwater suitability for irrigation depends on analyzing SAR values. High SAR values show a higher concentration of sodium compared with magnesium and calcium ions in the groundwater (Suarez, 1981). High sodium levels can cause negative effects on soil structure, making it less permeable (Todd & Mays, 2004). According to accepted standards, the SAR values in Table 4 ranged from a minimum of 0.61 to a maximum of 5.06. Noting that SAR values can be classified as excellent/no sodium hazard when SAR < 10, 10 ≤ SAR ≤ 18 signifies good/low sodium hazard, 18 < SAR ≤ 26 implies fair/doubtful/harmful, and SAR > 26 represents poor/unsuitable conditions, all the wells in the study area were categorized as “good/low sodium hazard,” indicating that the water’s sodium levels are suitable for irrigation and have a low risk of causing sodicity in the soil. It is noteworthy that, as detailed in Table 4 of this study, SAR values consistently remain below the critical threshold of 10 (meq/l). The observation shows that the study area had low sodium levels in the groundwater, which is good for the soil. The study found that the groundwater in the area had beneficial sodium levels, making it suitable for irrigation. The importance of SAR assessment in evaluating irrigation suitability. Using the United States Salinity Laboratory (USSL) diagram proposed by Richards (1954), 78% of the sampled groundwater falls within the C3S1 zones (Fig. 2).

Fig. 2
figure 2

Classification of the groundwater using the USSL diagram in the agricultural region of Dzira

Sodium percentage (Na%)

Under established standards (Wilcox (1955), Na% values can be classified into five classes of water ranging from excellent to unsuitable for irrigation (Table 4). Most wells (78%) had sodium levels (ranging from 15.38 to 68.08) within the “good/safe” category, showing safe levels for irrigation. Nonetheless, a subset of wells (16%) were in the “permissible/safe” range (40 < Na% < 60), showing a slightly higher sodium content. More sodium ions in irrigation water can displace soil-bound sodium with calcium and magnesium, leading to less permeable soil (Hadef et al., 2021; Han et al., 2020). Analytical data plotted on the Wilcox (1955) diagram, which relates EC and Na% (Fig. 3), reveals that a significant proportion of the water samples, i.e., 97.30%, fall within the categories of excellent, good, or permissible for irrigation, i.e., 8.11%, 72.97%, and 16.22%, respectively. Only 2.70% of wells were in the doubtful category for irrigation (Fig. 3). Overall, the groundwater in the Dzira agricultural area is suitable for irrigation.

Fig. 3
figure 3

Classification of the Dzira groundwater using the Wilcox diagram

Permeability index (PI)

Under established standards (Table 4), according to Doneen (1964), PI values can be classified as follows: unsuitable (PI < 25), good (25 ≤ PI ≤ 75), and suitable (PI > 75). The groundwater in the study area has PI values ranging from 25.32 to 70.03. Most of the water samples are classified as “good” for irrigation, but a few are considered “unsuitable.” Permeability index (PI) is a critical parameter in evaluating groundwater suitability for irrigation (Das & Nag, 2015; Doneen, 1964), introducing a method that rates irrigation waters based on the permeability index and total concentration (Fig. 4). According to the permeability index diagram, all water samples in our study area fall under the “Class II” category, suggesting that the groundwater is suitable for irrigation.

Fig. 4
figure 4

Permeability index PI diagram

Kelly’s ratio (KR)

Kelly’s ratio values provide insights into the risks of irrigation water on soil and agriculture. Our assessment shows that KR values range from 0.16 to 1.43, showing a low risk of salinity and sodicity problems. This gives reassurance for irrigation practices in the study area. The groundwater in the Dzira agricultural region has a good composition, with low sodium and salinity levels. This reduces the risk of soil problems like clogging and reduced permeability. Lower KR values are good, but we need more information about the soil, crops, and irrigation methods for an accurate evaluation. Local factors affect KR values, and interpretation may vary based on site conditions. The predominance of lower KR values in our results is encouraging, implying that the groundwater in the Dzira region is suitable for irrigation without major salinity and sodicity issues. Nonetheless, a holistic assessment, considering local factors, is imperative for making informed decisions regarding irrigation practices to maximize agricultural sustainability in this area.

Magnesium hazard (MH)

In this study, the assessment of the magnesium hazard (MH) index revealed that 62.16% of the wells were suitable for irrigation, while 37.84% were unsuitable. The MH values ranged from a minimum of 21.96% to a maximum of 81.58%, with an average of 49.10%. These findings show that while most wells had acceptable magnesium levels for irrigation, a significant portion exceeds safe limits, potentially impacting soil structure and crop health.

IWQI results

Our work uses a classification system that is built upon preexisting water quality indicators. The system categorizes based on dangers like soil salinity, reduced water infiltration, and plant toxicity. This classification method was originally proposed by Meireles et al. (2010). Table 5 classifies groundwater suitability for irrigation in the Dzira agricultural zone. Around 35.14% of tested wells can be used for irrigation with no groundwater use restrictions, regardless of soil type, and with low risk of soil salinity and sodicity issues. A substantial portion, roughly 54.04%, of the investigated wells falls into the “low restriction” category. The groundwater is good for use on sandy soils with good permeability, but care should be taken while using it on salt-sensitive soils. It is worth noting that 8.11% of the wells analyzed had limited suitability for irrigation. Groundwater extracted from these wells should be used carefully with due consideration to leaching, in areas where soils display moderate salt tolerance and moderate to high permeability. A smaller fraction, around 2.70%, falls into the “high restriction” category. Groundwater use from these wells should only be allowed in permeable soils with no compact layers and when irrigation is done frequently. This is especially important when the irrigation water has high EC above 2000 µS/cm and a SAR greater than 7. The IWQI values ranged from 45.36 to 96.30, with an average of 80.77. These values align well with the classification categories discussed earlier, further affirming the suitability of groundwater for irrigation in most of the wells. The predominance of the “no restriction” and “low restriction” categories underscores the favorable groundwater quality in the study area, supporting its suitability for sustainable agricultural practices. However, some wells in the “moderate restriction” and “high restriction” categories emphasize the need for targeted irrigation management strategies in specific areas to mitigate potential challenges associated with soil salinity and sodicity.

Table 5 Assessment of groundwater quality at investigated sites using IQWI classification

Hydrochemical facies

The Piper diagram (Piper, 1944) was chosen for its well-established and widely used status, allowing for a clear and concise visual representation of water chemistry and comprehensive classification of dominant ions, whereas the HFE-D method, while valuable for temporal analysis and quantitative understanding, was not deemed as suited to the specific goals of this study (Giménez‐Forcada, 2010; Glynn & Plummer, 2005; Mirzavand & Ghazban, 2022; Piper, 1953; Wani et al., 2024). This diagram reveals three different hydrogeochemical facies based on the abundance of certain chemical elements (Fig. 5): (i) Facies I is primarily characterized by the co-occurrence of Ca2+, Mg2+, Cl, and SO4−2 ions. This facies characterizes most groundwater (83.78% of samples), with a predominance of calcium and magnesium ions, demonstrating their importance in determining groundwater characteristics; (ii) Facies II is characterized by Na+, K+, Cl, and SO42− ions, accounting for 10.81% of groundwater samples. These facies have a significant amount of sodium, which could affect soil and water quality; (iii) Facies III is primarily composed of Ca2+, Mg2+, and HCO3 ions, constituting 5.40% of samples. These facies, with their distinctive ion composition, add further complexity to the groundwater hydrochemistry. Upon closer examination of the cation triangle (Fig. 5), a striking observation emerges. Most samples are found in zones A, B, and D. 5.40% show characteristics of the magnesian type, 10.81% resemble the sodium type, and a significant 81.08% display characteristics of a mixed type. This distribution emphasizes the evolving characteristics of groundwater chemistry within the research area, where mixed-type water emerges as the prevailing type. Regarding anions, nearly two-thirds of the groundwater samples (67.57%) are plotted within zone E, signifying the predominance of sulfate-type water (Park et al., 2023). This finding highlights how sulfate ions affect the chemical composition and quality of groundwater. The analysis of hydrochemical characteristics agrees with previous approaches (Derdour et al., 2022; Rahmani et al., 2017), which have also identified a predominance of calcium-sulfate to magnesian and sodium-chloride to calcium facies in the Ain Sefra watershed area. Additionally, the prevalence of sulfate and chloride ions further emphasizes the consistency of these findings, reaffirming the regional hydrochemistry’s unique signature. This hydrogeochemical characterization is of paramount importance as it provides valuable insights into the groundwater’s composition, which, in turn, informs its suitability for various applications, including agricultural irrigation, in the study area.

Fig. 5
figure 5

Hydrochemical facies classification of groundwater samples in the Dzira area using Piper diagram

Hydrochemical mechanism

In order to assess groundwater quality, we need to understand how hydrochemical mechanisms impact its chemical makeup. To unravel these mechanisms, the renowned Gibbs diagrams (Fig. 6), proposed by Gibbs (1970), offer invaluable insights. These diagrams comprise two sub-diagrams: one depicting the interplay between TDS and the weight ratio of Na+ to (Na+  + Ca2+), while the other explains the relationship between TDS and the weight ratio of Cl to (Cl + HCO3). Groundwater formation mechanisms can be classified into three types: rock dominance, evaporation dominance, and precipitation dominance (Adimalla et al., 2018; Marandi & Shand, 2018; Reghais et al., 2023). These mechanisms shape the hydrochemistry of the study area and provide insights into the origins of its groundwater. The Gibbs diagram analysis reveals intriguing findings, showing rock dominance as a predominant influence, accounting for a substantial 56.75%. This phenomenon underscores the pivotal role of geological factors in shaping the groundwater’s chemical composition, highlighting the intricate interplay between water and rock formations. Evaporation and crystallization dominance play a significant role in groundwater formation, accounting for 40.54%, and greatly impact the chemical composition of groundwater. Additionally, a large portion of the samples falls within the intermediate range of these mechanisms. This finding signifies soluble minerals and salts in the sedimentary layers, primarily originating from the weathering of the underlying rock formations. Gypsum dissolution is an important factor, regardless of the different rock compositions (Rahmani et al., 2017). The profound implications of these hydrochemical mechanisms extend beyond mere academic interest. They are very important for practical uses, like managing water resources, conserving the environment, and practicing agriculture in the study area. By shedding light on the origins of groundwater chemistry, this analysis empowers stakeholders and decision-makers with the knowledge needed to make informed choices regarding water utilization and management, ultimately contributing to sustainable development in the region.

Fig. 6
figure 6

Gibbs diagram showing the ratio of TDS vs Na + /(Na +  + Ca2 +) and Cl − /(Cl −  + HCO3)

Statistical analysis results

Principal component analysis

PCA was used, with the R software, to uncover connections in the water hydrochemistry dataset. The PCA analysis showed that the first two components explained 69.2% of the variance in the groundwater system. The importance of the first two components lies in their ability to capture patterns and variability in the dataset (Machiwal et al., 2018; H. Zhang et al., 2023). PCA 1, boasting an eigenvalue of 2.35, took the lead by elucidating a substantial portion of the total variance, specifically 54.5%. Following closely, PCA 2, with an eigenvalue of 1.21, contributed to explain 14.7% of the variance. Additionally, PCA 3 and PCA 4 made notable contributions, with eigenvalues of 1.04 and 0.90, respectively, accounting for 10.76% and 8.05% of the total variation. The principal components help us understand how different variables affect water hydrochemistry (Reghais et al., 2023). Figure 7 shows the projections of individuals onto the (PCA1-PCA2) plane, revealing two distinct groups. Group G1 prominently featured variables such as EC, TDS, Mg, Na, Ca, and Cl, exerting substantial influence primarily on factor 1. Conversely, group G2 was characterized by higher levels of HCO3 and K. This demarcation offers valuable insights into the driving factors behind water hydro chemistry in the region, providing a comprehensive view of the multifaceted nature of the dataset.

Fig. 7
figure 7

Principal component analysis (PCA) projection of the variables and individuals on the PC1PC2 plan

Hierarchical cluster analysis (HCA)

HCA is a reliable method to group samples based on their chemical composition, without the need to know the number of clusters in advance (Zhang et al., 2023). Two approaches were employed: R-mode HCA, analyzing 10 hydrochemical variables (EC, Ca2+, Mg2+, Na+, K+, Cl, SO42−, HCO3, pH, and TDS), and Q-mode HCA, applied to 37 groundwater samples. The assessment used Ward’s technique as the linking function for hydrogeochemical data classification and Euclidean distance as a measure of sample dissimilarity. According to the dendrogram classification, two primary groups (G1, G2) were identified at a linking distance of 21, as shown in Fig. 8. Group 1, consisting of two clusters, includes wells characterized by SO4 and TDS, representing 40.54% of the total wells. This group indicates rapid evaporite dissolution due to geological structures, particularly the saline diapiric formations of the Triassic period (Lachache et al., 2023). Cluster 2, which encompasses HCO3, Cl, Ca, Na, pH, K, and Mg, accounted for 42.24% of the wells. This group suggests the influence of geological structures, notably the contact zones between the Continental Intercalary sandstone formations and the Triassic’s clay-gypsum-saline diapiric structures. The presence of calcium and sodium in this group aligns with the geological influence exerted by these formations. The second group, represented by EC, comprised 16.22% of the wells and had high salinity levels over 1960 µS/cm, showing the dissolution of Triassic formations (Fig. 8). These findings highlight how geological factors affect water chemistry in the Dzira region. PCA and HCA are important in understanding the complex hydrogeochemical dynamics in the area. This has significant implications for managing water resources and protecting the environment. The findings from PCA and HCA represent more than just data analysis; they serve as tangible evidence of the rich aquifer diversity within the Dzira region. These diverse aquifers have important implications for managing water resources and preserving the environment. The study will provide important information about the water in this region, which will help protect it for future use.

Fig. 8
figure 8

Dendrograms: A cluster analysis of samples and B cluster analysis of variables

Correlation matrix analysis

Table 6 displays the correlation matrix, which reveals the relationships between parameters in groundwater quality analysis. EC shows a strong positive correlation with most parameters, except for HCO3-. This suggests that areas with elevated levels of dissolved ions may compromise water quality. Groundwater can have varying levels of total dissolved solids (TDS), and some samples go beyond acceptable limits. TDS shows strong positive correlations with several parameters, including Ca2+, Mg2+, Na+, Cl, SO42−, and TH, suggesting that TDS levels are influenced by these ions. Mg2+ and Ca2+ concentrations in groundwater vary widely, with 43% of wells exceeding acceptable Mg2+ limits. A positive correlation between Mg2+ and Ca2+ shows their co-occurrence, possibly because of geological or hydrochemical factors. In contrast, evaporated elements (Na+, K+, Cl) have low concentrations, while SO42− is detected at elevated levels in a significant portion of samples, showing potential sulfate contamination sources. Bicarbonate concentrations vary and strongly correlate with Na + levels, indicating a significant association between these components that is likely caused by specific hydrochemical processes. The correlation matrix and extra information show specific areas with high ion levels that could affect water quality. Understanding these relationships is crucial for ensuring the safety and suitability of groundwater for various uses.

Table 6 Correlation matrix of the analyzed parameters

Spatial interpolation using GIS

The interest in generating these maps lies in the critical role that water quality plays in agricultural practices. Understanding the distribution of suitability indices can help improve irrigation practices and promote sustainable agriculture in the area. These zoning maps help land managers, policymakers, and farmers make informed decisions and promote efficient irrigation practices (Cui et al., 2021). Creating maps is crucial for achieving agricultural sustainability and resource management goals in this context. The SAR zoning map (Fig. 9A) delineates a conspicuous aggregation of SAR values below 10, signifying a highly favorable sodium hazard condition in the water. Most of the SAR values falling within the excellent and good categories are concentrated in the central and northern parts of the study area. SAR values below 10 show low sodium levels, making the water suitable for agricultural irrigation without harming the soil. Additionally, sodium percentage (Na%) analysis corroborates these SAR findings, revealing that approximately 97.30% of the analyzed samples exhibit sodium content within the excellent and good range (Fig. 9B). The sample location matches the concentrations observed in SAR, particularly in the central and northern study areas. This confirms that there is optimal sodium content for irrigation, which minimizes negative effects on soil structure and crop yields. The PI zoning map (Fig. 9C) demonstrates a significant concentration of PI ranging from 25 to 70%, particularly in the central and northern parts of the study area. The optimal range of PI values shows that water helps soil without negative effects, making this water suitable for agriculture in central and northern regions. The balance of ions in the soil is important for water movement and soil structure, making it suitable for agriculture in these areas. The zoning map of Kelly’s ratio (Fig. 9D) reveals a substantial portion of water samples (91% of samples) that meet the criteria for suitability in agricultural applications (KR < 1). The main presence of these waters is to the north and south of the study area. This observation highlights a strong connection between favorable Kelly’s ratio values and their geographic distribution, emphasizing that the water is suitable for agriculture in these specific areas.

Fig. 9
figure 9

Spatial distribution maps (A) SAR, (B) Na%, (C) PI, and (D) KR’s ratio of Dzira area

The zoning maps show a clear pattern of distribution for EC and TDS in the study area. Notably, both the southern and northern sectors of the study area consistently show excellent and good salinity levels (ranging from 250 to 750 µS/cm), as observed in the zoning maps (Fig. 10A), where TDS values fall within the range of 209 to 605 mg/l (Fig. 10B). This alignment shows a strong connection between TDS levels and salinity, improving the accuracy of the mapping results. TDS values in this range are ideal for irrigation and other applications. These salinity levels preserve soil health and ensure water is suitable for agriculture, with no negative effects. Furthermore, the uniform distribution of these favorable TDS values, as clear from the zoning map, underscores the consistent water quality within the southern and northern regions. The equilibrium between TDS and salinity is important for effective farming and soil preservation. Ensuring acceptable magnesium hazard (MH) levels in irrigation water is essential for sustainable agriculture. Our study reveals through geospatial analysis, shown in Fig. 10C, that 62.16% of wells are suitable, yet 37.84% exceed safe limits (MH 21.96–81.58, avg. 49.10). Effective management of irrigation practices is crucial to sustain soil health and optimize crop productivity.

Fig. 10
figure 10

Spatial distribution maps (A) electrical conductivity, (B) TDS of Dzira area, and (C) magnesium hazard

The zoning map shows the integrated IWQI, which tells us about the water quality in the groundwater region (Fig. 11). Around 35.14% of the groundwater in this region shows no restrictions based on the IWQI criteria. This discovery showed a large area with good water quality that can be used for irrigation and drinking. About 54.04% falls under the low restriction category, indicating acceptable water quality for various purposes despite some limitations. Good management and careful monitoring in this area can keep the water quality high and ensure its safe use. Approximately 8.11% of the groundwater is moderately restricted and requires some caution and management. This subset underscores the need for targeted strategies to mitigate potential adverse impacts on water quality. Lastly, about 2.70% fall into the high restriction category, needing immediate attention to improve water quality. The map highlights the different values of IWQI in the groundwater area. The large proportions in the “no restriction” and “low restriction” categories show a promising situation for flexible groundwater use. However, it is essential to address the areas categorized as “moderate restriction” and “high restriction” through customized strategies to improve water quality and expand its usability throughout the region. This analysis is important for making informed decisions about using groundwater resources effectively and sustainably in the study area. Continuous monitoring and focused interventions are strongly recommended to uphold and enhance water quality for an array of applications.

Fig. 11
figure 11

Spatial distribution of the groundwater quality in the Dzira area according to IWQI values

Discussion

Using indices to evaluate groundwater quality has become invaluable for researchers and environmental scientists (Derdour et al., 2023a). These tools allow comparing and assessing groundwater quality in different geographic regions (El Behairy et al., 2021). The groundwater SAR levels were categorized as “good/low sodium risk” in the Dzira region. Following Muniz et al. (2020), this classification ensures that minimal risk to the structure of the soil is caused by salt-induced alterations. However, SAR analysis and EC in the Wadi Souf agricultural region, sharing climatic and soil characteristics with Dzira, showed poor groundwater quality for irrigation (Tigrine & Boutiba, 2023). This difference shows the importance of considering multiple factors and their interaction. Concerns about soil salinity persist, although SAR suggests good groundwater quality. Over two-thirds (67.57%) of wells in the study area had high EC levels above the recommended threshold (1000 S/cm) by the World Health Organization. These findings are consistent with the values achieved in Naama, Algeria (Abdessamed et al., 2023). According to the US Salinity Laboratory’s (USSL) diagram as proposed by Richards (1954), we observed that 78% of the samples were within the C3S1 zones. This suggests that the salinity levels varied from medium to high, and the alkalinity was low. In contrast, Batarseh et al., (2021) revealed a high predominance of samples in the highest salinity and SAR classes (C4S4) in the Emirate of Abu Dhabi. These findings contradict the results shown here. Similarly, Ahmed et al. (2021) discovered high levels of salinity and sodium concentration in the Bagerhat district of Bangladesh.

The permeability index (PI) categorizes all our research samples as suitable for agriculture. This result aligns with Batarseh et al. (2021), where 81% of their samples also fell into the first category. These findings endorse the suitability of Dzira’s groundwater for irrigation, like the situation in the Armenian province of Masis (Ghazaryan et al., 2020). On the other hand, it was determined that the quality of the groundwater in the Alappuzha district of Kerala, India, was not suitable for irrigation (Sarath Prasanth et al., 2012). With 97.30% of samples meeting the criteria for excellent, good, or permissible use, the Na percent index confirms the exceptional groundwater quality for irrigation in the Dzira agricultural area. The province of Masis in Armenia displays a similar pattern in Na% (Ghazaryan et al., 2020), which confirms that both regions are suitable for agricultural irrigation. The IWQI is an important instrument for determining whether the groundwater in particular areas is suitable for irrigation. The IWQI values in the Dzira region ranged from 45.36 to 96.30, with an average of 80.77. These values are in good alignment with before-defined classification groups and show that irrigation is appropriate. However, an interesting mosaic of results emerges when examining IWQI in different geographical settings. Only 9.64% of the samples taken in Adrar, Algeria, were deemed to be in very good condition, while 57.23% were deemed to be unfit (Derdour, Abdo, et al., 2023b). In Abu Dhabi (United Arab Emirates), just 4% of the wells fall into the category of low-to-moderate restriction, while 96% of wells fall into the category of high-to-severe restriction (Batarseh et al., 2021). IWQI values in the Ouled Chamkeh Plain, in the Mahdia area of Tunisia, range from 19.29 to 55.41, and over 40% of the samples are considered to be of acceptable quality (M'nassri et al., 2022). Moreover, 43% of the samples taken in the Chincholi Industrial Area in the state of Maharashtra in India were only fit for human consumption, while 39% are rated as good (Mukate et al., 2019). Approximately 85% of the land in Bangalore, in the Vrishabavathi River region of India, showed ideal condition for irrigation (Spandana et al., 2013). IWQI was tested in Masis, Armenia, where confined and unconfined aquifers had different groundwater quality profiles. It is important to consider regional and local differences when assessing groundwater quality for different uses, as shown in this study. The IWQI, backed by many studies, is crucial for evaluating irrigation water quality. Stakeholders and decision-makers can rely on this index for sustainable groundwater management, environmental protection, and support for farmed practices in agricultural areas as the Dzira district. Likewise, in the study performed by Dhaoui et al., (2023a, 2023b), across the Menzel Habib region (Tunisia), groundwater quality ranged from excellent suitability to unsuitable based on various indices, as the Richards diagram highlighting high SAR and EC values. The assessment was further refined using a fuzzy logic model, categorizing 36% as permissible to unsuitable and 25% as unsuitable for irrigation. This approach offered a nuanced evaluation compared to traditional methods.

However, it is crucial to acknowledge several limitations in the current assessment of groundwater quality. Firstly, the absence of nitrates analysis, attributed to the unavailability of specific chemicals in the research laboratory and restricted access to certain private agricultural plots, introduces potential gaps in understanding nutrient content and specific localized variations. It should be highlighted that in recent studies in Algeria, nitrates rates were high encompassing problems of groundwater quality (Selmane et al., 2023). Additionally, the study’s exclusive focus on the Dzira region may overlook potential heterogeneity within the area itself, and the comparison with only a few regions may not fully capture the diversity of groundwater quality dynamics. Moreover, the reliance solely on chemical indices neglects the biological and ecological aspects integral to a comprehensive evaluation. External factors such as land-use changes and pollution sources are not explicitly addressed, potentially limiting the study’s applicability to broader environmental considerations. Overall, these limitations underscore the necessity for a more comprehensive and multidimensional approach to groundwater quality assessment to support robust and nuanced decision-making. To address these limitations and enhance groundwater quality assessment in the Dzira region, we propose key recommendations for future research and practical applications. Firstly, addressing the absence of nitrates analysis is imperative, requiring resource allocation for comprehensive nutrient analyses to enrich understanding and facilitate sustainable agricultural practices (Batarseh et al., 2021; Moussaoui et al., 2023). Secondly, recognizing regional heterogeneity necessitates spatially distributed sampling with a systematic design to capture variations. Expanding comparative analysis beyond select regions and incorporating biological indicators will provide a more comprehensive understanding. Furthermore, integrating analyses of land-use changes and pollution sources is crucial for holistic assessment, emphasizing the need for interdisciplinary methodologies (Gani et al., 2023). The same, adopting a multidimensional approach is imperative, focusing on analytical constraints, spatial heterogeneity, comparative analyses, biological indicators, and assessments of land-use changes and pollution sources for sustainable groundwater management in Dzira and beyond.

Conclusion

Our extensive scientific research within Dzira’s arid agricultural region has yielded invaluable insights that bear profound implications for sustainable water resource management and agriculture in the area. By employing rigorous analysis and advanced techniques, our research has significantly deepened our understanding of groundwater dynamics. The pivotal findings, notably the favorable SAR values and the classification of wells as “good/low sodium hazard,” provide robust evidence affirming the overall suitability of groundwater for irrigation, minimizing the risk of soil sodicity. Crucially, the integrated IWQI indicated minimal threats.

Our scientific research in the Dzira region serves as a useful standard for most agricultural perimeters in Ain Safra, Algeria, and globally. The region provides crucial sources of sustenance for inhabitants of arid regions. We emphasize the necessity of conducting comprehensive studies on small agricultural regions, recognizing the critical importance of every dunum in dry and arid areas. Small-scale studies are crucial for understanding localized dynamics and implementing tailored solutions that address specific challenges such as soil salinization and sustainable groundwater management.

Beyond the realm of scientific findings, our research holds paramount practical implications. The recommendations we present, ranging from implementing efficient water conservation practices to establishing robust groundwater monitoring and promoting interdisciplinary research and policy collaboration, form a comprehensive roadmap for sustainable water resource management in Dzira’s arid agricultural region. We anticipate that these findings will serve as a guiding beacon for stakeholders, policymakers, and the local community, empowering them to make informed decisions that secure this vital resource for the future. In doing so, we aim to ensure both agricultural prosperity and environmental preservation coexist harmoniously in Dzira.