Variability effect of hydrological regime on river quality pattern and its uncertainties: case study of Zarjoob River in Iran

River water quality assessment, affected by pollution load, and river regime changes in various climate conditions, is an implementation that simplifies water resources management, and justifies terms for increases or decreases in human activities. The current paper aims to offer a water quality model of a river considering parametric, hydrologic, and pollution load uncertainty by using uncertainty indexes like Plevel, ARIL, and NUE. These indexes were used to analyze the influences of the model’s parameters and the river’s regime alternations on the results. A Qual2K model, calibrated with PSO algorithm, is presented and connected to GLUE algorithm to assess the model’s uncertainties like effective input parameters on the modeled variations, headwater flow, and input pollutions. Zarjoob River, in the north of Iran, was chosen as the case study. The results illustrate that the interaction among parameters, hydrologic and pollutant discharge data should be considered in river water quality simulation. The presented methodology can analyze the influences of parametric uncertainty, parametric and hydrologic uncertainty, and pollution input load uncertainty according to any quantity of observations and the modeled results of any river.

Many uncertainty assessment studies are reported in quantitative or qualitative river modeling. Methods, i.e., Monte Carlo, sensitivity analysis, binominals regression, sequential uncertainty fitting method, genetic algorithm, GLUE (generalized likelihood uncertainty estimation), and Bayesian model averaging have been used to estimate statistical uncertainty of water quality models (Li et al. 2010;Shojaie et al. 2014;Ahmadisharaf & Benham 2020;Alnahit et al. 2020;Chen et al. 2020;Koo et al. 2020;Wang et al. 2020;Worrall et al. 2020). Jin et al. (2010) introduced two indexes, ARIL (average related internal length), and Plevel (probability level), in order to evaluate statistical uncertainties' estimations. Nasseri et al. (2014) introduced a new index named NUE (normalized uncertainty efficiency) which is the combination of two previous indexes. NUE gives a better insight into statistical uncertainty. In the current paper, a Qual2K model, calibrated with the PSO (Particle Swarm Optimization) algorithm, is presented and connected to the GLUE algorithm to assess the model's uncertainties. At first, parametric uncertainty is studied by choosing random amounts of effective parameters on the model between logical and practical boundaries and evaluating model responses. Then, hydrological uncertainties and input pollution load uncertainties are evaluated by curve-fitting on flow history, and choosing random amounts of BOD for pollution point sources. The case study of the present research is Zarjoob River in the north of Iran, which is one of the most polluted rivers in the country. The presented methodology can analyze influences of parametric uncertainty, parametric and hydrologic uncertainty, and pollution point sources' load uncertainty according to any quantity of observed water quality variations of any river water quality model.

CASE STUDY
Zarjoob River, located in Rasht (X ¼ 49°58 0 54″, Y ¼ 37°27 0 96″) in the north of Iran, is the case study of the current research. In the current article, 42 km of the Zarjoob River, beginning in Talebabad and ending in Pirbazar, is chosen as the case study. Proximity to the urban basin, agricultural and industrial wastewaters have made Zarjoob the most polluted river in the Anzali wetland basin. Figure 1 shows the river's location, and Figure 2 represents the position of hydrometer stations along the river. Water quality variations, i.e., BOD, NH 4 , NO 3 , pH, DO, and ALK (alkalinity) were utilized from the last three hydrometer stations. The variations were modeled as monthly average values in 2017.
Eleven sources were considered as pollutant point sources, discharging pollution into Zarjoob River, as shown in Figure 3. Table 1 presents more information about the point sources.

METHODOLOGY
An algorithm is presented to analyze existing uncertainties in a water quality model. In general, the methodology consists of five steps: (1) simulation model; (2) calibration; (3) parametric uncertainties' assessment; (4) parametric and hydrologic uncertainties' assessment; and (5) input pollution load uncertainties' assessment. Qual2 k was used as Zarjoob River's water quality simulation model which can model many variations in steady and semi-steady states. In the following, the PSO algorithm was used as a calibration algorithm. In the calibration, errors were calculated by the RMSE (root mean square error) method. In the next step, only parametric uncertainties were evaluated by GLUE algorithm. Next, parametric and hydrological uncertainties were studied, and then the input pollution load uncertainties were evaluated. For the input pollution load uncertainties, assumed scenarios for BOD of input loads were studied, and finally all the uncertainties were analyzed by Plevel, ARIL, and NUE indexes. Figure 4 shows a flowchart of the research step.

River water quality modeling: Qual2K
The water quality simulation model of the Zarjoob River is developed using the Qual2K model presented by EPA. The Qual2K model numerically solves the following general mass balance equation (Chapra et al. 2012): where C is the concentration of a constituent; V is the volume of a computational element of the river; U is the average velocity of water; D is the dispersion coefficient; A is the river cross-sectional area; SC is the external sources water quality simulations; t is the time in days and x is the distance along the river. This equation includes the effects of advection, dispersion, dilution, constituent reactions and interactions, and sources or sinks. The 42 km length of Zarjoob River was divided into four main reaches and further divided into 40 computational segments with a length of about 1 km. The data needed for each segment are geographic and physiologic specifications, as well as related coefficients and parameters for simulating the selected  water quality variables. The measured river geometry was used to determine the hydraulic characteristic in each reach using the trapezoidal method. The detailed description of the above methods is provided in full in the Qual2K user's manual (Chapra et al. 2012). In addition to flow, slope, and Manning roughness coefficient, the hydraulic characteristics of the river including the diffusion coefficient and the discharge coefficient are also needed for the model development.

Calibration
The efficiency of a model can be evaluated by simulation accuracy and correct anticipation, comparing with a true model or observation. In the present research, because of the huge numbers of parameters involved and the number of models (i.e., 12 models for each month of a year), automatic calibration was chosen. First, effective parameters on modeled variables were detected, and Table 2 shows the parameters that affect modeled variables. Recent studies used optimization algorithms in various water resource system management either for designing or calibration and these algorithms showed high capability to address the problem of concern (Azari & Tabesh 2018; Kim & Je 2006;Rode et al., 2007). In the next step, the PSO algorithm was chosen as the optimization algorithm in calibration. First, the  PSO algorithm creates a new population of fragments in d number of dimensions within the matter space and random speeds of demanded optimization practice function for each fragment in d number of dimensions. Second, it compares the fitness evaluation of each fragment with Pbest (best particle) within all of the fragments. Next, if the present value is more than Pbest's value, Pbest will be replaced with the present value. Pbest's location will be replaced with the present fragment's location. Then, it is compared with the best location of the previous population; if the present fragment's value is greater than gbest (best global particle) then it will be replace gbest. Speed and location changes in fragments are as represented by Formulae (2) and (3): where V id is the velocity vector of particle i; C 1 and C 2 are constant; P id is the best position of the particle i; P gd is the best position among all particles; and X id is the current position of particle i. Next, the path returns to step 2 in order to compare the fitness evaluation of each fragment with Pbest (best particle) within all of the fragments, and it will keep on until it meets stop condition (maximum repeat number or best fitness). Figure 5 shows the PSO algorithm's flowchart. In the current research, the RMSE formula was used to evaluate new points.
where P i is anticipated values; O i is observed values.

Evaluation of parametric uncertainty using GLUE
The GLUE method, which is described briefly, was used to consider parametric uncertainty. This method is one of the probability-based methods of uncertainty estimation, and has been widely used in engineering areas. In the GLUE method, the general approach of the Monte Carlo method is used, and the method can also be adapted to the Bayesian method. Initially, to implement this method for each of the parameters, the initial probabilistic distribution is considered uniform. However, any empirical distributions can be adopted, too. Then, using continuous modeling and evaluation of the results, the final distribution of the parameters which affect the modeled variables is determined. In the GLUE method, Equation (5) is used to evaluate the results of the obtained samples statistically: where COV and VAR are the covariance and variance of the data, and y and y 1 are the observational and computational values, respectively. In the following, GLUE algorithm steps are presented, including: (1) generating parameters' values according to each assumed boundary and distribution; (2) evaluating parameters separately and in a group; (3) determining the reliability domain of statistical screw results; and (4) if the boundaries (here the iteration ¼ 1,000) are accepted, the algorithm would stop. Figure 6 shows the flowchart for evaluation of the parametric uncertainty using the GLUE method. Table 3 shows the ranges for the parameters that have changed in different months based on the obtained histograms. However, a significant part of the parameters follows the same condition.

Evaluation of hydrological and parametric uncertainty
For the hydrological and parametric uncertainty assessment, at first, a curve was fitted to each one of the effective parameters' histograms, obtained from the previous step. Then, a curve was fitted to the upstream flow that was separately available as time histories for each month of the year. Next, the model was run using the random numbers, produced based on the curves. Figure 7 shows the flowchart of the presented steps.

Uncertainty of the input pollutants discharge
The input pollutants' discharge and their properties are shown in Table 1. BOD as the variable affected by the pollutants' discharge was chosen to evaluate the uncertainty of input pollutants' discharges. Hence, along with the parametric uncertainty evaluation, different input BOD scenarios were studied. Due to the lack of an available database of pollutant sources, the considered scenarios were selected experimentally, and based on previous studies. In conclusion, this step of uncertainty assessment contains the following steps: (1) fitting curves on the histograms obtained from the parametric uncertainty assessment. Next, determining pollutants point sources' load limits, then, determining affecting parameters' boundaries; (2) determining random values based on the previous step; (3) running the model based on random values; (4) evaluating random values of pollutant loads and parameters affecting BOD using GLUE algorithm; and (5) creating histograms based on accepted parameters affecting BOD, and saving the results and presenting limit boundaries of BOD. Figure 8 summarizes the flowchart of the uncertainty evaluation of the pollutants' discharges.

Evaluation of the uncertainty assessment results
In the uncertainty analysis of water quality simulation models, different uncertainties should be compared and evaluated, but comprehensive access to statistical conditions is difficult. However, it is necessary to compare different uncertainty analyses, even using difficult statistical conditions. Jin et al. (2010) presented two indexes for statistical evaluation of different uncertainties. The first index, ARIL, compares the width of the uncertainty limits according to the observational conditions. The second index shows the reliability percent of the uncertainty limits and the percent of the observed values that lie within the limits.
where UpLi t is the upstream boundary condition, Loli t is the downstream boundary condition, and Obs t is the observation.
where N Qin is the number of observations located in uncertainty boundaries, and N is the total number of observations. Nasseri et al. (2014) used a new index called the normalized uncertainty effect or NUE which was a combination of the two previous indexes to evaluate a model.
where W is an experimental coefficient assumed equal to 1 in the current paper.

RESULTS AND DISCUSSION
The simulation of the present study was done based on the 2016 monthly average data. The headwater flow was chosen from the Siahroud hydrometer station. As it is obvious, the Zarjoob River experienced different hydrologic circumstances during these years, the headwater flow plays an important role in the model uncertainty that is discussed later in Section 4.2. As an  example, qualitative simulator results for June are presented in Figure 9. These results showed that the changes in the modeled variables along the river almost follow a fixed pattern, with differences in their magnitude. Niksokhan et al. (2009) simulated 24 km of the Zarjoob River and studied the BOD, DO, and temperature. Zolfagharipoor & Ahmadi (2016) performed qualitative modeling with almost the same number of calibration points as well as the number of input point pollutants to the model but limited modeled parameters of BOD, DO, and temperature. The results of these two studies show almost the same pattern in the identical variables like BOD, DO, etc. As is obvious, the gaps between calculated outcomes and observations increased along the river, by getting further from the upstream's reach. It could be caused by, first, the result of the water quality monitoring budget, which is often limited and the laboratory condition is not always as good as required, especially in developing countries (Bui et al. 2019). Second, the simulation was done directly based on the observations (Shojaie et al. 2014). Figures 10 and 11 show the result of parametric uncertainty assessment for NH 4 . There are some observations which are not located within the uncertainty boundaries; however, the results are more satisfying in the first half of 2016. It could be the result of a more stable hydrological regime in these months, so the parametric uncertainty has more effect on the model. On the other hand, the uncertainty boundaries show a good domain. Table 4 shows the three indexes: ARIL, Plevel, and NUE for 12 months of 2016 for five variables: ALK, DO, NH 4 , NO 3 , and pH. One of the fundamental indexes to interpret results of parametric uncertainty evaluation is Plevel, indicating whether the parameter uncertainty alone leads to the observation along the river or not. In the parametric uncertainty study of the alkalinity, the minimum Plevel values of 20% were observed in November and maximum Plevel values of 80% were observed in most of the months. In the parametric uncertainty study of the DO, the minimum Plevel values of 20% were observed in May, and the maximum Plevel values of 100% were observed in July, September, October, November, and December.

Results of the parametric uncertainty evaluation
The results for July show a smaller domain of uncertainty boundaries and more valid results in comparison to other months. The ammonia displayed a better behavior with the minimum Plevel values of 40% in January and July, and in the maximum Plevel values of 100% in March and September with fewer changes in September. The parametric uncertainty study of the nitrate showed a better behavior even in comparison to ammonia with the minimum Plevel of 20% in August   and a maximum Plevel of 100% in April, September, October, November, and December, with the best behavior in December due to the smaller boundaries. The pH had the minimum and maximum Plevel of 20 and 100% in December and February, respectively. Table 4 shows that all variables had better results in the first six months of the year than the other months. Figures 12 and 13 show the results of hydrologic and parametric uncertainty assessment for NO 3 . As can be seen, the uncertainty boundaries' domains, and the number of observations within these domains, increased. This shows that hydrologic circumstances play an intensive role in the uncertainty of the model. In the meantime, we can infer that hydrological and parametric uncertainty assessment results in a better insight into the real condition of the Zarjoob River. Table 5 shows indexes ARIL, Plevel, and NUE for the variables' hydrologic and parametric uncertainty assessment. For a better interpretation, we should consider NUE as an important index in addition to the Plevel, because it shows whether the greater Plevel was obtained from a logical domain of boundaries or not. Comparison of the alkalinity results of uncertainty showed that the maximum value of NUE occurred in April with values of 2,701.35; however, the Plevel value of April (80%) is lower than the Plevel value of January and March, but because of a smaller uncertainty range than other months, April has the highest NUE value. Meanwhile, February had the lowest Plevel value of 0%, with similar uncertainty ranges to that of April. Despite a Plevel value of 100%, June had much larger uncertainty ranges. The DO uncertainty results show that with considering hydrological uncertainties, the modeling results resemble the observations properly and the Plevel value is higher than 80% for most of the months, and uncertainty ranges show logical domain of variation. Other comparison of the ammonia uncertainty results showed that the maximum and minimum NUE values occurred in January (1,291.1) and August (16.16), respectively. However, Plevel values of 80 and 40% were obtained in January and February, respectively. Comparison of the nitrate uncertainty results showed that in November and December there was a Plevel of 100, while both months have large uncertainty ranges. Therefore, NUE values of 0.51 and 0.07 were obtained in November and December, respectively. The pH uncertainty assessment results show more promising behavior, and Plevel values are higher than 80% except for April (20%). Besides, Plevel index plays an important role in uncertainty estimation of the pH, because the uncertainty ranges of this variable are narrow, so more reliable results are obtained for larger Plevel values. Regarding the pH parameter, the maximum and minimum Plevel values of 80 and 60% were obtained in March and September, respectively. As is evident from all the  Vol 23 No 5, 1159 figures, by getting farther from the river upstream, a wider range of uncertainty was obtained. Despite an acceptable Plevel in all months and for all variables, the difference between the minimum and maximum uncertainty values led to a decrease in the NUE index. When only the parametric uncertainty is considered, Plevel values decrease for almost all variables and in all months. On the other hand, by considering hydrological uncertainty, the changing range of uncertainty significantly increased, which was clearly confirmed by the ARIL index values. Subsequently, Plevel values also increased. At this stage, the importance of the NUE index was clearly highlighted, giving a more comprehensive picture of the uncertainty estimation. For a better and clearer comparison, the NUE values in the case where only the parametric uncertainty was studied were greater than those in the case where the hydrological and parametric uncertainties were studied simultaneously.

Journal of Hydroinformatics
Despite the greater Plevel values in the case of simultaneous hydrological and parametric uncertainty study in comparison to those in the case of the parametric uncertainty study, the changing range of the variables in the former was much larger than the latter. Due to greater Plevel values in the case of the hydrological uncertainty study, it can be concluded that the input discharges at each month do not represent the discharge at which the qualitative observation in the hydrometric stations was obtained.

Uncertainty of the input pollutants' discharge
As mentioned earlier, the BOD was studied as a variable showing the effect of input pollutant loads. The results of the BOD changes in all months of 2016 are presented in Figures 14 and 15. As can be seen, the domain of uncertainty boundaries in different months show a logical width, and almost all the observations have been located within these boundaries. It shows that the assumed scenarios for pollutant discharges are similar to the real condition. Finally, uncertainty estimation indexes for all months are presented in Table 6. The least amounts of Plevel occurred in February and July (60%), with January, April, May, August, November, and December showing the greatest amount (100%). The best result is in October with NUE equal to 156.21. As mentioned before, each one of the point sources is proposed as being located in a particular zone. Owing to lack of accurate data, presumed pollutant discharge scenarios are implied to the model. However, in the real condition, non-point pollutant sources were observed leading to more uncertainty of the model.

CONCLUSIONS
The study indicated, given choosing PSO as the calibration algorithm, that the modeling results could not resemble the observations, and this could be the result of a lack of geographic and physiologic input data. By considering the parametric uncertainty more reliable results were obtained, which highlights the role of modeling equations and effective variables on the results. The Plevel index values are usually equal to or less than 80% for all five variables, which implies the importance of considering hydrological uncertainty. By considering the hydrological uncertainty the Plevel value of variables was more than 80% in most of the months, but in the meantime, the ARIL and NUE indexes values increased too. Therefore, the NUE index values of the parametric uncertainty estimation were greater than those in the simultaneous hydrological and parametric uncertainty estimation, because of smaller changes of range in the uncertainty boundaries. This confirmed the importance of the headwater flow on the accuracy of the results. On the other hand, the results were more valuable in the second half of the year, and this reflects the specific circumstances of the case study. Zarjoob River experiences a very low amount of headwater flow during the first half of the year which makes simulation more difficult. It could be concluded that in the case of the parametric uncertainty study, the input discharges at each month do not represent the discharge at which the qualitative observation in the hydrometric stations was obtained and it justifies more accurate results at the hydrological uncertainty assessment stage. It should be noted that the simulation was done directly based on the observation, and this increases uncertainty by itself. The results of the input pollutant discharges' uncertainty assessments show that Plevel value is more than 80% in ten months, and it confirmed the importance of the accuracy of the model inputs (BOD) on modeling accuracy. It should be noted that, first, the pollutant sources were presumed point sources despite the real state which are non-point source pollutants. Second, due to the lack of an available database of pollutant sources, especially in presumed state, the considered scenarios were selected experimentally, and based on previous studies. Studies based on different conditions of the hydrological state of the river and other quality variables and non-point sources of pollutant discharges could be the subject of further studies.