Introduction

Morocco, abundant in aquatic environments, ranks among the nation’s most vulnerable to water pollution (Taybi et al. 2016). Water, being a vital natural resource in any ecosystem (Tampo et al. 2015), necessitates a comprehensive understanding of its quality. Such knowledge offers a holistic perspective on the challenges at hand, ensuring the safeguarding of resources and the identification of potential sources of water quality degradation (Myers 2015). Water sources in Morocco encompass rivers, lakes, rainwater, groundwater, and more. Beyond addressing drinking water requirements, these resources play pivotal roles in various sectors of the Moroccan economy, including agriculture, forestry, industrial activities, livestock farming, and hydroelectricity production.

Like many other countries, including some in Africa, Morocco grapples with the issue of surface water pollution. This predicament is primarily attributable to Morocco's semi-arid climate, recurring droughts, and anthropogenic pollution (Soumaila et al. 2021). Surface water holds significant cultural importance in Moroccan traditions, serving as the primary source of irrigation for most farmers. According to current data, Morocco boasts approximately 1.46 million hectares of irrigated land, constituting around 17% of the nation's total agricultural expanse (Molle and Tanouti 2017). In certain rural regions like the Grand Atlas, the Middle Atlas, and the Small Atlas, surface water also caters to a substantial portion of the population's drinking water needs. Nevertheless, pollution stemming from natural origins, intensive agricultural activities, and rapid urban expansion exerts substantial stress on water resources. These factors have potentially detrimental effects on water's physicochemical attributes and overall quality (Obiri-Nyarko et al. 2022). Excessive agricultural practices, such as the overuse of fertilizers and pesticides, can result in the runoff of these substances into water bodies, altering the chemical composition of the water and leading to a decline in quality. Concurrently, burgeoning urbanization generates urban waste and wastewater, which can find their way into watercourses, further contributing to surface water pollution. Additionally, natural pollution arises from atmospheric factors (Uddin et al. 2020), interactions between water and lithogenic structures (Jahin et al. 2020), climate change (Wu et al. 2020), and geochemical factors (Gaur et al. 2022).

The combination of these challenges poses significant obstacles in the management and conservation of Morocco's surface water resources. Consequently, the assessment of river water quality is of paramount importance for effective resource management, environmental preservation, and the evaluation of its suitability for irrigation (Alsubih et al. 2022). However, the traditional method of evaluating water purity for both drinking and irrigation purposes is characterized by its high cost, time-intensive nature, and a substantial demand for personnel resources. To tackle these obstacles, diverse indices are employed to comprehensively appraise the quality of surface water, providing a clear overview of its state. Conversely, several studies advocate the adoption of novel tools for data preparation in modeling and forecasting (El Bilali and Taleb 2020). Simplifying the presentation of fluctuations in river water quality at specific times and locations is of utmost importance in enhancing accessibility (Sutadian et al. 2016).

Oued Inaouene plays a pivotal role as the primary river nourishing the Idriss 1st dam, one of Morocco's largest reservoirs in terms of storage capacity. Its importance is multifaceted, encompassing the supply of drinking water to the cities of Fez and Meknes, the regulation of volatile water inflows, the allocation of 830 million cubic meters per year for irrigation across 72,300 hectares, making it the largest irrigated area in the Gharb plain, and electricity generation. While industrial activities in the Oued Inaouene watershed upstream of the Idriss 1st dam remain relatively limited, recent years have witnessed substantial agricultural expansion and population growth, heightening the risk of Oued Inaouene's contamination.

This watercourse receives untreated domestic wastewater from Taza City, Oued Amlil village, and the villages along its course, posing a threat to its physicochemical quality. The use of physical and chemical parameters is essential for evaluating water quality and determining water characteristics, in accordance with international standards (Kikuda et al. 2022). Key physicochemical and bacteriological parameters provide initial insights into water characteristics, including temperature (T), pH (hydrogen potential), conductivity (EC), suspended solids (SS), biochemical oxygen demand for 5 days (BOD5), chemical oxygen demand (COD), chloride, carbonate and bicarbonate, sulfate, nitrogen compounds, total aerobic mesophilic flora (TAMF), thermotolerant coliforms (TC), total coliforms (TC), and fecal streptococci (FS). The Piper diagram is a widely accepted and applicable method for identifying the dominant geochemical processes that influence the chemical content of surface waters (Chen et al. 2020). Additionally, the Water Quality Index (WQI) offers a simplified approach to assessing overall water quality by condensing abundant information into a single, typically dimensionless, value. This methodology aims to provide a streamlined and replicable assessment of water quality, originating from the work of Horton (1965) and Brown et al. (1970). It is commonly employed in water quality analysis (Abbasi and Abbasi 2012).

Agricultural activities tend to flourish near watercourses, particularly where access to the water body is convenient. Generally, this water is not entirely pure; it often contains dissolved salts which, depending on their concentration, can impact soils and crops. Consequently, assessment techniques like the Wilcox diagram (1955) are employed to gauge the quality of irrigation water based on its physicochemical properties. This method is customary and valuable for appraising irrigation water quality. However, it's crucial to note that relying solely on a single WQI parameter can be limiting and may lead to an insufficient evaluation, rendering it inadequate for assessing the suitability of irrigation water (Singh et al. 2019). Hence, it is recommended to incorporate multiple parameters and assessment techniques to gain a more comprehensive understanding of irrigation water quality. Some studies have proposed a water quality measure that weighs the scores of various characteristics (Elsayed et al. 2020). According to Samtio et al. (2023), the effective monitoring and evaluation of irrigation water suitability can be achieved by employing water quality indices (WQIs) that integrate parameters such as irrigation water quality (IWQ), sodium percentage (Na%), sodium adsorption ratio (SAR), Permeability Index (PI), Kelly Index (KI), and corrected sodium percentage (CSR). Through the amalgamation of these weighted variables, WQIs offer a more holistic measure of water quality for irrigation and enable the assessment of its suitability for this specific purpose. Statistical techniques are often employed to scrutinize the factors influencing surface water quality (Yang et al. 2020). One such approach is principal component analysis (PCA) (Liu et al. 2021). This statistical tool is widely utilized to characterize and elucidate aspects of water quality (Abdulsalam et al. 2022). It illuminates the relationships between the different measured variables, identifies the primary factors influencing water quality, and presents the data concisely and comprehensibly. Consequently, multivariate statistical approaches furnish a potent analytical tool for comprehending surface water quality. Geographic Information Systems (GIS) can offer solutions to some of these challenges, especially when combined with a method for assessing water quality and spatial analysis tools like distance weighted interpolation (DWI), which significantly aids in visualizing research outcomes (Khouni et al. 2021). GIS enables the mapping of water quality data and visualization of spatial variations, proving particularly valuable for pinpointing areas with specific water quality issues and making informed decisions in water resource management. Research into the mechanisms influencing surface water quality is of paramount importance, especially considering the extensive volume of data amassed in specific studies. Significant strides were made at the close of the twentieth century with the introduction of the surface WQI (Ben Brahim et al. 2021).

This study has two primary objectives: firstly, to assess the physicochemical and bacteriological properties of the surface waters in Oued Inaouéne and Idriss 1st dam; and secondly, to evaluate several agricultural parameters. To achieve the first objective, we will utilize two indices—the Irrigation Water Quality Index (IWQI) and the Global Water Quality Index (WQI). These indices will play a crucial role in evaluating the suitability of the water for both human consumption and agricultural purposes. The second objective of this study involves the evaluation of various agricultural parameters, including the SAR, magnesium hazard (MH), sodium ratio (% Na), PI, and sodium carbonate (SCR). These parameters will provide vital insights into the water's characteristics, ensuring its efficient and safe utilization in agricultural practices.

Materials and methods

Study area

The Inaouene catchment area is situated in the northern part of Morocco's Fès-Taza region, marking the eastern extreme of the Saïss watershed. Its geographical coordinates range between parallels 33.84 N and 34.58 N, and meridians 3.78 W and 4.91 W. This region is flanked by the Pre-Rif to the north and the Middle Atlas to the south, with the Middle Moulouya to the east, the Upper Ouergha to the northwest, and the Upper Sebou to the southwest (El Garouani and Tribak 2006) (Fig. 1). The watershed spans an area of 3599.82 km2 and boasts a perimeter of 354.39 km. It holds a significant position within the greater Sebou watershed as one of its principal catchment areas and hydrological networks. The region experiences a semi-arid climate characterized by cold winters and hot summers.

Fig. 1
figure 1

Study area and location of sampling sites

The Inaouene catchment exhibits two distinctive geological units (Fig. 2) that wield a significant influence on its geomorphology and hydrological dynamics:

Fig. 2
figure 2

Geology map of the Oued Inaouene catchment area (geological map of Morocco, 1985), Modified

The Middle Atlas domain unit: situated in the southern part of the watershed, it primarily comprises carbonate formations forming a karstic system, lending this portion of the watershed high permeability. Additionally, it contains sandstones, marls, and volcanic rocks such as basalts and andesite. South of this unit lies the Tazzekka Palaeozoic massif, characterized by metamorphic and magmatic rocks, including schists, gneisses, and granites, indicative of an ancient geological history (Chalot-Prat et al. 1989).

The pre-Rif unit: This unit comprises impermeable marl bedrock and sedimentary rocks from the Lower Cretaceous period. The lowlands of the Inaouene watershed feature river terraces composed of recent alluvial deposits. These deposits typically consist of sand, gravel, and clay, accumulated over time through the action of rivers (Andrieux 1971).

The soil composition within the watershed is closely intertwined with its underlying lithology, giving rise to two primary soil types. In the elevated regions of the Pre-Rif and Middle Atlas, we find predominantly thin soils. In contrast, the lowlands, including the Inaouene river terraces (Naoura 2012), are characterized by thicker soil layers. Vegetation cover, on the other hand, primarily flourishes in the northeastern and southern sectors of the watershed. These dual factors play a pivotal role in shaping the hydrographic network, with more extensive development observed on the northern side in comparison to the southern side.

Sampling, chemical, and biological analysis

The study revolved around three primary research areas: firstly, the establishment of physicochemical parameters; secondly, the development of indices for both drinking water and irrigation purposes; and thirdly, the delineation of potential zones with varying surface water quality. To process the data, the researchers employed R and ArcGIS. Within the study, a meticulous calculation of various indices played a pivotal role, including but not limited to the WQI, SAR, residual sodium carbonate (RSC), salinity potential (SP), PI, The KI, Water Hardness Index (MH), residual sodium bicarbonate (RSBC), and Integrated Water Quality Index (IWQI) (Fig. 3).

Fig. 3
figure 3

Methodological framework

In January 2020, our sampling efforts extended to six strategically chosen sites across the catchment area, including the Idriss 1st dam (Fig. 1). The selection of our sampling method was intricately linked to the study's objectives, focusing on pinpointing locations suspected of harboring contaminants or serving as pivotal points within the watershed, considering both human activities and geological significance.

Effluent water samples were collected in sterile containers as grab samples, following the general protocol for sample storage and handling (ISO 1994). The study encompassed a comprehensive array of physicochemical parameters. On-site measurements included temperature, pH, and electrical conductivity, which were assessed using a CONSORT—Model 835 multiparameter analyzer. To determine the 5-day biological oxygen demand (BOD5), we incubated selected water samples in sealed bottles with Oxitop, maintained at a temperature of 20 °C for five days, and measured using a WTW BOD meter, model 1020 T. Chemical oxygen demand (COD) was ascertained at 148 °C through the potassium dichromate technique (Rodier et al. 2009). Nitrites were examined using the Zambelli reagent technique, while nitrates were determined through molecular absorption spectrometry. Sulphates were measured using the nephelometric method, and total carbonates were deduced via alkalinity, specifically total alkalimetric titration (TA) and total alkalimetric titration (TAC). Chlorides were assessed using Mohr's technique, and to measure the quantity of suspended particles, a water volume was filtered through a 0.45 μm filter, following the Rodier et al. (2009) procedure. Additionally, major cations and anions such as sodium, magnesium, potassium, manganese, aluminium, phosphate, and iron were scrutinized employing inductively coupled plasma atomic emission spectroscopy (ICP-AES) at the laboratory of the Innovation City of Sidi Mohamed Ben Abdellah University in Fez, Morocco. The evaluation of faecal streptococci (FS), faecal coliforms (FC), and total coliforms (TC) was conducted using the membrane filtration method (Oladipo et al. 2021). To ensure the precision of our sample processing, all tests were conducted in triplicate.

Statistical analysis

The approach was initiated by creating graphical representations to enhance the visualization of the measurements and analyses conducted, thereby simplifying subsequent explanations. Given the large number of variables used and the need to elucidate significant trends among the variables and measurement stations, a principal component analysis (PCA) was conducted using the R software. PCA stands as a potent tool for compressing and synthesizing information, effectively handling substantial volumes of quantitative data (Guerrien 2003).

Evaluation of water quality based on hydrogeochemical indices

Water Quality Index (WQI)

In the 1970s, Horton was a pioneer in developing the WQI, a mathematical tool designed for calculating an overall value based on multiple test results. These results serve as indicators of water quality within specific catchment areas, whether they are lakes, rivers, streams, or even ponds (Akkaraboyina and Raju 2012). To assess the quality of drinking water, the WQI was introduced, incorporating the ten most prevalent characteristics into a mathematical calculation. This approach is commonly used for evaluating water quality. Over time, many studies have adapted this method by assigning varying weights to each water quality measure (Jehan et al. 2022).

The WQI is calculated using the arithmetic weight method (Eq. 1) (Chucuya et al. 2022):

$$WQI = \mathop \sum \limits_{i = 1}^{n} Q_{i} W_{i}$$
(1)

The Qi value is determined based on the concentration (Ci) of surface water in mg/l and the standard (Si) set by the World Health Organization (WHO) in 2017 for each water parameter's drinking water quality. This relationship is mathematically represented by the following equation (Eq. 2):

$$Q_{i} = \frac{{C_{i} }}{{S_{i} }} \times 100$$
(2)

Given that the pH must be between 6.5 and 8.5 according to the protocol (Who 2017), the assessment scale used was calculated from Eq. 3 (Rupias et al. 2021):

$$Q_{i} = \frac{{\left( {C_{pH} - 8.5} \right)}}{{\left( {6.5 - 8.5} \right)}}$$
(3)

Relative weights (Wi) were determined for each parameter according to the equation (Eq. 4) below (Masoud et al. 2022):

$$W_{i} = \frac{{w_{i} }}{{\mathop \sum \nolimits_{k = 0}^{n} w_{i} }}$$
(4)

Wi represents the weight of the parameter, "i", and "n" refers to the total number of parameters considered.

Applying the WQI, this study investigated the influence of both human-made and natural factors on water quality. The research focused on 17 key elements of Oued Inaouene's surface water chemistry, detailed in Table 1. Following the guidelines set by the WHO in 2017, each criterion has been assigned a distinct weight (Wi), reflecting its potential effect on human health. These weights range from 1, indicating minimal impact, to 5, signifying the highest impact.

Table 1 Relative weights of physical and chemical parameters

According to Kachroud et al. (2019), the WQI results for each water surface sample were divided into five water quality groups illustrated in Table 2 below.

Table 2 Classification of water quality

Irrigation water quality index (IWQI)

To evaluate the quality of water used for irrigation, we will calculate several indices. By combining various parameters of irrigation water quality, we will obtain an overview of the quality of surface water and its suitability for irrigation. These indices include:

The sodium absorption ratio (SAR) is a parameter employed to assess the risk of salinization due to the presence of NaCl salt resulting from irrigation. This parameter is calculated using the following Eq. 5:

$$SAR = \frac{{Na^{2 + } }}{{\sqrt {(Ca^{2 + } + Mg^{2 + } )/2} }}$$
(5)

The assessment also encompasses the determination of RSC, which is crucial for classifying irrigation water. High concentrations of magnesium and calcium in the water can negatively affect the soil. RSC is calculated following Eaton (1950), Richards (1954) and Marlet and Olivier (2006) using Eq. 6:

$${\text{RSC}} = {\text{Alcalinite carbonate}} - ({\text{Ca}} + {\text{Mg}})$$
(6)

Salinity potential (SP) is a critical index employed for the categorization of water intended for irrigation. According to Doneen (1964), water with a SP of less than 3 meq/L is deemed appropriate for irrigation. SP is utilized to evaluate the water's SP, specifically its concentration of soluble salts. It is calculated using Eq. 7 (Batarseh et al. 2021):

$$PS = Cl^{ - } + \frac{1}{2}So_{4}^{2 - }$$
(7)

The PI serves as a parameter for evaluating the suitability of water for irrigation. It quantifies water's ability to penetrate through the soil and its impact on soil permeability. PI can be computed using Eq. 8 (Samtio et al. 2023):

$$PI = \frac{{(Na^{ + } + \sqrt {HCO_{3}^{ - } ) \times 100} }}{{\left( {Ca^{2 + } + Mg^{2 + } + Na^{ + } } \right)}}$$
(8)

The assessment of water suitability for agricultural purposes often involves evaluating the risk of magnesium (MH) and the percentage of sodium (%Na). When irrigation water contains high quantities of soluble salts, it can diminish soil permeability. Furthermore, a high concentration of Mg2+ ions in the water can adversely affect soil quality, resulting in the formation of alkaline soils that are detrimental to agricultural production. The calculations are based on Eqs. 9 and 10 (Alsubih et al. 2022):

$$Na\% = \frac{{(Na^{ + } + K^{ + } ) \times 100}}{{\left( {Ca^{2 + } + Mg^{2 + } + Na^{ + } + K^{ + } } \right)}}$$
(9)
$$MH = \frac{{\left( {Mg^{2 + } \times 100} \right)}}{{\left( {Ca^{2 + } + Mg^{2 + } } \right)}}$$
(10)

The Kelly ratio is a parameter used to compare sodium levels with calcium and magnesium levels. It is determined using Eq. 11 (Batarseh et al. 2021):

$$KI = \frac{{Na^{ + } }}{{Ca^{2 + } + Mg^{2 + } }}$$
(11)

The RSCB (residual sodium carbonate bicarbonate) is employed to evaluate the presence of sodium carbonate. When water contains higher quantities of carbonate and bicarbonate than calcium and magnesium, it tends to produce sodium bicarbonate. An excess of sodium in the soil results in an excess of RSC, which negatively affects soil structure and reduces permeability (Eq. 12) (Mahammad et al. 2023):

$$RSBC = HCO_{3}^{ - } - Ca^{2 + }$$
(12)

It's essential to emphasize that when evaluating irrigation water quality criteria, ionic concentrations are expressed in meq/L. The quality criteria are established by assigning weights (Wi) to each parameter based on their significance for irrigation (Table 3).

Table 3 Weight of each parameter and adequate irrigation level (Elemile et al. 2022)

The Irrigation Water Quality Index (IWQI) is derived from five key water quality parameters: EC, SAR, Na+, Cl, and HCO3 (Abbasnia et al. 2018a, b). Prior to data analysis, all concentration units were converted to milliequivalents per liter. The calculation of IWQI involves assessing the values of each water quality measurement parameter (qi) alongside the respective weight for each parameter (Wi). The limits proposed for each parameter were applied to compute the qi values, as detailed in Table 4, and are determined using Eq. 13:

$$q_{i} = q_{max} - \left[ {\frac{{\left( {x_{ij} - x_{if} } \right) \times q_{imap} }}{{x_{amp} }}} \right]$$
(13)
Table 4 Limit values for the parameters used to calculate the quality (Qi) (Meireles et al. 2010) and weights (Wi) associated with each IWQI parameter

where qimax: maximum value of qi for the class; xij: observed value of the parameter; xinf: lower limit of the class of the parameter; qiamp: amplitude of the class of qi; xamp: amplitude of the parameter class.

Finally, the IWQI was calculated using the following Eq. 14

$$IWQI = \mathop \sum \limits_{1}^{n} q_{i} w_{i}$$
(14)

where n represents the number of parameters considered (in this case, 5 parameters). The qi values were multiplied by the corresponding weights wi of each parameter (Table 4), by (Meireles et al. 2010).

To assess the quality of water for irrigation and consumption, mapping methods were employed, combining geographic information system (GIS) tools with geostatistical techniques. The use of ArcGIS 10.4.1 facilitated the generation of various thematic maps, while the ArcGIS Spatial Analyst extension was utilized to produce the final map of the WQI. To achieve a precise spatial distribution of surface water quality parameters in Inaouene, ordinary kriging, a widely recognized interpolation technique, was implemented.

Results

Physical and chemical parameters in water samples

The analysis of physicochemical and biological parameters (Table 5, Fig. 4) reveals significant variations within the examined water samples.

Table 5 Physico-chemical and bacteriological measurement results in the Oued Inaouene Watershed
Fig. 4
figure 4

Variations in physicochemical and bacteriological water parameters upstream of the Idriss 1st dam in the Inaouene watershed

Within the Inaouene watershed, pH measurements range from 7.64 to 8.76, with a gradual increase from upstream to downstream. These results suggest that the water pH ranges from slightly neutral to moderately alkaline. Furthermore, water temperature exhibited minor fluctuations within the study area, with the lowest temperature, 13 °C, recorded at Ech1, while the highest temperature, 19°C, was recorded at Ech3.

Regarding electrical conductivity, samples taken near the dam at sites Ech6, Ech5, and Ech4 (Table 5) showed conductivity levels below 700 μS/cm. However, sites near the city of Taza and the village of Oued Amlil (Ech1, Ech2, Ech3) exhibited notably high electrical conductivity, especially Ech1 upstream in the watershed, where it reached a maximum value of 2822 μS/cm. This high conductivity suggests significant mineralization.

The analysis of suspended matter concentration revealed very low values, with an average of 4.53 mg/L. The results, presented in Table 5, indicate a considerably high chemical oxygen demand (COD) in all samples, exceeding the thresholds set by the WHO (2017). COD showed a gradual increase in samples from Ech1 and Ech2. Subsequently, a slight decrease was observed in the Ech4 sample and at the Idriss 1st dam. In general, levels of biochemical oxygen demand (BOD5) remained low and in compliance with the WHO's recommended threshold of 3 mg/L, except for the sites represented by samples Ech4 and Ech5.

The water hardness in Oued Inaouene exhibits a discernible trend, transitioning from very hard to hard as one moves downstream, with values spanning from 25.83 to 52.33. Calcium (Ca2+) and magnesium (Mg2+) both display elevated concentrations in the water, particularly upstream, gradually decreasing downstream. Concentrations for calcium range from 19.303 to 127.09 mg/L, while those for magnesium vary from 49.8 to 50.4 mg/L (Fig. 4). Notably, certain samples surpass the recommended drinking water standards for calcium (75 mg/L) and magnesium (50 mg/L) as outlined by the WHO in 2017.

In contrast, sodium (Na+) and potassium (K+) concentrations fluctuate between 68.5 and 653.07 mg/L, and between 2.6 and 20.05 mg/L, respectively. Overall, following the WHO's 2017 recommendations, these concentrations fall below the maximum permissible value for water potability. However, Ech1’s station exhibits elevated concentrations. The carbonate (CO32−) content remains practically negligible across all sites. Conversely, bicarbonates (HCO3) exhibit high concentrations, peaking at 415 mg/L. As one progresses downstream towards the Idriss 1st dam, concentrations gradually diminish but remain significant.

Concentrations of nitrogen forms, such as NO2 and NO3 (Fig. 4), were notably low, with averages of 0.38 mg/L and 1.14 mg/L, falling below the recommended levels of 3 and 50 mg/L as stipulated in the drinking water guidelines. Ammonium (NH4+) concentrations remained low, not exceeding 2.8 mg/L, as evidenced by the measurements obtained at Ech2 (Table 5). These minimal ammonium levels can be attributed to either the absence of nitrogenous waste pollution sources or limited ammoniation. Chloride (Cl) concentrations generally remained low (Fig. 4), averaging 112.8 mg/L. Similarly, SO42− values exhibited a similar pattern to chlorine, with consistently high concentrations detected solely at the Ech1 sampling site (152.3 mg/L). These diminished levels can also be attributed to the substantial volume of water received by the watershed during this period, leading to concentration dilution. It is important to note that these concentrations remained below the limits established by the WHO in 2017, except for the water from Ech1. Phosphate (PO43−) was detected in all samples at relatively low concentrations, with the highest value recorded in the Ech5 sample, still falling below the standard value of 5 mg/L.

Surface waters in Oued Inaouene also exhibit the presence of metals such as chromium, iron, aluminum, and cadmium. Among the analyzed trace elements (copper, nickel, lead, zinc, and arsenic), either their concentrations fell below the detection limit, or they were present in minimal amounts that had no adverse impact on water quality. Cadmium and chromium were detected in all samples at elevated levels, potentially affecting water quality within Oued Inaouene. Their respective averages stood at 0.098 mg/L and 0.18 mg/L (Table 5), surpassing the WHO recommended values of 0.003 mg/L and 0.05 mg/L. On the contrary, iron levels were notably lower compared to the established limits, with concentrations ranging from 0.1 to 0.11 mg/L. Except for the Ech4 sample, which exceeded WHO standards, aluminum concentrations across all samples remained generally low, measuring less than 0.9 mg/L.

To comprehensively assess the overall water quality, it is imperative to conduct a qualitative bacteriological characterization of the surface waters in Oued Inaouene and Idris 1st dam, as detailed in Table 5 and Fig. 4. This additional assessment significantly contributes to our understanding of these water bodies' quality. The distribution of the total aerobic mesophilic flora exhibits notable variations among the different sampling stations, with concentrations exceeding 10,000 CFU/mL, primarily at Ech1, Ech2, and Ech6.

The temporal trends of total and fecal coliforms indicate a decreasing gradient (Table 5) from upstream within the catchment area toward downstream. Elevated values were observed in urbanized regions, which can be attributed to contamination from effluents and municipal waste sites in the urban areas of Taza (Ech1, Ech2) and Oued Amlil (Ech3). Closer to the dam (Ech6), this gradient diminishes.

Faecal streptococci exhibit a similar pattern of variation to that of coliforms, reaching a maximum concentration of 125 FS/ml in the Ech2 sample, while dropping to a minimum of 5 FS/ml downstream in the watershed.

Hydrochemical analysis of water from Oued Inaouene, Idriss 1st dam, identification of different types of water

To compare the chemical composition of water samples, the use of the Piper diagram (Piper 1944) is indispensable, as it facilitates both geochemical analysis and comprehension of the processes influencing water quality. This diagram comprises two triangles representing the cationic and anionic facies, along with a rhombus summarizing the overall facies.

The cationic facies of Oued Inaouene waters (Fig. 5A), can be categorized into three distinct types. The first type, known as the magnesic facies, is represented by a single sample, Ech4. In contrast, samples Ech1, Ech2, Ech3, and Ech5 display neutral facies, indicating the absence of dominant cations. This neutrality is typically associated with a process of balanced leaching from various lithostratigraphic formations. Finally, the third type, termed the sodi-potassic facies, is observed in sample Ech1, situated upstream of the Inaouene watershed.

Fig. 5
figure 5

Piper diagram for water sample analysis results (A) and total ion salinity (TIS) (B)

Regarding the anionic facies (Fig. 5A), it is primarily characterized by the chloride facies, which is observed in most of the sites. The overall facies (Fig. 5A) can be classified into three distinct types: the chloride-sodium and potassium (or sulfate-sodium) facies is exclusively found at a single site, Ech1, located upstream of the watershed. The chloride-sulfate and magnesian-calcium facies predominates at several sites, including Ech2, Ech4, and Ech5. The calcic and magnesian bicarbonate facies is recorded at two sites, Ech3 and Ech6.

The study of total ionic salinity (TIS), based on the analysis of chloride (Cl), bicarbonate (HCO3), and sulphate (SO42−) concentrations (Apollaro et al. 2022), allows for the assessment of salt content in water samples. Figure 5B illustrates relatively low and comparable salinity levels at most sites (Ech3, Ech4, Ech5, and Ech6), with TIS values ranging from 4 to 10 meq/L. However, sample 2 exhibits moderate salinity due to elevated sulphate and bicarbonate concentrations. The highest TIS value, exceeding 40 meq/L, is observed upstream at the Ech1 sampling station, where substantial Cl, SO42−, and HCO3 concentrations.

Principal component analysis of surface water hydrochemistry and bacteriology

To establish relationships among the analyzed physico-chemical parameters in the water samples, Pearson correlation coefficients were calculated, graphically depicted in the accompanying Fig. 6. Examination of the results uncovers significant correlations, such as the strong positive correlations between pH and the concentrations of aluminum (r = 0.732) and iron (r = 0.759). These compelling correlations imply that the water's alkaline or acidic nature is influenced by the presence of these elements. Conversely, the total hydrotimetric titer exhibits an exceptionally high and positive correlation with calcium (r = 1), bicarbonate (r = 0.984), sodium (r = 0.930), potassium (r = 0.968), chlorine (r = 0.954), and sulfate (r = 0.941), while displaying a significant negative correlation with magnesium (r = − 0.914). This observation suggests that the overall water hardness is influenced by the collective contribution of several chemical elements. Electrical conductivity (EC) demonstrates robust positive correlations with various parameters, including the total hydrotimetric titer (TH) (r = 0.960), calcium (r = 0.961), potassium (r = 0.982), sodium (r = 0.993), bicarbonate (r = 0.987), sulfate (r = 0.960), and chloride (r = 0.993). Conversely, it displays a notable negative correlation with magnesium (r = − 0.983). These diverse correlations imply that water mineralization is not solely reliant on silicate hydrolysis but also on the presence and concentration of these elements. Additionally, these elements exhibit significant positive correlations with each other, underscoring their interdependence within the water composition. Suspended solids (SS) are positively correlated with aluminum (r = 0.883), indicating that the subsurface geology through which water travels is rich in aluminum. This correlation suggests that the presence of aluminum contributes to the quantity of suspended matter in the water. Furthermore, chemical oxygen demand (COD) shows strong negative correlations with chromium (r = − 0.934) and cadmium (r = − 0.868). This observation suggests that an increase in COD values is associated with a decrease in the concentration of these elements (Cr and Cd) in the water, and vice versa.

Fig. 6
figure 6

Matrix of Pearson correlation coefficients between the chemical elements analyzed in the water samples

A moderate correlation (r = 0.677) observed between ammonium (NH4+) and nitrite (NO2) implies a nitrification process involving the NH4+ ion present in the water. This correlation may also signify the intricate interplay of biogeochemical processes. Additionally, a correlation exists between nitrate (NO3) and aluminum (r = 0.750). Furthermore, there are noteworthy positive correlations among specific metallic elements. Notably, a significant correlation of r = 0.968 was identified between iron and aluminum, indicating a robust relationship between these two elements. Similarly, another notable correlation of r = 0.861 was discovered between cadmium and chromium.

The analysis of the principal component analysis (PCA) results (Fig. 7A) reveals that the F1 axis encompasses 47.34% of the overall information, while the F2 axis contributes to 19.46% of the total information. By combining these two axes in the F1–F2 factorial design, we account for a cumulative 66.80% of the total variance. Therefore, our PCA analysis will focus on these two axes as they adequately represent all the data, efficiently distributing and representing the studied variables.

Fig. 7
figure 7

Correlation circle for elements analyzed in Inaouene waters (A), map showing sampling sites (B)

The F1 axis includes various physical parameters, such as pH, temperature (T°), electrical conductivity (EC), suspended solids, as well as all cations and specific anions (SO42−, HCO3, and Cl). This convergence indicates significant correlations among these parameters. In contrast, the F2 axis is primarily composed of metallic elements, COD, BOD5, and nitrogenous elements (NH4+, NO2, NO3). A circular analysis highlights a significant clustering of the studied parameters in the water samples, emphasizing two main groups. The first group comprises parameters like Na+, TH, SO42−, HCO3, Ca+, Cl, and CE. The second group encompasses parameters such as Fe2+, Al+, NO2, NH4+, and SS.

Analysis of the representation map (Fig. 7B) on the F1-F2 factorial plane reveals the presence of three distinct groups:

The first group is exemplified by station Ech1, situated upstream in the Inaouene catchment, this station is characterized by hard water rich in ions such as Na+, SO42−, HCO3, Ca+, and Cl. The second group encompasses most stations, namely Ech2, Ech3, Ech4, and Ech5. These stations exhibit exceptionally high concentrations of all the studied elements, suggesting a common feature in their chemical composition. The last group is represented solely by station Ech6, located downstream of the Idriss 1st dam. This station stands out for its high levels of chromium and cadmium, indicating a specific influence of these metals in this area.

This division into three groups highlights significant variations in the chemical composition of water samples along the Inaouene catchment. It provides a more comprehensive understanding of the geographical and environmental factors that impact water quality in this region.

Bacterial correlations analysis

To delve into the relationships among the various categories of bacteria present in the water, we computed Pearson's correlation coefficients (Fig. 8A) and constructed a correlation circle (Fig. 8B). The findings unveiled that the total aerobic mesophilic flora (TAMF) exhibited a significant and robust positive correlation with faecal streptococci (FS), with a correlation coefficient of 0.76. Furthermore, TAMF displayed a moderate correlation with total coliforms (TC), registering a correlation coefficient of 0.45. These outcomes underscore the noteworthy connections between these microbiological parameters within the water samples.

Fig. 8
figure 8

Matrix of Pearson correlation coefficients (A), correlation circle (B), map (C) showing sampling sites for different types of bacteria analyzed in Inaouene waters

Analysis of the factor map (Fig. 8C) reveals a distinct segmentation of the sampled sites into three prominent groups. The first group is exemplified by site Ech1, characterized by elevated levels of both Total Aerobic Mesophilic Flora (TAMF) and total coliforms (TC). This observation points to a substantial concentration of these bacteria at this specific site. The second group is represented by site Ech5, where the presence of faecal streptococci (FS) is notably pronounced, indicating a significant accumulation of these bacteria at this location. Lastly, site Ech3 stands out due to its high concentration of faecal coliforms, suggesting a prevailing presence of this category of bacteria at this site. The remaining sites exhibit varying degrees of these bacterial strains, ranging from moderate to low levels.

Water Quality Index

A total of 17 essential parameters were thoughtfully selected to compute the WQI, considering their respective importance in assessing the overall quality of water for both drinking and irrigation purposes (Table 1 and Fig. 9). These parameters are based on internationally recognized water quality standards, including those established by the World Health Organization (WHO). The WQI simplifies a wide range of water quality data into straightforward categories such as "excellent," "good," "poor," and "very poor" (Chen et al. 2020). This approach serves as a valuable tool to evaluate the impact of both anthropogenic and natural factors on the water quality of Oued Inaouene, as discussed in previous studies (Hong and Giao 2022).

Fig. 9
figure 9

WQI results for the Inaouene watershed upstream of the Idriss 1st dam

The results obtained from the calculation of the WQI (Fig. 9), indicate a range of WQI values that vary from 50.81 to 117.08. This range classifies the overall water quality in the Inaouene region into two distinct categories: "poor," represented by red, and "good," depicted by yellow. Specifically, samples Ech2, Ech3, Ech4, Ech5, and Ech6 are indicative of good-quality drinking water, with WQI scores falling within the range of 50–95. In contrast, Ech1 is classified as poor quality, as it possesses a WQI value that exceeds 100.

Quality of irrigation water

The evaluation of surface waters in Oued Inaouene can be performed using different water quality indices specifically designed for irrigation applications. These indices are formulated by considering the combined assessment of nine distinct risk categories (Table 6), which include parameters like EC, SAR, Na%, RSC, KI, MH, RSBC, PI, and PS (Sudhakaran et al. 2020). The application of these indices enables a comprehensive determination of the appropriateness of Oued Inaouene's surface water for agricultural irrigation.

Table 6 Irrigation water quality indices in Oued Inaouene samples

The examination of the samples collected from the Inaouene watershed (Table 6), in comparison with the Wilcox classification (1955), revealed that four stations fell into the moderately saline category (class C2) (Table 7). These stations, situated downstream in the watershed, are considered suitable for irrigation purposes. One station displayed questionable quality or relatively high salinity (class C3), making it appropriate for salt-tolerant plants but not recommended for regular irrigation. Nonetheless, the salinity levels remained below 2822 µS/cm, in line with Richards' criteria for acceptable water quality for irrigation (Table 6). The single station located upstream, characterized by very high salinity (class C4), is not conducive for soils with limited drainage (Table 7) (Pivic et al. 2022).

Table 7 Classification of waters based on water quality indices

The sodium absorption ratio (SAR) is a parameter used to assess the risk of soil sodification caused by irrigation water. According to Richards (1954), SAR has classified surface waters into four groups (Table 10): excellent (SAR < 10), good (10 < SAR < 18), doubtful (18 < SAR < 26), and unsuitable (SAR > 26). Based on the obtained results (Table 7), most sites exhibit good quality with moderate sodium content. However, site Ech1 shows high salinity, rendering the water of very poor quality.

The combination of SAR results with electrical conductivity on the USSL diagram (Richards 1954) facilitated the assessment of Oued Inaouene water's suitability for irrigation, leading to the identification of the following classes (Fig. 10A):

Fig. 10
figure 10

USSL (A) and Wilcox (1955) (B) diagrams for assessing irrigation water quality

Class C2S1: this class encompasses water that is suitable for plants with a slight tolerance to salt. It is the most prevalent class and is exclusively found downstream of the watershed.

Class C3S1: this class corresponds to the water at the Ech2 station. It is suitable for plants with good salt tolerance but necessitates periodic monitoring of salinity fluctuations.

Class C4S3: this category designates water unsuitable for irrigation and is only present at the Ech1 station upstream of the watershed.

The sodium percentage (Na%) is an indicator used to assess the risk of sodium presence in soil. Elevated sodium concentrations in the soil can lead to soil aggregate disintegration and alter its structure. Consequently, soil pores may become obstructed, diminishing soil permeability, and disrupting the flow of water and nutrients (Varol et al. 2021). According to Wilcox's classification (1955), there are five distinct water types (Fig. 10B) based on sodium content.

As shown in Table 6, the sodium percentage in water samples used for irrigation in the studied area ranges from 44 to 79%, with an average of 55.20%. This suggests that, overall, the water is suitable for irrigation, except at the site represented by Ech1, where water quality is questionable. The representation of these sites on the Wilcox diagram, utilizing electrical conductivity and sodium percentage data for each water sample from Oued Inaouene (Fig. 10B), allows us to categorize the suitability of these waters for irrigation into three groups. Most of the sites feature water of excellent to good quality for irrigation, indicating suitability for plant requirements. However, site Ech1 exhibits poor water quality, suggesting it is less suitable for irrigation purposes.

Residual sodium carbonate (RSC) measures the concentration of sodium carbonate in water. RSC plays a crucial role in assessing the suitability of irrigation water. Based on Eaton's (1950) classification (Table 7), RSC values in the analyzed catchment ranged from 3.65 to 4.55 meq/L, with an average of 4.14 meq/L (Table 6). The results indicate that all water samples exceeded the 2.5 meq/L threshold, falling into the "unsuitable for irrigation" category according to the classification. RSC variations were also mapped using the IDW interpolation method (Fig. 11C).

Fig. 11
figure 11

Spatial repartition of surface water for SAR (A), Na% (B), RSC (C), RSBC (D), PS (E), IP (F), KI (G), and MH (H)

The RSBC, as defined by Gupta et al. (1987), serves as an indicator for assessing alkalinity risk. Generally, bicarbonate concentrations exceeding 10.0 meq/L can impact plant growth. However, RSBC values below 5 meq/L are considered satisfactory (Table 7). The RSBC values in the water samples ranged from 61.70 to 287.91 meq/L, with a mean of 133.61 meq/L, based on the obtained results (Table 6). The RSBC levels of all the samples exceeded the acceptable limit, rendering them unsuitable for irrigation purposes.

Potential salinity (PS) serves as a crucial parameter for assessing the concentration of dissolved salts in irrigation water, considering ions such as chloride (Cl) and sulfate (SO42−). When these ions are present in excessive amounts, they pose a threat to both soil and plant health. Consequently, potential salinity serves as a key classification criterion for determining the required irrigation water volume, as initially proposed by Doneen in 1964.

The potential salinity levels of water samples collected from Oued Inaouene exhibited a wide range, ranging from 46.18 to 439.59 meq/L, with an average of 46.18 meq/L. The values, as outlined in Table 6, unequivocally indicate that all the samples are unsuitable for irrigation, as further corroborated in Table 7. To visually represent this data, Fig. 11E, D offer geospatial depictions of the PS and RSBC analytical data.

The PI, as defined by Doneen et al. (1964), is a crucial tool for evaluating soil's capacity for infiltration. However, the composition of the soil can undergo progressive alterations when exposed to water with elevated concentrations of salts, magnesium, calcium, and bicarbonate, as highlighted by El-Amier et al. (2021). Water quality is categorized into three classes: poor, good, and excellent, as outlined in Table 7.

The PI results obtained from water samples collected within the Oued Inaouene catchment range from 49.96 to 81.14%, with an average of 59.67%. These findings have been spatially visualized on the IDW map (Fig. 11F), which demonstrates that the samples from Ech1's station fall into class I, while the remaining stations fall into class II.

The Kelley index, introduced by Kelley in 1963, serves as a valuable tool for evaluating the quality of irrigation water based on its sodium, calcium, and magnesium content. A KI value greater than 1 signals an excess of salt, which can be detrimental to irrigation. Conversely, a KI value below 1 indicates water suitability for irrigation, signifying a lack of risk due to high salt content (Table 7) (Masoud et al. 2022). The study's findings unveiled KI values ranging from 0.76 to 3.69 meq/L, with an average of 1.57 meq/L (Table 6). Following Kelley's guidelines, water from five Inaouene sites was deemed suitable for irrigation, implying an acceptable salt level that should not pose significant issues. Nevertheless, Ech1's station exhibited a KI value exceeding 1, potentially leading to soil salinity problems and structural degradation. Geospatial variations in KI values are visualized in Fig. 11G.

The magnesium hazard index (MH), developed by Paliwal et al. (1972), serves as a valuable tool for assessing the risk associated with magnesium presence in irrigation water. Elevated magnesium concentrations in irrigation water can have detrimental consequences. In the watershed, MH index values range from 28.15 to 72.31%. Based on these findings, half of the upstream water samples (Ech1, Ech2, and Ech3) possess values below 50, indicating suitability for irrigation. In contrast, downstream sites may adversely impact agricultural production and soil alkalinity. Figure 11H illustrates the geospatial variations in magnesium risk index (MH) values employing the inverse distance weighting (IDW) method.

The Irrigation Water Quality Index (IWQI) was determined based on parameters including Cl, EC, Na+, HCO3, and SAR, to assess the suitability of the water for irrigation. The IWQI values for the irrigation categories are divided into five classes ranging from zero to one hundred, without dimensional units. The higher the values, the better the water quality. This scale is defined, taking into consideration the risks of salinity, reduced water infiltration into the soil, and plant toxicity, following the classifications proposed by Holanda and Amorim (1997) and Bernardo (1995). IWQI values exhibited a range from 48.12 to 80.77, with an average of 71.23 (Table 6). Within the Inaouene catchment, diverse water samples (Fig. 12) have been categorized according to their level of suitability for irrigation. Four stations (Ech3, Ech4, Ech5, Ech6) in the watershed were identified as having low restriction (LR) for irrigation. In contrast, in the upstream area of the watershed, two distinct categories were identified. The first category corresponds to station Ech2, which shows moderately restricted (MR) suitability for irrigation. The second category applies to station Ech1, where water is severely restricted (SR) for irrigation.

Fig. 12
figure 12

Characteristics of the water quality index (Meireles et al. 2010)

Discussions

This study revealed significant variations in the physicochemical and biological parameters of water in the Oued Inaouene watershed. These variations reflect the complex interplay between natural and anthropogenic factors influencing water quality. These findings are consistent with other research highlighting the diversity of water characteristics based on geography, geology, human activities, and environmental conditions (Aspinall et al. 2000).

The fluctuations in water pH, showing a slight increase along the river, are likely the result of the combined influence of natural and urban sources in the region. Specifically, due to the leaching of carbonate-rich rocks, bicarbonate (HCO3) levels increase, leading to water alkalinity and a pH above 7 (Kerr et al. 2021). This pH variation is crucial as it can impact water chemistry, metal solubility, and aquatic life. Fluctuations in water temperature throughout the day may be associated with environmental factors such as sunlight exposure and meteorological conditions, as well as contributions from sources in karst environments where temperatures tend to be lower. The high electrical conductivity observed in certain areas, especially near urban zones, indicates substantial water mineralization. This mineralization can result from the presence of concentrated pollutants (Abida and Harikrishna 2008) and leaching from the soil (Bañón et al. 2021). The low concentration of suspended solids downstream can be attributed to dense vegetation cover during the study period, while it increases in urban areas (Pullanikkatil et al. 2015) and in areas where wastewater is discharged into water bodies (Mendie 2005). However, a high Chemical Oxygen Demand (COD) is a cause for concern, as it likely indicates the presence of oxidizable substances in the water, presumably originating from domestic sewage in the urban areas of Taza and Oued Amlil, thereby revealing the presence of organic pollutants in Inaouene's surface waters (Hamner et al. 2006; Nwenya 2006). Nevertheless, as one moves away from pollution sources, subsequent reductions in COD are observed, suggesting potential dilution by cleaner tributaries.

The increasing water hardness downstream is attributed to the region's geology, with deposits of magnesium and calcium sulfates as well as carbonate-rich soils (Jiang et al. 2020). Consequently, elevated concentrations of calcium and magnesium can exceed drinking water quality standards. The high concentrations of sodium and potassium observed in certain areas, especially near sedimentary terrains, are concerning (Huh et al.1998), dominated by evaporites, clays, and sands. On the other hand, the presence of nitrogen forms in the Inaouene waters, linked to domestic discharges, as well as leaching from fertilized agricultural lands with nitrate-based fertilizers, can lead to high nitrite levels in natural waters (Kazakis et al. 2020). Metal concentrations such as cadmium and chromium exceed the WHO recommended values, emphasizing the need to reduce pollution from these potentially toxic metals (Rahman and Singh 2019).

Bacteriological analysis reveals high germ concentrations, especially at stations Ech1, Ech2, and Ech6, suggesting contamination related to landfills and the input of organic substances of agricultural origin, consistent with other studies on the bacteriological quality of surface waters (Amir 2005). Furthermore, the decreasing gradient of total and fecal coliforms along the watershed highlights the impact of urban activities and dilution near the dam. Fecal streptococci exhibit low concentrations, likely due to their resistance to challenging environmental conditions (Naoura 2012).

The hydrochemical analysis of Oued Inaouene waters, using the Piper diagram, has allowed the distinction of various cationic and anionic facies, revealing the diversity of sources and hydrochemical processes at work in the region. The cationic facies reflect the geological variability of lithostratigraphic formations, with the presence of magnesium-rich dolomitic formations and Triassic terrains characterized by gypsum-salt formations. On the other hand, the anionic facies are predominantly dominated by the chloride facies, resulting from human activities such as industrial and domestic wastewater discharges, solid waste dumping, as well as effluents from the currently operational salt mine. The different cationic and anionic facies contribute to the overall facies composition, reflecting the geological complexity of the region. The diversity of general facies is associated with various geological formations, such as Triassic terrains, clayey and crystalline soils, as well as limestone and calcaro-dolomitic terrains, as documented by Aminiyan and Aminiyan (2020).

As for the total ionic salinity (TIS), the high salinity, particularly at station Ech1, is attributed to prolonged interaction between water and rock. In addition, domestic and industrial discharges have contributed to increased salinity and ion concentrations in this area.

The principal component analysis (PCA) of the physico-chemical parameters of the water samples reveals significant correlations between the variables. Axis F1 is associated with physical parameters such as pH, temperature, electrical conductivity, and certain ions, suggesting important links between these variables. Axis F2 groups together metallic elements, chemical oxygen demand (COD), biochemical oxygen demand (BOD5), and nitrogenous elements, highlighting potential relationships among them. The circular analysis reveals two main groups of parameters. The first is influenced by geological factors, particularly the weathering of carbonate rocks in the Middle Atlas and the Prerif, leading to an increase in the concentration of certain elements, thus affecting the chemical composition of the water resource. The second group is largely influenced by soil leaching due to precipitation. It underscores the mineralization resulting from human activities, especially wastewater discharges from the cities of Taza and Oued Amlil. Additionally, mineralization could also be affected by the interaction of water with nearby geological structures.

The analysis of relationships between microbiological parameters in the water samples reveals a less pronounced correlation between Fecal and Total Coliforms (TC), suggesting a different source of pollution, unlike what is observed with Total Aerobic Mesophilic Flora (TAMF) and Total Coliforms (TC).

The calculation of the WQI along the watershed reveals poor quality, attributed to high concentrations of calcium, magnesium, chemical oxygen demand, and the presence of certain heavy metals such as cadmium and chromium, with levels exceeding acceptable standards at this site. However, an improvement in water quality is observed downstream in the watershed due to the dilution of water from various sources. This dilution reduces pollutant concentrations and, consequently, decreases risks to human health and the ecosystem.

To evaluate the quality of water intended for irrigation, several indices were calculated, and the combination of different irrigation water quality parameters would provide a comprehensive understanding of surface water quality and its suitability for irrigation (Falowo et al. 2017; Abbasnia et al. 2018a, b). In the context of the study conducted in the Inaouene watershed, the Wilcox classification, based on electrical conductivity measurements, was used to assess water quality. The results revealed that most stations downstream of the watershed were suitable for irrigation, displaying acceptable salinity levels (Class C2). However, the upstream station exhibited high salinity, making it unsuitable for irrigation in soils with limited drainage capacity (Class C4). Elevated electrical conductivity can indicate excessive soil salinity, thereby impeding plant growth, altering soil chemical composition, reducing nutrient availability, and increasing osmotic pressure in the soil, making water absorption by plant roots more challenging, resulting in water stress and decreased crop productivity (Batarseh 2017). Furthermore, the evaluation of the SAR and the percentage of sodium (Na%) according to the Richards and Wilcox classifications revealed that the majority of the studied sites exhibited good water quality, characterized by moderate sodium levels, rendering them suitable for irrigation. However, the upstream station, Ech1, stood out due to high salinity, rendering its water unsuitable for irrigation. Elevated sodium levels can lead to excessive sodium accumulation in the soil, causing salinity problems, altering soil structure, reducing permeability, and limiting water infiltration and drainage (El-Rawy et al. 2019).

Based on the analysis results, RSC and RSBC values in the examined watershed were generally high, placing all water samples in the "unsuitable for irrigation" category. High RSC concentration can increase soil pH, negatively affecting nutrient availability for plants and soil structure. Additionally, sodium carbonate can lead to salinity problems by increasing the total salt concentration in the soil. Regarding potential salinity (PS), the levels suggest that all water samples are unsuitable for irrigation, largely due to the high presence of chlorides originating from agricultural runoff and wastewater. Nonetheless, the PI suggests that surface waters in the region are generally suitable for irrigation, with little foreseeable long-term impact on soil permeability.

According to Kelley's analysis, surface water from five sites in Inaouene is considered suitable for irrigation, indicating an acceptable salt level that should not lead to significant issues. However, the upstream station showed a KI value exceeding 1, which may result in soil salinity problems and structural degradation due to high salt concentrations (Taloor et al. 2020). Lastly, the MH index indicates that half of the upstream water samples (Ech1, Ech2, Ech3) are suitable for irrigation, with values below 50. However, downstream sites may have negative consequences on agricultural production and soil alkalinity. The presence of exchangeable sodium in irrigated soil is often associated with an increase in magnesium concentration, which can lead to soil alkalization, reducing its infiltration capacity and impacting crop production.

The Irrigation Water Quality Index (IWQI) was calculated using EC, Na+, Cl, HCO3, and SAR. The analysis of water samples from the Inaouene watershed allowed classifying water quality based on its suitability for irrigation. Upstream, the irrigation water is severely restricted (SR), with high concentrations of sodium and chloride, resulting in high electrical conductivity. This water is recommended for irrigating plants with moderate to high salt tolerance, especially in highly permeable soils that allow efficient drainage, reducing the risk of salt accumulation in the soil (Abbasnia et al. 2018a, b). In contrast, station Ech2 provides moderately restricted (MR) irrigation water, with lower concentrations compared to upstream. This water is suitable for use with soils of low to moderate permeability, and plants capable of tolerating moderate salt content can be grown under these conditions. It is essential to choose crops adapted to these specific soil characteristics and manage salinity. The other stations offer low-restriction (LR) irrigation water, where concentrations decrease further, but salinity is still present. However, it is important to note that this water may pose a risk to salt-sensitive plants. Therefore, it is recommended for irrigating soils with a light texture or moderate permeability (Yildiz and Karakus 2020).

The Inverse Distance Weighting method (IDW) was employed to partition the catchment into segments based on water quality for both drinking and irrigation purposes. The modeling of the WQI and Integrated Irrigation Water Quality Index (IWQI) offer a visual representation of areas where water quality meets desired standards and areas necessitating special attention in terms of water quality management (Fig. 13A, B). These maps enable us to comprehend the variations in irrigation water quality across the geographical region under examination, thereby facilitating effective planning and management of irrigation and water resources.

Fig. 13
figure 13

Spatial distribution of WQI (A) and IWQI (B) in the Inaouene catchment upstream of the Idriss 1st dam

As depicted in Fig. 13A, the WQI water quality indices indicate that 33.33% of samples are classified as excellent for human consumption. These high-quality samples are predominantly situated in the western part of the catchment, notably near the Idriss 1st dam, with samples Ech6 and Ech5 exemplifying this superior water quality. This favorable water quality is attributed to the minimal influence of local anthropogenic and agricultural activities. Conversely, samples Ech2, Ech3, and Ech4, situated in the central regions of the catchment, are considered to be of good quality due to the moderate levels of anthropogenic activity in these areas. However, as we move upstream to the eastern part of the watershed, water quality deteriorates, particularly at Ech1’s station, where degraded water quality can be primarily attributed to intensive anthropogenic activity, notably the proximity of irrigated fields.

The analysis of the IWQI map (Fig. 13B) reveals an improvement in the suitability of irrigation water in the Inaouene watershed when moving from upstream to downstream. In the vicinity of Ech1 and Ech2 to the east, only 33.33% of the water quality is notably poor due to the discharge of industrial and domestic wastewater, solid waste disposal, and the application of pesticides and chemical fertilizers. These anthropogenic inputs disrupt the chemical composition of surface water, subsequently impacting the suitability of water for irrigation. Additionally, water quality exhibits signs of improvement throughout the rest of the watershed, especially closer to the downstream dam in the western region, indicating dilution by various tributaries along the way.

Conclusions

This study employs hydrochemical methodologies, statistical analyses, as well as WQI, Irrigation Water Quality Index (IWQI), and Geographic Information Systems (GIS) techniques to identify and evaluate sources of surface water contamination within the Oued Inaouene watershed, located in northern Morocco. To accomplish this, an extensive analysis of 26 physicochemical and bacteriological parameters was conducted to assess the quality of Inaouene surface water. The results have revealed notable variations in parameter concentrations across different locations. Water quality upstream displayed lower quality, gradually improving as it moved downstream, especially in the vicinity of the dam.

The application of the Piper diagram unveiled distinct water facies, including the chloride-sodium and potassium facies (Ech1), the chloride-sulphate and calcium-magnesium facies (Ech2, Ech4, and Ech5), and the bicarbonate-calcium-magnesium facies (Ech3 and Ech6). Through statistical analysis of the data, correlations between major cations and trace metals were identified, providing insights into both positive and negative associations. These relationships enhanced our understanding of how major cations interact with other trace metals. Additionally, combining physical parameters and anions revealed positive correlations among specific elements. Concerning biological parameters, the study highlighted disparities in the origin of microorganisms and their development, influenced by various factors.

The WQI assessment classified surface waters into two distinct groups. The first group, including Ech2, Ech3, Ech4, Ech5, and Ech6, indicated commendable water quality. In contrast, the second group represented by Ech1 exhibited lower water quality. Assessing water suitability for irrigation based on parameters such as SAR, EC, % Na, MH, PI, and KI showed that most samples met irrigation criteria, except for Ech1, which did not meet the standards. However, considering RSC, PS, and RSBC indices, it was evident that water across all samples was not suitable for irrigation. The analysis of these parameters using the Irrigation Water Quality Index (IWQI) revealed that the majority of samples fell under the category of low restriction (LR). Nonetheless, Ech2's sample exhibited moderate restriction (MR), while Ech1's sample had severe restriction (SR). The application of these integrated methods has demonstrated their effectiveness and reliability in evaluating surface water quality in the Oued Inaouene watershed. It emphasizes the growing need to conserve water resources, especially in light of the observed deterioration in aquatic ecosystems and suggests the establishment of treatment plants and controlled landfill sites in Taza and Oued Amlil towns to address these critical concerns.