## Abstract

In this research, A 15-year impact of climate change in Lar Dam has been investigated. The results showed that in the case of climate change under three scenarios, T_{max} and the T_{min} have increased by 5, 5.23, 6.2% and 3.5, 5.6, 5.17%, respectively, and the amount of precipitation increased by 8.55, 9.5, 13%, respectively. Also, the highest rainfall will be in 2031 and the lowest will be in 2036. Based on the intermediate state of the scenarios, the amount of runoff was obtained and the reliability index was calculated according to the upstream runoff and downstream needs for drinking, agriculture, and environment. The simulation was also performed in the WEAP model. The findings showed that the highest reliability was 86.60% of the agriculture, and by using the optimization of a honey badger and Harmony Search Algorithm, it was found that the reliability is approximately 5.06 and 1.73% higher than the simulation. In comparison with the optimization algorithms, due to the smaller value of the objective function of the HBA and the greater reliability of it, the result showed that performance of this algorithm was better and it has a faster calculation.

## HIGHLIGHT

These methods have been used for the first time. Forecasts are based on the impact of climatic parameters on the future situation and the latest algorithm. The predicted data have been generated based on real daily data, and using validation and re-calibration of the model, the results have been obtained. Optimization was done using several meta-heuristic algorithms and the definition of the objective function.

## INTRODUCTION

*et al.*2014). In the meantime, water resources planning and management to achieve proper and integrated management as well as sustainable development of water resources in the field of dams will be very important. The purpose of this study is to identify water in all sectors (drinking, agricultural, and environmental needs) according to the long-term policies of water resource management.

Climate change is periodic and expresses the degree of fluctuation of climate change parameters and may occur at different times. Global warming is now seen as part of climate change due to human activity and the development and use of fossil fuels and industries. Climate change is one of the biggest challenges in the world, and this increase in temperature is changing the climate pattern throughout the whole world, and causing the sea level rise and climate change in the regions. Also, these changes and rising temperatures will cause the spread of droughts and their continuation. Due to the great importance of water in human life, these changes should be recognized and solutions should be provided to adapt to these negative changes and reduce their negative effects.

The HEC-HMS runoff model can calculate effective rainfall and runoff yield using rainfall and temperature data. This model was used to simulate future rainfall and its temperature, and the amount of runoff caused by it was calculated in this model.

This research was conducted on the runoff of the Lar dam area in the period 2022–2036. Temperature and precipitation of the CANESM2 model under Representative Concentration Pathway (RCP) 2.6, RCP4.5, and RCP8.5 scenarios showed that the maximum temperature increased by 5.5, 5.2, and 6.25% and the minimum temperature by 3.5, 5.6, and 5.17%, respectively. The precipitation amount increased by 8.5, 9.55, and 13%, and the amount of runoff in the next period of 2022–2036 compared to the base period of 1991–2005 also increased by 3.3%.

Forecasting of climatic parameters such as precipitation and temperature has been considered due to its climatic changes in recent years, for example, the article by Neslihanoglu *et al*. (2021) predicts different models on monthly precipitation series and uses effective parameters such as temperature, relative humidity, and cloud cover in Mugla region, Turkey. Multiple linear regression method, the state space model (SSM) through the Kalman filter (combined model of logistic regression and SSM), the seasonal autoregressive integrated moving average (SARIMA), exponential smoothing state space model (ETS), exponential smoothing state space model with Box-Cox transformation – ARMA errors-trend and seasonal (TBATS), feed-forward neural network (NNETAR), and prophet model were used and compared.

It showed that SSM decisively supports the modeling and prediction of monthly precipitation series in that region and promises to expand time-varying coefficients in precipitation modeling.

Evolutionary algorithms and artificial intelligence methods in recent years have been introduced by researchers as suitable tools to solve these problems. Evolutionary algorithms include genetic algorithms (GA), ant community, and firefly algorithm. Researchers have also used many of these command curves. For example, Afkhamifar & Sarraf in the article presented in 2022 showed that the performance of extreme learning machine and artificial neural network models, as well as their combination with the wavelet transfer algorithm, which is a hybrid model, is better than other models, and it also works faster than other models in testing (Afkhamifar & Sarraf 2020).

In an article by Dunyaei *et al*., the multi-objective gray wolf optimizer algorithm was used for calculating the optimal operation rules in the Golestan dam located in Golestan province under the conditions of climate change, and the results showed that the river flow has decreased by 0.17% compared to the baseline. Also, the temperature increased by 20% and rainfall decreased by 21.1% (Donyaii *et al.* 2020a). In another study, they showed that the multi-objective agricultural land fertility optimization algorithm used to derive optimal rules for operating the Golestan dam in the context of climate change increased the release rate and the efficiency of dams in climate change conditions compared to baseline conditions (Donyaii *et al.* 2020b).

In this research, Honey Bodger and Harmonic search algorithms have been used.

Ashofteh *et al.* (2014) evaluated the optimal water allocation policy by examining downstream irrigation networks and irrigation water allocation policies with climate change conditions, with the help of genetic planning with three different modes. The results showed that in the context of climate change, compared to the current situation, the indicators of reliability, vulnerability, and reversibility have decreased by 50%, increased by 6%, and decreased by 14%, respectively. The result showed changing conditions. Compared to the current situation, the indicators of reliability, vulnerability, and reversibility have decreased by 50%, increased by 6%, and decreased by 14%, respectively. It was predicted that knowledge of this issue would help decision-makers and planners a lot and may change the pattern of cultivation. Water management in Aydoghmush area for the next period (2046–2065) using the Water Evaluation And Planning (WEAP) model in climate change showed that the demand for irrigation increases and the inflow to the catchment in this area decreases. Genetic application for this reservoir management with climate change showed that the confidence index for future water supply and vulnerability decreased and increased compared to the baseline period (Ashofteh *et al.* 2017).

Study area with coordinates: 35°53′17″ North 52°00′36″ East/35.88806° N 52.01000° East. Lar Dam is an earthen dam with a clay core located at the foot of Damavand Mountain in Amol City. This dam is located in Lar Protected National Park, 70 km northeast of Tehran and 100 km from Amol, and supplies water for consumption in Tehran and water needed for agricultural irrigation in the region. But before reaching the city's treatment plant, it is used to generate electricity at the Kalan and Lavark power plants, which have an average annual capacity of 150,000 megawatt hours of hydropower. The construction of this dam started in 1974 and finally ended in 1982. The catchment area of this dam is 675 km^{2}, and the average annual water flow is 481 mm^{3} (Figure 1).

The average volume of water entering the dam will increase by 3.3% due to the increase in temperature and rainfall. The volume of water required downstream in climate change conditions has increased by about 14.17% compared to baseline conditions.

Long-term changes in climate parameters due to increased greenhouse gas emissions are called climate change (Ashofteh & Bozorg-Haddad 2015). Factors such as the growth of factories, indiscriminate activities, excessive use of fossil fuels, and the destruction of forests and pastures and land use change have led to an increase in greenhouse gases, especially CO2, in recent years. In recent years rising global warming has caused changes in temperature and precipitation. In this study, three modes have been used: optimistic RCP2.6, intermediate RCP4.5, and pessimistic RCP8.5. These scenarios were presented in 2010, and modeling can be done using them until the year 2300. It can also be provided to them to show land use change, greenhouse gas emissions, population growth, and the level of technology used. The result shows an increase in the minimum and maximum temperature and precipitation and thus an increase in the amount of runoff.

The output of climate models does not have the accuracy of spatial and temporal analysis, and it is necessary to scale it exponentially. The simulated climate variables are extracted from the cell data in which this region is located (Ashofteh *et al.* 2017).

The HEC-HMS model was used to produce monthly runoff. This model is for simulating runoff rainfall. Data from rainfall, temperature, and runoff in the baseline period were used to calibrate the model. Temperature–precipitation observation data and monthly incidence of the base period (1991–2005) were used. After adjusting the model, the monthly runoff in climate change conditions was calculated.

Downstream demand in the face of climate change has increased by 14.17%.

*et al.*2005).

Here, is the storage volume in period *t* + 1; , *E _{t}*,

*R*, and Spill are the storage volume at the beginning of period

_{t}*t*, the inflow, the amount of evaporation, the volume of release, and overflow in the same period (million cubic meters), respectively. In Lar Dam, the need for urban drinking is the first priority, and agriculture and the environment are the second and third priorities, respectively.

### Development of optimization model

In the aforementioned formula, *t* is the number of time periods, and + 1 are the storage volumes of the reservoir at the (beginning and end) of the time period *t*, is the volume of river flow to the reservoir during the time period *t*, is the volume of water released from the reservoir during the time period *t*, is the amount of evaporation losses during the time period *t*, *M _{d}* is the amount of release required (drinking or agriculture), and

*D*is the amount of environmental requirement (obtained from the simulation of the model in the WEAP software).

_{en}*t*; is the height of precipitation on the lake behind the dam in the period

*t*; and

*a*,

*b*, and

*c*are the coefficients of the volume–surface relationship of the dam reservoir.

*t*, and

*S*

_{min}and

*S*

_{max}are the minimum and maximum volume of the reservoir, respectively. Other symbols are as follows:where and are the minimum and maximum release volumes of the reservoir in the time period

*t*, respectively, and and are the minimum and maximum reservoir requirements in the time period

*t*, respectively. Most reservoirs are constructed to meet various water needs, which in the reservoir exploitation calculations, depending on the goals under consideration, different objective functions, and other additional constraints are provided in addition to the mentioned constraints.

*F*is the target to be maximized or minimized, is a function dependent on several parameters, and is the downstream need of reservoir

*i*over time

*t*(Labadie 2004).

### Reservoir performance indicators

#### Reliability

Reliability is a category that is widely used in the evaluation of water resources systems during the period of operation. It is sometimes referred to as a complementary risk (reliability-risk). Reliability can be defined as both temporal and volumetric. Temporal reliability refers to the percentage of periods in which the system fully meets existing needs and does not fail. The value of this parameter is calculated from Equation (10):

where is the total number of failures during the operation period, is the required amount in the *t* period, is the output value of the *t* period, *α* is the supply requirement, and is the system reliability during the operation period. The higher the value of this parameter, the greater the temporal reliability of the system.

#### Vulnerability

*et al.*(1982) presented the following equation:where

*ɳ*is the magnitude of failure, is the required value in period

*I*, is the output value in period

*I*, and

*t*is the total number of operating periods.

#### Honey Badger algorithm

Optimization means finding the best solutions for a system among all possible solution values and maximizing or minimizing the final output. In the past years, the complexity of the problems has increased and required optimization, and for this reason, this issue has become very important. In previous years, mathematical methods were used to find solutions for optimization problems, most of which are deterministic optimizations and have one main problem: local optimal trapping (Hashim *et al.* 2022).

Many researchers have turned to the development and improvement of optimizers to find the best solution, and they have provided useful searches in meta-heuristic algorithms for global optimization, because in real optimization problems, the search space grows exponentially and makes them multifaceted. Conventional optimization methods mostly produce less than optimal solutions, which has led to the development of many new algorithms and innovations in recent years. (Hashim *et al.* 2022)

Recently, various effective search strategies have been included in meta-heuristic algorithms, and two of them are inspired by nature and the principles of biology and physics and simulate swarm behavior or intelligence. The interesting thing is that some of them, such as particle swarm algorithms, and genetic optimization, are well known among computer scientists and scientists of other fields (Hashim *et al.* 2022).

Meta-heuristic algorithms imitate organized behaviors. These algorithms are inspired by the social behavior of animals, birds, plants, and humans. A number of common meta-heuristic algorithms are as follows: the Whale Optimization Algorithm (WOA), elephant herd optimization algorithm, grasshopper optimization, etc. Another type of global stochastic optimization is inspired by the genetic mechanism and natural evolution, such as the genetic algorithm and NP algorithm, which are an imitation of the chemical or physical laws of the world (Hashim *et al.* 2022).

In any case, crowd-based algorithms need further evaluation in solving real-world challenges. That is, no-free lunch theorem 2 shows that none of the meta-heuristic optimization algorithms can solve all optimization problems and still have unsolved problems. Due to the mentioned reasons, there is a reason to introduce a new meta-heuristic algorithm called the Honey Badger algorithm (HBA), which is similar to honey badger, because the ability to balance exploration and exploitation plays an important role in effective search (Hashim *et al.* 2022).

HBA has a dynamic feature that enables it to solve optimization problems in many local areas because it maintains population diversity during the search process to explore a large area of a given landscape (Hashim *et al.* 2022).

*et al.*2022).

The HBA is a food-seeking behavior of the honey badger (Figure 4). To find a source of food, this animal either looks for the smell of honey or looks for a honeyguide bird (drilling phase and honey phase). In the first case, it uses its sense of smell to estimate the location of the hunt. Once there, it moves around the prey to choose the right place to dig and grab the prey. In the second case, the guide bird takes the honey badger to find the hive (Hashim *et al.* 2022).

##### Mathematical model of the algorithm

*N*) and their respective positions are adjusted according to the initial equation:where is the position of the honey badger at a new point in the

*N*population, while are the bottom and top boundaries of the search domain, respectively (Hashim

*et al.*2022).

##### Definition of intensity (I)

*S*is the source power or the power of focus (hunting place as shown in Figure 5). In Equation (17), it shows the distance between the prey and the burrower (Hashim

*et al.*2022).

##### Density factor update

*α*) is the use of a random variable with time that is used to ensure a smooth transfer from the finding to the operation. Using the equation, the reduction factor decreases with repetition and generates new ones to reduce randomization over time (Hashim

*et al.*2022).

#### Escape from the local optimal

This part and the next two parts are used in escaping from the local optimal regions. In this case, the proposed algorithm uses a flag F that changes the direction of the search, and the aforementioned opportunities are used to accurately scan the search space (Hashim *et al.* 2022).

#### New member positions

As previously discussed, the new HBA positioning process is divided into ‘drilling phase’ and ‘honey phase’. More details are given below.

#### Drilling phase

*β*≥ 1 (default = 6) is the ability of the honey badger to get food, is the distance between the prey and the bee, are three different random numbers between 0 and 1, and F acts as a flag that changes the direction of the search, which is determined using the following equation:

In the drilling step, the honey badger relies heavily on the odor. is the bait odor intensity, the distance between the badger and bait, and time-varying search effect factor *α*. The honey badger may encounter any disturbance while digging that allows him to find a better hunting spot.

#### Honey phase

*α* is determined from the above equations. is the new location of honey badger, is the place of prey, and *F* and *α* are determined from the aforementioned equations.

It can be seen that the honey badger is hunting near the hunting site , based on distance information found ; at this point, the search is affected by the search behavior, which varies with time (*α*). In addition, the honey badger may cause nuisance (*F*) (Hashim *et al.* 2022).

#### Pseudo-code algorithm HBA

Algorithm 1 Pseudo-code of HBA

Set parameters , N, *β*, C

Initialize population with random positions.

Save best position and assign fitness to (Figure 7).

**While** I ≤ **do**

Updating the decreasing factor *α* using

For i = 1 to N **do**

Calculate the intensity using Eq.

**If** r< 0.5 **then **

** ** r is random number between 0 and 1

Update the position using Eq.

**else**

Update the position using Eq.

**End if**

Evaluate new position and assign to

**If** ≤ then

Set = and =

**end if**

**If**≤ then

Set ] = and = **end if**

end for

end while Stop criteria satisfied.

**Return**

#### Harmony search algorithm

This algorithm was first introduced by Zong Woo Geem in 2000. Harmony in music is the so-called different solo performance at the same time, which eventually becomes a rhythmic and beautiful song in terms of hearing. The harmonic search algorithm (HSA) as one of the new methods of meta-heuristic optimization is based on the improvisation *process* of *jazz* musicians (Geem 2000). The basic concepts of the HSA were first proposed by a famous Greek philosopher and mathematician, Pythagoras. In musical works, the search for the best position (extraordinary harmony) is determined by aesthetic estimation (Figure 8).

In classical optimization algorithms, the best position (global optimal, minimum cost, and maximum profit or efficiency) is usually determined by evaluating the objective functions, while aesthetic estimation is determined by evaluating the objective functions from the recorded values of the component variables. In music, to achieve the best performance, each exercise is compared with the previous exercise, while in optimizing the objective functions in each repetition, it is compared to the previous repetitions.

In general, the process of optimizing the search for harmony is summarized in five steps. Step 1: Introduce the optimization problem and algorithm parameters, Step 2: Generate the initial harmonic memory, Step 3: Modify the new harmonic, Step 4: Update the harmonic memory, and Step 5: Check the stop criterion.

##### Step one

This part of the subroutine of the Harmony Search (HS) algorithm begins by defining the parameters and arrays input to the algorithm according to the type and dimensions of the problem, including the maximum number of iterations, the number of decision variables, the size of the harmonic memory, the number of new harmonies, the speed of checking the harmonic memory, and upper and lower limits of decision variables.

##### Step two

##### Step three

This part is related to the main loop of the algorithm, which is executed as the total number of repetitions (MaxIt) defined by the user (termination criteria).

For example, if the HMCR is 0.8, the algorithm selects a new vector with a probability of 80% from among the vectors arranged in harmonic memory and randomly selects a new vector with a probability of 20% within the allowable range.

But if the answer is no, it does not do anything with 1-PAR probability. *fw* is an optional distance for the check width, and rand is a random number between 0 and 1.

In the next part of the HS algorithm, if the newly produced harmony is better than the worst harmony in memory, it is replaced in memory, and thus, a worse harmony is removed from memory.

But if the new harmony is not better than the worst harmony in memory, then the algorithm enters the next iteration without any replacement.

In the main loop of the algorithm, the second and third steps are repeated until the stop condition is executed. Thus, the last vector obtained in the algorithm is the answer to the problem. Obviously, in each optimization problem, the values of HMCR, *fw*, PAR, HMS, and MaxIt parameters will be different. Also, their exact determination has a great effect on the convergence of the algorithm, so it is necessary to perform sensitivity analysis on these parameters in any optimization. HMCR values are usually considered in the range of 0.99–0.9. The size of HMS harmonic memory is considered in the range of 5–50. This parameter depends on the number of decision variables; the larger the harmonic memory size, the larger the problem in terms of dimensions, so this parameter is often chosen smaller. The probability of checking the adjustment of PAR components is usually considered to be between 0.3 and 0.99.

## PSEUDO-CODE ALGORITHM HSA

Harmony Search

**Begin**

Define objective function

Define harmony memory accepting rate ()

Define pitch adjusting rate () and other parameters

Generate Harmony Memory with random harmonies

**While** (t < max number of iterations)

**While** (i < number of variables)

**If** ( rand < ), Choose a value from HM for the variable i

**If** (rand < ), Adjust the value by adding certain amount

**end if**

**else** Choose a random value

**end if**

**end while**

Accept the new harmony (solution) if better

**end while**

Find the current best solution

**End** (Figure 9)

## RESULTS AND DISCUSSION

The result shows an increase in minimum and maximum temperature and precipitation in the next period and finally an increase of 3.3% in the resulting runoff (Figure 10).

HEC-HMS software was evaluated in the calibration and validation period, and the result showed that in the calibration and validation period, with the correlation coefficient of *R* of 0.791 and 0.782, the error criteria Root Mean Square Error (RMSE) (0.27 and 0.23), Mean Absolute Error (MAE) (0.15, 0.13, and 0.502), and Nash-Sutcliffe Error (NSE) (0.537) performed well compared to that in the observation period.

*et al.*(2001), the result of modeling based on the

*R*coefficient of more than 0.6 and Nash–Sutcliffe more than 0.5 is satisfactory and acceptable. Figure 13 shows the average volume of runoff entering the dam in two basic periods and climate change.

The volume of water released in downstream needs (drinking, agriculture, and environment) obtained from optimization algorithms is as follows.

The changes in the values of the objective function obtained from the thousand times execution of honey badger and harmonic search algorithms for drinking, agricultural, and environmental needs are as follows.

(Since the WEAP software does not have the ability to call directly in the MATLAB software environment, EXCELL software was used as an interface for communication between the WEAP model and optimization algorithms (Zamanpour *et al.* 2017).)

According to Table 1 in the simulation models, the confidence index with possible states in the future period was less than 90%. The maximum estimated value of this index was 86.60%, which is for agriculture needs in the period of climate change. Lar Dam optimization with the HBA added 5.06% to the reliability index and the harmony search algorithm added 1.73% to the index. Table 1 shows the amount of reliability changes resulting from the simulator and optimizers.

Reliability . | Drinking . | Agricultural . | Environmental . |
---|---|---|---|

WEAP | 73.89% | 86.60% | 70% |

HBA | 86.66% | 91.66% | 87.22% |

HSA | 78.66% | 88.33% | 76.66% |

Reliability . | Drinking . | Agricultural . | Environmental . |
---|---|---|---|

WEAP | 73.89% | 86.60% | 70% |

HBA | 86.66% | 91.66% | 87.22% |

HSA | 78.66% | 88.33% | 76.66% |

## CONCLUSION

In this study, the modeling of climatic conditions in SDSM software was investigated using CANESM2 general atmosphere model under three RCP scenarios in the best and intermediate and worst climatic conditions, and the results of the study showed that in RCP2.6, RCP4.5, and RCP8.5, the amount of climatic parameters in the conditions of climate change (2022–2036) increased compared to the base period (1991–2005). This increase in minimum temperature and maximum temperature is 3.5, 5.6, 5.17, 5, 5.2, and 6.2%, respectively. Also, the rainfall was 8.55, 9.5, and 13%, respectively, which caused a 3.3% increase in the amount of runoff entering the dam during the climate change period compared to the base period. To simulate and optimize the system, the WEAP model and meta-heuristic algorithms (honey badger and harmonic search) were used. Runoff from climate change was calculated using the HEC-HMS runoff model, and modeling in WEAP showed that the reliability of downstream needs is less than 90%, which is the highest index of agriculture needs with 86.6% reliability and the lowest is related to the environment with an index of 70%.

Reliability indices for honey badger and gravitational search algorithms increased by 12.77 and 4.77% in drinking water, by 5.06 and 1.73% in agriculture, and by 17.22 and 16.66% in environment, respectively.

The reliability index for each demand showed that the optimizer model has more reliability than the simulator model. Due to the increase in temperature and precipitation and finally the increase of 3.3% in runoff and 14.17% increase in downstream needs in the future, the allocations to drinking, agricultural, and environmental needs decreased, and by using optimization models, we were able to ensure increase in flexibility compared to the simulator mode.

In the optimizer model, the amount of tank volume change was more than in the simulator model, and in some studies, operation optimization models were able to improve reliability indicators. For example, Kia *et al.* (2018) found that firefly optimization methods with 88.3% water supply reliability are better than GA and SOP with 82.4 and 66.7 reliability index values. Salimi Mastali *et al.* (2022) found that optimization with Lingo software increases the reliability percentage of a simulation in WEAP in the conditions of climate change in Hersin Dam. In the previous article, optimization of dam reservoir operation using gray wolf optimization and genetic algorithm (a case study of Taleghan Dam) (Sadeghian *et al.* 2021) showed better performance of the Gray Wolf Optimizer (GWO) algorithm according to the performance indicators and the newness of the algorithm and the dimension of the object of the issue than GA and also reflected the better performance of the optimizer algorithm compared to the WEAP software, which is consistent with our research. Regarding the comparison of optimization algorithms due to the lower value of the objective function of the HBA and the greater reliability of this algorithm in optimizing downstream needs, it can be concluded that the performance of this algorithm has been better than the HSA.

## DATA AVAILABILITY STATEMENT

All relevant data are included in the paper or its Supplementary Information.

## CONFLICT OF INTEREST

The authors declare there is no conflict.

## REFERENCES

*Optimal Design of Water Distribution Networks Using Harmony Search*

*Journal of Mathematics and Computer in Simulation*

**192**, 84–110.

**34**(17),

*Iranian Journal of Soil and Water Research*

**51**(1), 1–12

*Water International*

**30**, 487–500