Using a Mamdani Fuzzy Inference System Model (MFISM) for Ranking Groundwater Quality in an Agri-Environmental Context: Case of the Hammamet-Nabeul Shallow Aquifer (Tunisia)

: Using an adaptive Mamdani fuzzy inference system model (MFSIM), the purpose of this paper is mainly to assess and rank the assessment and ranking of water quality for irrigation occurring in the Hammamet-Nabeul (Tunisia) shallow aquifer. This aquifer is under Mediterranean climate conditions and affected by intensive and irrational agricultural activities. In the current study, the Mamdani fuzzy logic-based decision-making approach was adapted to classify groundwater quality (GW) for irrigation. The operation of the fuzzy model is based on the input membership functions of electrical conductivity (EC) and sodium absorption ratio (SAR) and on the output membership function of the irrigation water quality index (IWQI). Validation of the applied MFISM showed a rate of about 80%. Therefore, MFISM was shown to be reliable and ﬂexible in quality ranking for irrigation in an uncertain and complex hydrogeological system. The results demonstrated that water quality contamination in the aquifer is affected by the overlaying of three types of negative anthropogenic practices: the excess use of water for irrigation and chemical fertilizers, and the rejection of partially treated wastewater in some areas. The implemented approach led to identifying the spatial distribution of water quality for irrigation in the studied area. It is considered a helpful tool for water agri-environmental sustainability and management.


Introduction
Groundwater is a major contributor to abstraction for agriculture uses. In view of the increasing number of human populations, agricultural development is expected to aggravate the conflict between water supply and demand. Groundwater (GW) quality assessment is considered a very important component of water resources sustainability. Generally, the quality of GW is related to changes in its chemical composition, it is controlled by many factors, including the following: rock-water interactions, seawater intrusion, and water mixing between aquifers [1]. Along with these processes, water-borne pathogens and, toxic and nontoxic pollutants, are the major water quality parameters [2]. The climate of the study area is semiarid to arid, characterized by long hot sum and short cold winters with a mean annual rainfall of 425 mm. The potential evap spiration is approximately 1166 mm/year. The mean annual temperature is approxim 19° [29].
From a geological point of view, the oldest outcropping formations are in the Eocene age and the most recent are in the Quaternary age [34]. This later covers a the entire basin with mainly sandy clayey deposits.
The HN region is limited by two main structures, the Oriental coastal plain eastern part and the Grombalia basin with NNW-SSE direction in its western part. structures are the result of the movement between the African and the Eurasian [35]. The structures of the NE-SW fold are the result of the Pliocene-Quaternary te activities. These are combined with E-W to N120 dextral reverse faults and NE-SW [35].
The HN main aquifers consist of four principal entities: the Plio-Quaternary aq the Miocene aquifer, the Oligocene aquifer and the Eocene aquifer [32]. However, th important regional shallow aquifer is the Plio-Quaternary, which covers an area of 110 km 2 and is the purpose of this study. In fact, the thickness of this aquifer vari tween 20 and 300 m and it is mostly sandy clayey as mentioned in the hydrogeol chart as presented in Figure 2 [32]. Hydraulic conductivity is between 0.5 × 10 −5 m 0.6 × 10 −5 m / s, while transmissivity values range from 0.4 × 10 −4 m 2 /s to 2.5 × 10 −3 m 2 / The piezometric levels range from 0 to 55 m, as indicated in Figure 3. At the le the HN plain, the recharge of the shallow aquifer is carried out by the direct infiltrat The climate of the study area is semiarid to arid, characterized by long hot summers and short cold winters with a mean annual rainfall of 425 mm. The potential evapotranspiration is approximately 1166 mm/year. The mean annual temperature is approximately 19 • [29].
From a geological point of view, the oldest outcropping formations are in the lower Eocene age and the most recent are in the Quaternary age [34]. This later covers almost the entire basin with mainly sandy clayey deposits.
The HN region is limited by two main structures, the Oriental coastal plain in its eastern part and the Grombalia basin with NNW-SSE direction in its western part. These structures are the result of the movement between the African and the Eurasian plates [35]. The structures of the NE-SW fold are the result of the Pliocene-Quaternary tectonic activities. These are combined with E-W to N120 dextral reverse faults and NE-SW faults [35].
The HN main aquifers consist of four principal entities: the Plio-Quaternary aquifer, the Miocene aquifer, the Oligocene aquifer and the Eocene aquifer [32]. However, the most important regional shallow aquifer is the Plio-Quaternary, which covers an area of about 110 km 2 and is the purpose of this study. In fact, the thickness of this aquifer varies between 20 and 300 m and it is mostly sandy clayey as mentioned in the hydrogeological chart as presented in Figure 2 [32]. Hydraulic conductivity is between 0.5 × 10 −5 m/s and 0.6 × 10 −5 m/s, while transmissivity values range from 0.4 × 10 −4 m 2 /s to 2.5 × 10 −3 m 2 /s [27]. rainwater through the unsaturated zone. Wadis also contribute to the recharge of the water table by the surface water collected at the level of the border reliefs. The contributions of these wadis are important, in particular in the eastern part of the basin.   The piezometric levels range from 0 to 55 m, as indicated in Figure 3. At the level of the HN plain, the recharge of the shallow aquifer is carried out by the direct infiltration of rainwater through the unsaturated zone. Wadis also contribute to the recharge of the water table by the surface water collected at the level of the border reliefs. The contributions of these wadis are important, in particular in the eastern part of the basin.

Sampling and Chemical Analyses
To perform the present work, a total of thirty water samples from water wells tapping shallow aquifers are investigated ( Figure 1). These wells are used by inhabitants or by the Regional Commission for Agricultural Development of Nabeul. The water samples were collected in two clean 0.5L bottles. All of the water samples were taken from the continuously used surface wells. In situ, the samples were measured for pH, EC, and temperature. Before laboratory analysis, the samples were stored at a temperature below 4 • C. The chemical analyses were performed in the Laboratory of Radio Analyses and Environment (LRAE) in the National School of Engineers (Sfax, Tunisia). Analysis of the main elements (Cl − , SO 4 2− , HCO 3 − , NO 3 2− , Na + , Mg 2+ ) was performed using HPLC Waters equipped with IC-Pak TM CM/D columns for cations, using EDTA and nitric acid as eluent, and on a Metrohm chromatograph equipped with CI SUPER-SEP columns for anions, using phthalic acid and acetonitrile as eluent. Total dissolved solids (TDS) measurements were performed by evaporating 100 mL of groundwater sample at 105 • C for 24 h.

Individual Parameters
The quality of GW is studied through five indices such as in [8,36]: electrical conductivity (EC), permeability index (PI), sodium adsorption ratio (SAR), sodium percent (%Na) and magnesium hazard (%MH). The detail of each index is mentioned in Table 1. Firstly, the determination of salinity content is carried out by EC calculation in order to identify the effects on soil. Second, the PI, which is expressed in Equation (1), is used to assess the GW for irrigation. The excess sodium concentration in GW affects the properties of the soil and reduces the soil permeability; therefore, SAR should be calculated. This ratio, expressed in Equation (2), measures the risk of alkali-sodium for crops and informs about the tendency of water to cation exchange reactions in the soil. Third, MH, which is expressed in Equation (3), is one of the most important qualitative criteria for assessing the quality of GW quality for irrigation [7]. Excess magnesium affects soil quality and can decrease productivity [39]. Finally, the %Na presents a relevant factor to assess the water quality for agricultural purposes. This index is calculated according to Equation (4) which is expressed as the percentage of sodium and potassium compared to all cationic concentrations [40,41].

Fuzzy Logic Model Background
The Fuzzy Logic Model was introduced by Zadeh in 1965 [17] in order to create systems closer to human thinking. According to many previous works such as in [20,21] and [24], this method was proven to be efficient in treating complex systems under uncertain conditions. A fuzzy controller system consists of three operations: fuzzification, inference and defuzzification as shown in Figure 4. In the Fuzzy Inference System (FIS), human knowledge is presented as a set of fuzzy linguistic rules that would make approximate decisions. In fact, the human expert can be replaced by a combination of a fuzzy rule-based system (FRBS) and a block called a defuzzifier.

Fuzzy Logic Model Background
The Fuzzy Logic Model was introduced by Zadeh in 1965 [17] in order to create systems closer to human thinking. According to many previous works such as in [20,21] and [24], this method was proven to be efficient in treating complex systems under uncertain conditions. A fuzzy controller system consists of three operations: fuzzification, inference and defuzzification as shown in Figure 4. In the Fuzzy Inference System (FIS), human knowledge is presented as a set of fuzzy linguistic rules that would make approximate decisions. In fact, the human expert can be replaced by a combination of a fuzzy rulebased system (FRBS) and a block called a defuzzifier.

Fuzzification: Membership Functions
Fuzzification is the process of decomposing a system input and/or output into one or more fuzzy sets. A fuzzy set is defined in terms of a membership function that maps the domain of interest, e.g., concentrations of major elements, onto the interval [0,1]. The shape of the curves shows the membership function for each set (it can be expressed in various forms such as trapezoidal, triangular, Gaussian, etc.). In fact, the membership function represents the degree, or weighting, that the specified value belongs to the set [24].
The membership function of set A defined over a domain X takes the form: The set A is defined in terms of its membership μ function by the Equation (5) if x is partial member of = 0, if x is not member of The fuzzy set for a trapezoidal membership function f is developed according to Equation (6).

Fuzzification: Membership Functions
Fuzzification is the process of decomposing a system input and/or output into one or more fuzzy sets. A fuzzy set is defined in terms of a membership function that maps the domain of interest, e.g., concentrations of major elements, onto the interval [0, 1]. The shape of the curves shows the membership function for each set (it can be expressed in various forms such as trapezoidal, triangular, Gaussian, etc.). In fact, the membership function represents the degree, or weighting, that the specified value belongs to the set [24].
The membership function of set A defined over a domain X takes the form: The set A is defined in terms of its membership µ function by the Equation (5) Water 2021, 13, 2507 7 of 22 The fuzzy set for a trapezoidal membership function f is developed according to Equation (6).
In this work, a trapezoidal fuzzy logic function is used as in [14]. The trapezoidal curve ( Figure 5) is a function of a vector, x, and depends on four scalar parameters a, b, c and d, as given by Equation (6). Parameters for membership function used in the fuzzy inference system are a and d located in the "feet" of the trapezoid and the parameters b and c located in the "shoulders".
In this work, a trapezoidal fuzzy logic function is used as in [14]. The trapezoidal curve ( Figure 5) is a function of a vector, x, and depends on four scalar parameters a, b, c and d, as given by Equation (6). Parameters for membership function used in the fuzzy inference system are a and d located in the "feet" of the trapezoid and the parameters b and c located in the "shoulders".

Inference Rules
The inference rules reflect the relationships between the subsets of the inputs and the outputs. Inferences rules should produce a new output subset. Each rule is composed of two parts: the "if" part and the "then" part. For more details about these rules, the reader can consult Ross [42].

Defuzzification
The defuzzification procedure is the final step in FIS processing. This process allows one to convert the results obtained as fuzzy sets into numerical values. The center of gravity, the average of the maximums and the smallest of the maximums are widely used as defuzzification methods [15].

USSL Diagram
The USSL diagram is a well-known diagram for classifying irrigation water [38,43]. This diagram shows both risk effects of sodium and salinity, using the SAR and the EC values as coordinates [38], the corresponding points are located on the diagram indicating the water quality class. Water samples are grouped into 16 classes as mentioned in Figure  6.

Inference Rules
The inference rules reflect the relationships between the subsets of the inputs and the outputs. Inferences rules should produce a new output subset. Each rule is composed of two parts: the "if" part and the "then" part. For more details about these rules, the reader can consult Ross [42].

Defuzzification
The defuzzification procedure is the final step in FIS processing. This process allows one to convert the results obtained as fuzzy sets into numerical values. The center of gravity, the average of the maximums and the smallest of the maximums are widely used as defuzzification methods [15].

USSL Diagram
The USSL diagram is a well-known diagram for classifying irrigation water [38,43]. This diagram shows both risk effects of sodium and salinity, using the SAR and the EC values as coordinates [38], the corresponding points are located on the diagram indicating the water quality class. Water samples are grouped into 16 classes as mentioned in Figure 6.

Hydrochemical Results
The results of the chemical analysis are summarized in Table 2. The ionic balance for all samples in this study is within 5%. The geochemistry of HN shallow water is dominated by sodium chloride (Na-Cl) and slightly (Ca-SO4) facies ( Figure 7). This is corroborated by saturation indices distribution ( Figure 8). In fact, all samples show negative indices with respect to mainly Halite and secondly gypsum, indicating undersaturation and dissolution of these minerals. Indeed, some samples show the dominance of sodium, which, for the vast majority, exceed 60% of the wells, while the others show a trend towards the mixed water type. On the other hand, the majority of the samples indicate the predominance of chloride whose grades can exceed 70% with a slight tendency towards the mixed water type. (Ca2 + ) can be affected by cation exchange and the calcite equilibrium [6]. Concentrations of Cl and partly SO42 anions increase in the coastal aquifer, probably due to seawater intrusion.

Hydrochemical Results
The results of the chemical analysis are summarized in Table 2. The ionic balance for all samples in this study is within 5%. The geochemistry of HN shallow water is dominated by sodium chloride (Na-Cl) and slightly (Ca-SO 4 ) facies ( Figure 7). This is corroborated by saturation indices distribution ( Figure 8). In fact, all samples show negative indices with respect to mainly Halite and secondly gypsum, indicating undersaturation and dissolution of these minerals. Indeed, some samples show the dominance of sodium, which, for the vast majority, exceed 60% of the wells, while the others show a trend towards the mixed water type. On the other hand, the majority of the samples indicate the predominance of chloride whose grades can exceed 70% with a slight tendency towards the mixed water type. (Ca 2+ ) can be affected by cation exchange and the calcite equilibrium [6]. Concentrations of Cl and partly SO 4 2− anions increase in the coastal aquifer, probably due to seawater intrusion.
Furthermore, the order of the relative abundance of major cations in GW of the shallow water of HN is Na + > Ca 2+ > Mg 2+ their concentrations represent an average of 57%, 29%, and 14%, respectively. Concerning anions, the order of their contribution is Cl − > SO 4 2− > HCO 3 − > NO 3 2− with percentages of 35%, 32%, 24% and 9%, respectively.  Furthermore, the average ratios between Ca/Na (0.69), Mg/Na (0.54) and HCO3/Na (0.54) suggest that the chemical composition of the reservoir is mainly under the combined influence of evaporation and silicate weathering [44] (Figure 9), as carbonate-dominated reservoirs have a Ca / Na ratio around 50, Mg/Na around 10 and HCO3 − /Na ratio near to 120 [45][46][47]. At the average, the ((Na/K)/∑(+)) ratio of 0.46 (with ∑(+) represents total cations) also confirms that silicate weathering might be the major source of cations [48]. Furthermore, the area is characterized by a semi-arid climate with a high rate of evaporation leading to the formation of salt layers which are leached from the soil surface to formation waters through circulating water. The high irrigation activities of the area are also responsible for the increase in salinity of GW. In fact, irrigation increases the salinity of irrigation return flow from three to ten times that of applied water [49].   Furthermore, the average ratios between Ca/Na (0.69), Mg/Na (0.54) and HCO3/Na (0.54) suggest that the chemical composition of the reservoir is mainly under the combined influence of evaporation and silicate weathering [44] (Figure 9), as carbonate-dominated reservoirs have a Ca / Na ratio around 50, Mg/Na around 10 and HCO3 − /Na ratio near to 120 [45][46][47]. At the average, the ((Na/K)/∑(+)) ratio of 0.46 (with ∑(+) represents total cations) also confirms that silicate weathering might be the major source of cations [48]. Furthermore, the area is characterized by a semi-arid climate with a high rate of evaporation leading to the formation of salt layers which are leached from the soil surface to formation waters through circulating water. The high irrigation activities of the area are also responsible for the increase in salinity of GW. In fact, irrigation increases the salinity of irrigation return flow from three to ten times that of applied water [49]. Furthermore, the average ratios between Ca/Na (0.69), Mg/Na (0.54) and HCO 3 /Na (0.54) suggest that the chemical composition of the reservoir is mainly under the combined influence of evaporation and silicate weathering [44] (Figure 9), as carbonate-dominated reservoirs have a Ca / Na ratio around 50, Mg/Na around 10 and HCO 3 − /Na ratio near to 120 [45][46][47]. At the average, the ((Na/K)/∑(+)) ratio of 0.46 (with ∑(+) represents total cations) also confirms that silicate weathering might be the major source of cations [48]. Furthermore, the area is characterized by a semi-arid climate with a high rate of evaporation leading to the formation of salt layers which are leached from the soil surface to formation waters through circulating water. The high irrigation activities of the area are also responsible for the increase in salinity of GW. In fact, irrigation increases the salinity of irrigation return flow from three to ten times that of applied water [49].

Impact of Agricultural Activities
Agriculture has been a major influence on the economy of many areas for centuries [50], especially in arid and semi-arid regions such as Tunisia. Olive, almond and fig trees dominate agricultural lands in the study area. At the end of the nineteenth century, irrigation was introduced and became more and more intensive. Horticulture and citriculture are the dominant land use in Cap Bon Tunisia, particularly in the HN region [51]. In terms of nitrate, Figure 10 perfectly demonstrates the same behavior between the NO3/Ca and NO3/SO4 ratios in all samples. These two ratios are calculated to test the impact of the fertilizer on GW composition. In fact, a general excess of both Ca and SO4 is indicated by NO3/Ca and NO3/SO4 ratios below 1 except in boreholes n° 1, 4, 5, 8, 15, 23, 25 and 27. The excess of NO3 in these locations may derive from the excessive use of fertilizers especially with the chemical formula the Ca(NO3)2, (NH4)2SO4 as presented by [27,52].
Moreover, these observations belonging to areas with the highest concentrations of nitrate are located in irrigated perimeters ( Figure 11).

Impact of Agricultural Activities
Agriculture has been a major influence on the economy of many areas for centuries [50], especially in arid and semi-arid regions such as Tunisia. Olive, almond and fig trees dominate agricultural lands in the study area. At the end of the nineteenth century, irrigation was introduced and became more and more intensive. Horticulture and citriculture are the dominant land use in Cap Bon Tunisia, particularly in the HN region [51]. In terms of nitrate, Figure 10 perfectly demonstrates the same behavior between the NO 3 /Ca and NO 3 /SO 4 ratios in all samples.

Impact of Agricultural Activities
Agriculture has been a major influence on the economy of many areas for centuries [50], especially in arid and semi-arid regions such as Tunisia. Olive, almond and fig trees dominate agricultural lands in the study area. At the end of the nineteenth century, irrigation was introduced and became more and more intensive. Horticulture and citriculture are the dominant land use in Cap Bon Tunisia, particularly in the HN region [51]. In terms of nitrate, Figure 10 perfectly demonstrates the same behavior between the NO3/Ca and NO3/SO4 ratios in all samples. These two ratios are calculated to test the impact of the fertilizer on GW composition. In fact, a general excess of both Ca and SO4 is indicated by NO3/Ca and NO3/SO4 ratios below 1 except in boreholes n° 1, 4, 5, 8, 15, 23, 25 and 27. The excess of NO3 in these locations may derive from the excessive use of fertilizers especially with the chemical formula the Ca(NO3)2, (NH4)2SO4 as presented by [27,52].
Moreover, these observations belonging to areas with the highest concentrations of nitrate are located in irrigated perimeters ( Figure 11). These two ratios are calculated to test the impact of the fertilizer on GW composition. In fact, a general excess of both Ca and SO 4 is indicated by NO 3 /Ca and NO 3 /SO 4 ratios below 1 except in boreholes n • 1, 4, 5, 8, 15, 23, 25 and 27. The excess of NO 3 in these locations may derive from the excessive use of fertilizers especially with the chemical formula the Ca(NO 3 ) 2 , (NH 4 ) 2 SO 4 as presented by [27,52].
Moreover, these observations belonging to areas with the highest concentrations of nitrate are located in irrigated perimeters ( Figure 11).

Using Individual Parameters
Classification of GW quality for irrigation based on individual parameters as EC, PI, SAR, MH and%Na, allows obtaining the following results (Table 3). In this study, 54% of the water samples belong to the very high salinity class, 43% of the area belongs to the high salinity, and 3% of the water samples indicate a moderate rate of salinity (Figure 12). High salinity values (>750 μS/cm) are recorded in (1) downstream of the aquifer (water-rock interaction), (2) in the irrigation perimeter in the west of the study area where there is a return flow (wells n° 22,26), which contributes to the increase on water and soil, (3) in the two sides of Wadi Souhil (in the east of the study area). In fact, the bottom of the Wadi Souhil is characterized by the abundance of sandy soil that is sufficiently permeable to allow the infiltration of surface water, which contributes to the recharge of the aquifer. As a result, the bed of this Wadi is considered a good site of artificial recharge by treated wastewater (TWW) [28]. In this context, although reuse of TWW for

Using Individual Parameters
Classification of GW quality for irrigation based on individual parameters as EC, PI, SAR, MH and%Na, allows obtaining the following results (Table 3). In this study, 54% of the water samples belong to the very high salinity class, 43% of the area belongs to the high salinity, and 3% of the water samples indicate a moderate rate of salinity (Figure 12). High salinity values (>750 µS/cm) are recorded in (1) downstream of the aquifer (water-rock interaction), (2) in the irrigation perimeter in the west of the study area where there is a return flow (wells n • 22, 26), which contributes to the increase on water and soil, (3) in the two sides of Wadi Souhil (in the east of the study area). In fact, the bottom of the Wadi Souhil is characterized by the abundance of sandy soil that is sufficiently permeable to allow the infiltration of surface water, which contributes to the recharge of the aquifer. As a result, the bed of this Wadi is considered a good site of artificial recharge by treated wastewater (TWW) [28]. In this context, although reuse of TWW for agricultural purposes can be a sustainable solution to water scarcity, as in [29,[53][54][55], the effluent must be continuously monitored to avoid contamination, which is not the case in the present zone [28]. So, the very high salinity recorded in wells n • 11, 17, 25, 27, 29 (>2250 µS/cm), located in both sides of the Souhil Wadi, may be attributed to the rejection of partially treated wastewater in this Wadi.

• PI
In this study, the values of the permeability index (PI) values range from 37.43 to 64.23%. All PI values are included between 25 and 75%, showing that the water belongs to class II related to suitable quality for irrigation (Table 1).
• SAR This ratio shows values ranging from 1.53 to 11.92. Then, 20% of water samples are suitable for irrigation, 77% of samples belong to the moderate class and 3% of water samples are unsuitable for irrigation. Mapping based on the kriging technique shows the spatial distribution of this parameter in the HN aquifer ( Figure 13). Areas with maximum values corroborate the cultivated area and with maximum NO 3 values. This is in agreement with the impact of agricultural activities in the study area.

• MH
In the study area, approximately 94% of the water samples show MH values less than 50%. So, these waters are suitable for irrigation. Whereas, the remained samples (6% with an MH > 50% are unsuitable for irrigation.

• %Na
In this study, the % Na values range from 29.47% to 60.21%. A total of 27% of the water samples are good for irrigation while 3% are doubtful and 70% are permissible for irrigation (Table 3).  Moreover, statistical analysis is performed to identify the most relevant parameters intervening in the IWQI. In fact, according to the average values ( Table 4). The highest parameter on average is the PI (average = 49.22%). This indicates that this parameter represents the greatest risk on water quality [36].
Furthermore, Table 4 shows that the SAR and EC variables highly contribute greatly to the variability of water quality for irrigation (VC = 46.55% and 49.28%, respectively).

IWQ Ranking Using the USSL Diagram
Obtained results and the projection of water points in the USSL diagram ( Figure 14) showed that almost all the GW samples have very high salinity and alkalinity hazard values. Water quality could be categorized into classes C4S4 and C4S3 (very bad), C4S2 (bad), (C3S1) (medium), and C2S1 (good). They accounted for 20%, 33.33%, 43.33% and 3.33%, respectively, of the total water samples. For samples, which were classified as C4S2 and C4S3 and C4S4 with a very high salinity hazard, the GW does not indicate that the GW is not suitable for irrigating soils. Samples belonging to category C3S1 with a high salinity hazard could be used to irrigate soils with good permeability [55]. While the sample alone (n°12) which is classified as C2S1 is considered safe for irrigation use. It belongs upstream of the aquifer corresponding to the lowest concentration of salinity. Moreover, statistical analysis is performed to identify the most relevant parameters intervening in the IWQI. In fact, according to the average values ( Table 4). The highest parameter on average is the PI (average = 49.22%). This indicates that this parameter represents the greatest risk on water quality [36].
Furthermore, Table 4 shows that the SAR and EC variables highly contribute greatly to the variability of water quality for irrigation (VC = 46.55% and 49.28%, respectively).

IWQ Ranking Using the USSL Diagram
Obtained results and the projection of water points in the USSL diagram ( Figure 14) showed that almost all the GW samples have very high salinity and alkalinity hazard values. Water quality could be categorized into classes C4S4 and C4S3 (very bad), C4S2 (bad), (C3S1) (medium), and C2S1 (good). They accounted for 20%, 33.33%, 43.33% and 3.33%, respectively, of the total water samples. For samples, which were classified as C4S2 and C4S3 and C4S4 with a very high salinity hazard, the GW does not indicate that the GW is not suitable for irrigating soils. Samples belonging to category C3S1 with a high salinity hazard could be used to irrigate soils with good permeability [55]. While the sample alone (n • 12) which is classified as C2S1 is considered safe for irrigation use. It belongs upstream of the aquifer corresponding to the lowest concentration of salinity.

Classification of IWQ Using MFISM According to the Determination of the Membership Function Determination
In this research, MFISM is performed using the fuzzy logic toolbox of MATLAB (7.0). It was selected for the evaluation and classification of the quality samples available from GW for irrigation purposes. According to the statistical analyses described above, the two inputs EC and SAR are selected to express irrigation water quality for irrigation (IWQI), which is the output of the MFISM (Figure 15). The model is used to evaluate and classify the IWQI samples in the HN shallow aquifer. Based on the membership functions considered for inputs, the MFISM has 4 × 4 = 16 rules.

Classification of IWQ Using MFISM According to the Determination of the Membership Function Determination
In this research, MFISM is performed using the fuzzy logic toolbox of MATLAB (7.0). It was selected for the evaluation and classification of the quality samples available from GW for irrigation purposes. According to the statistical analyses described above, the two inputs EC and SAR are selected to express irrigation water quality for irrigation (IWQI), which is the output of the MFISM (Figure 15). The model is used to evaluate and classify the IWQI samples in the HN shallow aquifer. Based on the membership functions considered for inputs, the MFISM has 4 × 4 = 16 rules. In this research, MFISM is performed using the fuzzy logic toolbox of MATLAB (7.0). It was selected for the evaluation and classification of the quality samples available from GW for irrigation purposes. According to the statistical analyses described above, the two inputs EC and SAR are selected to express irrigation water quality for irrigation (IWQI), which is the output of the MFISM (Figure 15). The model is used to evaluate and classify the IWQI samples in the HN shallow aquifer. Based on the membership functions considered for inputs, the MFISM has 4 × 4 = 16 rules. Membership functions were assigned to two variables inputs (EC and SAR) and one output (IWQI = WQ).
Inputs' membership function for EC variable; The EC values are classified as follows ( Figure 17 The SAR values are classified as follows ( Figure 16): The EC values are classified as follows ( Figure 17): Figure 17. EC membership function. The SAR values are classified as follows ( Figure 16): The output membership function was chosen for the IWQI evaluation ( Figure 18).  To display the interaction between input variables and their contribution to the output variable evolution, the fuzzy surface is used as a three-dimensional view graphical user interface (GUI) tool ( Figure 19). It shows that the lowest are the "SAR" and "EC" values, the highest is the IWQI. Therefore, the GW quality for irrigation is better. Figure 19. Three-dimensional view graphical user interface of membership in MFISM in the study area.

Classification of IWQ Using MFISM According to the Fuzzy Rules' Determination
In the Mamdani fuzzy inference system, the rules (If/and/then) are the representation of the experts' knowledge and opinion on the classification of water quality for irrigation purposes referring to IWQI (WQ), following four classes of the two parameters: SAR and EC. Therefore, rules based on expert knowledge for the presented model consist of 16 rules (Figure 20). To display the interaction between input variables and their contribution to the output variable evolution, the fuzzy surface is used as a three-dimensional view graphical user interface (GUI) tool ( Figure 19). It shows that the lowest are the "SAR" and "EC" values, the highest is the IWQI. Therefore, the GW quality for irrigation is better. To display the interaction between input variables and their contribution to the output variable evolution, the fuzzy surface is used as a three-dimensional view graphical user interface (GUI) tool ( Figure 19). It shows that the lowest are the "SAR" and "EC" values, the highest is the IWQI. Therefore, the GW quality for irrigation is better. Figure 19. Three-dimensional view graphical user interface of membership in MFISM in the study area.

Classification of IWQ Using MFISM According to the Fuzzy Rules' Determination
In the Mamdani fuzzy inference system, the rules (If/and/then) are the representation of the experts' knowledge and opinion on the classification of water quality for irrigation purposes referring to IWQI (WQ), following four classes of the two parameters: SAR and EC. Therefore, rules based on expert knowledge for the presented model consist of 16 rules (Figure 20).

Classification of IWQ Using MFISM According to the Fuzzy Rules' Determination
In the Mamdani fuzzy inference system, the rules (If/and/then) are the representation of the experts' knowledge and opinion on the classification of water quality for irrigation purposes referring to IWQI (WQ), following four classes of the two parameters: SAR and EC. Therefore, rules based on expert knowledge for the presented model consist of 16 rules ( Figure 20).

Model Validation with USSL Diagram after Defuzzification
During the defuzzification step, the score assigned for IQWI ranges from 0 to 1. The closer this score is to 1, the more the quality of irrigation water quality (Table 5). An important step in the development of the model is the assessment of the concordance between the results obtained by the MFISM and the knowledge of experts. This means that the system must provide an adequate answer to the different conditions that may be introduced. The comparison between the results of the USSL diagram and those of MFISM in (Table 5) showed that the MFISM is proven as an efficient method for ranking water quality with 79.78% general agreement. Besides, the overview of the table demonstrates that MFIS allows improving GW quality ranking. For example, in the USSL classification, samples n° 7, 20 are "100% medium" class, while they are modified to "80% medium and 20% bad" type following the MFISM. The same reasoning is valid for points 26 and 27 which belong to the class "100%very bad" according to the USSL diagram. Though, they are 10% and 17% very bad, respectively, following the MFISM. So, thanks to MFSIM, a new more exact ranking for IQWI is created.

Model Validation with USSL Diagram after Defuzzification
During the defuzzification step, the score assigned for IQWI ranges from 0 to 1. The closer this score is to 1, the more the quality of irrigation water quality (Table 5). An important step in the development of the model is the assessment of the concordance between the results obtained by the MFISM and the knowledge of experts. This means that the system must provide an adequate answer to the different conditions that may be introduced. The comparison between the results of the USSL diagram and those of MFISM in (Table 5) showed that the MFISM is proven as an efficient method for ranking water quality with 79.78% general agreement. Besides, the overview of the table demonstrates that MFIS allows improving GW quality ranking. For example, in the USSL classification, samples n • 7, 20 are "100% medium" class, while they are modified to "80% medium and 20% bad" type following the MFISM. The same reasoning is valid for points 26 and 27 which belong to the class "100%very bad" according to the USSL diagram. Though, they are 10% and 17% very bad, respectively, following the MFISM. So, thanks to MFSIM, a new more exact ranking for IQWI is created.

Mapping Spatial Distribution of Water Quality for Irrigation Purpose
Finally, mapping IWQI based on the MFISM allows identifying two zones ( Figure 21) (A) and (B): Zone (A) is located in the West of the study area, influenced by irrigation return flow and by flushing fertilizers in excess. Zone (B) is situated on both sides of the Souhil Wadi affected mainly by infiltration of partially treated wastewater through the Wadi. This water is enriched with nutritive elements; hence, it is characterized by a high level of NO3, EC, and SAR. In fact, spatial variation of these parameters is in good agreement with the IQWI assessment (Figures 11-13 and 21).

Conclusions
The assessment of GW quality in the Hammamet-Nabeul shallow aquifer was performed based on the hydrochemical characteristics. The results show that the mineralization of GW is mainly highlighted by the leaching of minerals, basically hyalite and Gypsum. The high GW salinity rate expressed on electrical conductivity can be attributed to excess irrigation return flow combined with evaporation and leaching fertilizer. In fact, high NO3 contents are related to (i) the return of irrigation water, (ii) intensive use of artificial fertilizers, especially on agricultural land, and (iii) rejection of partially treated wastewater in Wadi Souhil. It should be noted that treated wastewater can be used for irrigation with respect to optimal quantity values for the plant and with permanent biological control of effluent quality to avoid contamination.
The water quality for irrigation was evaluated in two ways: (i) individual parameters (EC, SAR, Na%, MH, and PI), (ii) Mamdani fuzzy logic inference model (MFSIM) based on irrigation water quality index (IWQI) calculation. The model built based on EC and SAR emerged as the most significant for parameters in water quality for irrigation evaluation. It was developed using the trapezoidal membership function and defining sixteen rules. With 80% agreement between the MFISM results of MFISM and USSL diagram in 30 wells, the results revealed that the MFISM is useful for improving the ranking water quality by creating new classes in the same class defined previously by the USSL diagram. In addition, it helps minimize the probable errors and uncertainties caused by the field data and hydrochemical analyses. Furthermore, the IWQI that was successfully simulated with MFISM could provide even more reliable and confidential results. In fact, this accurate model can be extended by using additional parameters. Current IWQI spatial distribution could be enhanced by using an integrated Fuzzy-GIS system. This study provides a reference point for future studies of the hydrochemical characteristics and GW quality in other similar areas. It could be helpful in the task of decision-making for building strategic plans for water resources management and sustainability.

Conclusions
The assessment of GW quality in the Hammamet-Nabeul shallow aquifer was performed based on the hydrochemical characteristics. The results show that the mineralization of GW is mainly highlighted by the leaching of minerals, basically hyalite and Gypsum. The high GW salinity rate expressed on electrical conductivity can be attributed to excess irrigation return flow combined with evaporation and leaching fertilizer. In fact, high NO 3 contents are related to (i) the return of irrigation water, (ii) intensive use of artificial fertilizers, especially on agricultural land, and (iii) rejection of partially treated wastewater in Wadi Souhil. It should be noted that treated wastewater can be used for irrigation with respect to optimal quantity values for the plant and with permanent biological control of effluent quality to avoid contamination.
The water quality for irrigation was evaluated in two ways: (i) individual parameters (EC, SAR, Na%, MH, and PI), (ii) Mamdani fuzzy logic inference model (MFSIM) based on irrigation water quality index (IWQI) calculation. The model built based on EC and SAR emerged as the most significant for parameters in water quality for irrigation evaluation. It was developed using the trapezoidal membership function and defining sixteen rules. With 80% agreement between the MFISM results of MFISM and USSL diagram in 30 wells, the results revealed that the MFISM is useful for improving the ranking water quality by creating new classes in the same class defined previously by the USSL diagram. In addition, it helps minimize the probable errors and uncertainties caused by the field data and hydrochemical analyses. Furthermore, the IWQI that was successfully simulated with MFISM could provide even more reliable and confidential results. In fact, this accurate model can be extended by using additional parameters. Current IWQI spatial distribution could be enhanced by using an integrated Fuzzy-GIS system. This study provides a reference point for future studies of the hydrochemical characteristics and GW quality in other similar areas. It could be helpful in the task of decision-making for building strategic plans for water resources management and sustainability.