Balancing environmental impacts and economic benefits of agriculture under the climate change through an integrated optimization system

The present study proposes a framework to mitigate impact of climate change on the rice production by maximizing the yield while the energy use and ecological impacts on the river ecosystem as the irrigation source are mitigated. Coupled general circulation model- soil and water assessment tool (SWAT) was utilized to project the impact of climate change on the stream flow. Fuzzy physical habitat simulation was applied to develop the ecological impact function of the river. Moreover, a data-driven model was developed to predict the rice yield through changing water and energy consumption. Finally, all the simulations were utilized in the structure of the optimization model in which minimizing loss of the production, greenhouse gas emission by reducing energy use and physical habitat loss were considered as the objectives. Based on the results, the Nash–Sutcliffe model efficiency coefficient of the SWAT is 0.7 that demonstrates its reliability for simulating the impact of climate change on river flow. The optimization model is able to reduce the impact of climate change on yield of production by balancing water and energy use. In the most pessimistic scenario, water use should approximately be reduced 25% for protecting river ecosystem. However, the optimization model approximately increased energy use 16% for preserving the yield of the rice. Conversely, model decreased the energy use 40% compared with the current condition due to increasing water supply. Moreover, physical habitat loss is less than 50% that means the combined optimization model is able to protect river habitats properly.


Introduction
Energy and water are the key components in the agricultural production [1]. Due to increasing population, environmental impacts of energy and water use are a serious concern in recent decades [2]. Environmental degradations of the crop production might consist of two parts including GHG emission and environmental impacts on the water resources such as river ecosystem [3,4]. Direct energy use such as fuel or electricity for operating machinery and equipment and indirect energy use such as the fertilizers and biocides have been highlighted as the sources of the energy consumption in the literature [5]. Agricultural productions produce 10% to 12% of the GHG emission in the atmosphere [4]. Data envelopment analysis (DEA) has been applied to optimize agricultural energy use which is a linear programming approach for evaluating the efficiency of decision-making units (DMUs). Minimizing energy use could be the purpose in the objective function of agricultural optimization models [6,7]. Rice is a strategic crop in many countries. Analysing the energy use or rice production has been highlighted in the previous studies [8].
Water use in agriculture might have significant environmental impacts in the water bodies such as rivers [9]. Increasing agricultural water demand has reduced instream flow of the rivers [10]. In fact, river ecosystems are threatened due to lack of adequate instream flow that might reduce the suitability of the river habitats [30]. The river environmental flow is defined to protect the ecological sustainability of the river ecosystem [11]. Many methods have been proposed to assess environmental flow. More details have been reviewed in the literature [12,13]. Habitat simulation is one of the reliable methods in this regard [14]. Univariate physical habitat model is the conventional methods for simulating river habitats [15]. However, this method has been criticized due to inability for simulating interactions between physical habitat parameters [16,17]. Hence, multivariate methods have been proposed to simulate physical habitat in the rivers. Multivariate fuzzy approach is one of the robust methods for simulating physical habitats that is able to simulate interactions between parameters [14].
Climate change is a global problem in the world that might have considerable impact on the hydrological systems in the world [18]. According to the literature, changing stream flows in the river basins and intensifying extreme events are inevitable [19][20][21]. Different types of climate change models have been reviewed in the literature [22]. Hence, it is essential to mitigate environmental impacts of water and energy use in the agriculture under the impact of climate change.
Predicting or simulating yield is necessary for assessing and optimizing agricultural environmental impacts. Artificial neural networks (ANNs) are one of the known methods that have been used as the data-driven models [23]. Neural networks conventionally contain three layers including inputs layer, hidden layers and output layers in which a computational map between inputs and output(s) could be generated [23]. A robust data-driven model based on the neural networks is highly advantageous for simulating complex issues such as crop yield in the agriculture. In fact, simple statistical models are not able to predict the yield. In contrast, neural networks might be a robust option in this regard. Some efforts have been carried out to improve the performance of neural networks. For example, neuro fuzzy inference systems have been recommended as an improved neural network model in which fuzzy inference system is applied in the structure of the neural network [24].
Integrated assessment and optimization of environmental impacts of water and energy use might be a challenge that was the main motivation of the present study. In fact, previous studies focused on the optimal energy use with highlighting environmental impacts of irrigation supply [7]. However, water-energy nexus should be considered in an integrated assessment. This issue might be more challenging due to impact of climate change in the future years. The present study proposes a novel optimization framework for balancing the environmental impacts of water-energy use and economic benefits of farming under the climate change condition. Combining data-driven models and evolutionary algorithms considering climate change models generate a framework that is more robust compared with previous studies for integrated environmental management of agriculture.
To sum up, the objective of the present study is to mitigate environmental degradations due to water and energy use while the economic benefits of farming (yield) are maximized under the current condition and climate change impacts.

Overview on the methodology
Due to complexities of the developed model, it is useful to have overview on the methodology that might be helpful for the readers. Figure 1 displays the workflow of the proposed method in which four main parts are identifiable. First, impact of climate change on the stream flow is simulated to predict the future stream flow time series to the diversion dam where is responsible for supply of irrigation demand. Then, a data-driven model is developed to predict rice field production in which water and energy use are the main inputs of the model. In the next step, ecohydraulic simulation is utilized to develop ecological impact function at the downstream river of the diversion dam in which fuzzy physical habitat simulation was applied. Finally, outputs of the simulations are applied in the structure of the optimization model in which three purposes were defined including minimizing energy use, mitigating ecological impacts on the river ecosystem and maximizing the yield of rice production.

Climate change impact assessment on the stream flow
This model contains two parts including assessing impact of climate change on the rainfall in the future periods and converting rainfall to runoff to simulate stream flow in the future years. The fifth assessment report by the IPCC in which the Coupled Model Intercomparison Project phase 5 (CMIP5) with four different RCP scenarios (RCP2.6, RCP4.5, RCP6 and RCP8.5) have been introduced was applied in the present study. More details have been addressed in the literature [23]. General circulation models (GCMs) as one of the known methods to project the impact of climate change have coarser scale that means downscaling might be helpful to have more accurate results. Long Ashton research station weather generator (LARS-WG) was applied for downscaling that has been addressed in the previous studies [24,25]. Precipitation was projected in the four 20-yearperiods (2021-2040, 2041-2060, 2061-2080 and 2081-2100) by the selected CMIP5s including CanESM2 (CM1), MIROC5(CM2) and NorESM1-M (CM3) for RCP 4.5 and RCP8.5. In the next step, the runoff routing model was utilized to simulate stream flow in the future period. Soils and water assessment tool (SWAT) as a familiar tool for simulating stream flow was used in this regard. More details regarding the methodology of SWAT have been addressed in the literature [27]. Figure 2 displays the flowchart of this model to simulate stream flow. The calibration and validation process of the model was carried out using SWAT-CUP as a standalone software that is developed for this purpose. Methodology of SWAT and optimization process by the SWAT-CUP have extensively been described in the literature [28]. Hence, more details are not presented in this section. It is also required to use some indices for measuring the performance of the model. In the present study, we applied two indices including NSE and RMSE to measure the robustness of the model for simulating stream flow as displayed in the following equations. More details regarding RMSE and NSE have been addressed in the literature [31,32].  [33] where O t , M t and O m are observed flow, modelled flow in each time step and average of the observed flows in each microhabitat, respectively.

Modelling rice yield
The main effective parameters on the rice yield are inputs of the energy consumption and water use. Other factors might be effective on the production. However, we assumed that other factors are suitable and will not be changed in the study area that might be a logical assumption. Development process of the data-driven model of the rice yield includes two sections. In the first section, the field studies were carried out in the study area in which questionnaire was filled by the farmers. In the questionnaire, farmers should fill the energy inputs for rice production, water use and yield of the production. More than 100 farms were selected in the field studies in which farmers helped the research team to record accurate results from the rice production in the study area. Then, energy inputs were converted to the total consumed energy considering energy equivalent coefficients as displayed in Table1. Equation 3 was used to compute total energy consumption.
In the next step, An ANFIS-based model was developed to predict the rice yield in which water and energy use are inputs of the model and the yield of the production (Kg/Ha) is the output of the model. Figure 3 displays the flowchart of the ANFIS-based model to simulate yield of the production. This model was applied in the structure of the optimization system. Subtractive clustering was used in the ANFIS-based model. Moreover, hybrid algorithm was used in the training process of the data-driven model. Equation 3 was used to compute total energy use in which F i is effective input of the energy use and C i is energy equivalent coefficient and I is total number of the inputs. Moreover, TE is total energy use in MJ/Ha. In other words, Eq. 1 computes total energy consumption in the area unit of the farm.

Fig. 3
Structure of ANFIS-based data-driven model (X is water use, Y is energy use and f is rice yield) [34] Ecological impact function of river ecosystem Fuzzy physical habitat simulation was utilized to develop the ecological impact function in the river ecosystem. Two steps are required in this method. First, field studies and using expert opinion to develop verbal fuzzy rules. Secondly, combining fuzzy rules with one-dimensional hydraulic simulation to develop ecological impact function. A representative reach with length of 1000 m was selected at downstream of the diversion dam in the case study for field studies and habitat simulation. Fish observations were carried out by electrofishing method as one of the applicable methods for ecological field studies in the river habitats. Moreover, velocity, depth and substrate were measured in the sampling points. Furthermore, cross sections were surveyed for the hydraulic simulation purpose. More details regarding the methodology of field studies and measurements have been addressed in the literature. The representative reach was simulated by HEC-RAS 1D model in the steady state for different stream flows. Figure 4 shows the workflow of the developing ecological impact function in the present study.

Optimization system
The main component of the developed optimization system is objective function in which three purposes were considered including 1-minimizing energy use for reducing GHG emission in the study area 2-mitigating ecological impact on the river ecosystem due to supply of irrigation demand and 3-maximizing the yield of production. First, the optimization model was applied in the current condition and then different scenarios of the climate change were applied in the optimization model. The outputs would demonstrate how the developed system is able to manage impact of climate change on the rice production while environmental impacts are alleviated. Outputs of the simulations were applied in the structure of the optimization system. Equation 4 displays the developed objective function in the presents study. The average year of 20 years period in the current condition and the future periods was simulated by the optimization model. Hence, T is 12 months for each optimization process by the model.
where NWUA is natural weighted useable area in the river, OWUA is optimal weighted useable area in the river, OPY is optimal yield of the crop production, MXY is maximum yield of the crop production observed in the field studies, OPE is optimal energy use and MXE is maximum energy use observed in the field studies. Each optimization model might need some constraints that should be defined based on the purposes and requirements of the model. In the proposed optimization system, three constraints should be defined including minimum water use or irrigation demand for the rice production, maximum water use for Workflow of the physical habitat simulation in the proposed framework [16] rice production and minimum and maximum energy consumption for rice production in the study area. More details reading the considered values for these constraints will be presented in the next section. Moreover, environmental flow should not be more than available water in the river. Penalty function is a known method to convert the constrained optimization problem to unconstrained one that has been used in many previous optimization models of the water resource management. Due to advantages of this method for applying in the structure of the metaheuristic optimization, this method was utilized in the present study. Thus, five penalty functions were added to the optimization model as displayed in the following equations.
Equations 4-8 have been developed in the present study. Some assumptions were considered for developing the above Eqs. (4)(5)(6)(7)(8) and running the optimization model. First, physical habitat loss is the main effective factor in the ecological assessment of the river ecosystem. Secondly, water and energy use are the key parameters for the rice production in the study area. Thirdly, mathematical and technical constraints as defined in the equations are needed to improve the performance of the optimization model.
Particle swarm optimization (PSO) as one of the known classic evolutionary algorithms was utilized in the present study to minimize the objective function. The flowchart of PSO is displayed in Fig. 5. More details regarding the methodology of this evolutionary algorithm to find the best solution for the optimization problems have been addressed in the literature [29].

Case study
The proposed framework was implemented in the Talar river as one of the known rivers in the Mazandaran province, Iran. Mazandaran is one of the northern provinces in Iran where is a known place for cultivating rice due to high humidity and appropriate temperature. In fact, the main economic activity for the people in Talar river basin is agriculture with a focus on the rice production. On the one hand, due to proper price of rice, farmers are willing to maximize the yield of  [29] production without considering environmental degradations in the region. On the other hand, environmental managers have serious concerns in terms of three aspects. First, GHG emission is a general environmental concern in the province that means minimizing energy use in the agriculture is helpful for increasing environmental sustainability. Secondly, several valuable native fish species live at the downstream of diversion dam that is responsible for supply of irrigation demand. In fact, increasing offstream flow might reduce the instream flow considerably that destructs the valuable aquatic habitats in the river. Thirdly, the impact of climate change on the environmental sustainability of the river basin is ambiguous that might raise the environmental destruction in the future years. The environmentalists and farmers face complex problem that might not be manageable easily. In other words, negotiations between farmers as the stakeholders and environmentalist might be escalated due to complexities in the management of the environment. It seems that an integrated framework for managing climate change impacts in which yield of production is maximized while GHG emission and ecological impacts on the river ecosystem are mitigated. In fact, this framework is able to reduce environmentalists and farmers' concerns under the current condition and potential impact of climate change. Figure 6 displays the location of Talar basin, river network, location of diversion dam at downstream and land use. The rice fields at downstream of river could be observed that their irrigation demand is supplied using water diversion project. According to the recommendations by the regional agricultural department, minimum energy use, maximum energy use, minimum water use, maximum water use were defined 13,481 MJ/Ha, 60,897 MJ/Ha, 1050 m 3 /s and 3940 m 3 /s.

Results and discussion
It is necessary to present outputs of the simulations and optimization in the proposed method. Relevant interpretation and discussion on the results will be presented for each part of results. First, the outputs of the rainfall-runoff modelling are presented. Figure 7 displays the validation of the SWAT output in which RMSE and NSE are displayed in this figure. It is essential to compare result of SWAT in the present study and previous studies. It has been demonstrated that the response of SWAT for simulating rainfall-runoff might not be the same in different basins. However, when NSE is more than 0.5, the difference between observations and simulations is not significant that corroborates the performance of the SWAT in the present study [35]. Furthermore, application of SWAT in the environmental assessment of the river ecosystems has been highlighted in the literature [36]. Hence, the proposed method to assess river ecosystem could be reliable.
In the next step, it is necessary to present results of fuzzy physical habitat simulation in the simulated river reach at downstream of diversion dam where is responsible for supplying irrigation demand. Table 1 displays part of the verbal fuzzy rules based on developed methodology for physical habitat simulation. The final output of physical habitat simulation (i.e. the ecological impact function) is displayed in Fig. 8. In fact, this function defines the relationship of normalized weighted useable area respect to the river flow that might be useable as the environment index to assess ecological degradation in the river ecosystems. As an interpretation on the physical habitat simulation in the case study, the impact of flow velocity on the physical habitat suitability is considerable that means the flow velocity is effective on the energy consumption by the fish. Depth and substrate will affect the habitat suitability as well. However, our observations and expert opinions demonstrated that flow velocity is highly more important than two other parameters in the case study. It should be noted that the outputs and conclusions on the fuzzy physical habitat simulation are only applicable for the target species in the case study. It is recommendable to apply other methods of physical habitat simulation in the future studies. It is necessary to compare the outputs of the present study in terms of physical habitat simulation with the previous studies. The considerable impact of flow velocity on the fish habitat suitability has been highlighted in the literature [37,38]. As discussed, the present study corroborated the impact of flow velocity on the suitability of fish habitats. The previous studies pointed out that the relationship between flow and weighted useable area is not linear and direct [39]. Interestingly, the results of this study indicate a nonlinear relationship between the river flow and weighted useable area.
The predicted mean stream flows in the simulated period by different climate change models in all the scenarios are not displayed for having concise presentation on the results. However, interpretation on the impact of climate change on the river flow is explained for clarifying how the climate change might have impact on the stream flow in the case study. Results of stream flow simulation in the future periods corroborate the considerable impact of climate change on the stream flow in the case study. In fact, simulation of climate change impact on the irrigation supply is not negligible for optimal management of agriculture in the case study. Comparing results of climate change modelling combined with the environmental flow modelling could be helpful for the future studies. It has been demonstrated that the environmental flow regime could be subject to climate change risk [40]. As could be observed in Fig. 9, the environmental flow in the climate change scenarios could be highly different compared with the current condition. Hence, previous studies and the present study highlight the importance of climate change modelling in the assessment of the environmental flow in the river ecosystems.
The results of optimization model should be presented and interpreted as well. Moreover, it matters to discuss how the optimization model can carry out defined responsibilities. Figure 9 shows the results of the optimization model in terms of mitigating ecological impacts on the river ecosystem. As a general interpretation on this figure, the physical habitat loss in the natural flow is averagely 0.55 while the physical habitat loss in the optimal environmental flow is averagely 0.7. In fact, physical habitat loss by the optimization model is 0.15 that seems logical and acceptable. Results indicate that the optimization model provided a fair balance  Outputs of the optimization model regarding mitigation of ecological impacts in the river ecosystem (A: optimal river environmental flow, B: optimal normalized weighted useable area generated by the optimization model, C: normalized weighted useable area in the natural flow in other words no irrigation supply by river and D: comparing normalized weighted useable area in the optimal water supply and natural flow) for the river ecosystem in all the climate change scenarios. In other words, it provides a sustainable ecological status for all the climate change scenarios. However, it is not able to increase the suitability as well as the physical habitat suitability in the natural flow. In other words, it is not expectable to simulate the physical habitat like the natural flow in the optimization system. The developed optimization system is a multipurpose model that should support environmental requirements as well as protecting rice production in the study area.
Another environmental purpose for the model is to minimize energy use for the agriculture. In fact, the optimization model should be able to mitigate ecological impact on the river ecosystem and energy use while the rice production should not be reduced considerably under the impact of climate change. Figure 10 shows the performance of the optimization model in terms of water and energy use and rice production. The optimization model tried to adjust the energy use to maximize the yield of the rice. The optimal solution in the current condition and potential impact of climate change in terms of rice production is the same that means the optimization model is able to mitigate the impact of climate change on the rice production. However, the energy use is increased in some scenarios. Increase or decrease in energy use means changing the inputs such as fertilizers. As interpretation in Fig. 10, it seems that the optimization model excellently carried out the defined purpose. In fact, water consumption or irrigation supply is changed based on available stream flow in different climate change scenarios considering the environmental flow in the river. The results of the simulations and optimization demonstrate that the climate change might alter the offstream flow or irrigation supply by the river considering ecological impacts on the river ecosystem that might be challenging. However, the proposed model could balance the water and energy consumption for protecting the rice production.
It is also required to investigate how changing the energy use would affect the inputs of the agriculture. We considered the most optimistic scenarios (OPT scenario) and the most pessimistic scenario (PES scenario) in which energy consumption is minimum and maximum, respectively. According to the results, the optimal energy use in the current condition and OPT and PES scenarios are 45,227, 27,169 and 48,839 MJ/Ha, respectively. In other words, the climate change reduces the energy consumption in the OPT scenario in which more water is available for the irrigation. Conversely, the optimization system increases the energy use in the PES scenario for adjusting the yield of the rice. It seems that the impact of climate change on the rice production is not significant. Because the optimization model did not need to increase the energy use in the PES scenario. Interestingly, it sounds that the climate change might be helpful to increase the irrigation supply that might lead to reducing GHG emission by the agriculture in the case study. Table 2 displays the proposed inputs of the energy use for the rice production in three conditions including current condition, OPT scenario and PES scenario. It seems that the energy inputs are reduced more than 30% in the OPT scenarios that indicates the applicability of the proposed method. Moreover, the consumption of inputs such as fertilizers is slightly increased in the PES scenario. It should be noted that the results of the present study are not reliable for using in other regions even if the climatic condition is like the case study of the present research. In other words, all the developed models including the climate change modelling, the ecological impact function and predicting rice production should be carried out based on the local data. However, the framework of the optimization system might not need to be changed. The results of the present study corroborate the robustness of the model in the future applications. Moreover, this model could be extended for other crops as well. However, the structure of the yield prediction model should be changed based on the requirements of the crop. For example, the requirements of predicting the yield of orchards' crops are not the same with the annual crops such as rice.
Different aspects of the developed model should be discussed as well. Each model might have some advantages, drawbacks and limitations that should be considered in the applications. The proposed method comprises four main parts including climate change modelling, ecological impact assessment, simulating rice production and optimization system that should be considered in the discussion. First, it should be clarified how the proposed model could be useful for stakeholders. On the one hand, the main advantage of the proposed optimization model for the farmers as the stakeholders in the study area is how the model is able to mitigate potential impact of climate change on the rice production. On the other hand, environmental managers are willing to minimize environmental degradations by the optimization model. As presented, the optimization model properly mitigated the physical habitat loss in the river ecosystem in the current condition and impact of climate change. Results indicated a complex relationship between the impact of climate change on the irrigation supply and energy use in the case stud study. It should be noted that the case study of the present research is a humid region in Iran. According to the climatic studies in Iran, most of the available areas are in the arid and semi-arid regions. However, two northern provinces including Mazandaran province and Guilan province are in the highly humid area that means the impact of climate change on the precipitation in these provinces might be different from other regions. The climate change might exacerbate the humidity of the humid regions and aridity of the arid regions in the future years. However, climate change modelling is essential in all the regions to judge on the future condition. Based on the climate change modelling in the case study, considerable increase in precipitation might be possible in the future years. In other words, the climate change effect could be used positively to manage the GHG emission by the agriculture. In fact, increasing precipitation in the optimistic scenarios of climate change might be helpful to reduce inputs of energy use in the rice production such as fertilizers.
Moreover, the results of the present study demonstrate that the impact of climate change on the agriculture might be complex and simulation of the effects in different regions is necessary. On the one hand, the proposed method could reduce energy use or GHG emission of the agriculture in the optimistic scenarios. On the other hand, it could protect rice production in the study area by adjusting or increasing the energy consumption in the pessimistic scenarios in which irrigation supply could be diminished. In fact, the proposed optimization model could utilize the positive effects of climate change on the precipitation to reduce the GHG emission in the case study. It indicates that the application of optimization systems of the climate change impacts in the regional scale could be helpful for better management of the agriculture towards the environmental sustainability. More details regarding methodology of the present study should be discussed. We applied the coupled GCM-SWAT to simulate the stream flow in the future periods. This system has extensively been used in the previous studies that indicated the reliability of this method. However, it might not be applicable in all the cases due to need for extensive data such as land use and digital elevation model. Hence, it is recommendable to apply other methods such as machine learning methods for cases in which adequate data are not available for hydrological simulation of run off. Furthermore, we applied the fuzzy physical habitat simulation in the assessment of the ecological impacts or development of the ecological impact function. However, this method is not applicable in all case studies. In other words, using expert opinions by the experienced ecologist is one of the requirements for developing the verbal fuzzy rules in this method. If it is not possible to apply this method for developing the ecological impact function, other methods could be replaced. For example, neuro fuzzy inference system could be one of the good options for cases in which fuzzy physical habitat simulation is not useable. Furthermore, it should be noted that water quality was not considered in the assessment of the ecological status of the river ecosystem in the case study. However, it might be necessary to add the water quality models to the ecological impact function in other case studies. Hence, we recommend focusing on adding water quality to the ecological impact function in the future studies.
Optimization system is another important aspect that should broadly been discussed. We developed a single objective optimization model in the present study that is able to simulate all the losses by applying a single objective function. At the first glance, it seems that using a multiobjective algorithm might be a good option to handle the designed optimization problem. In fact, the proposed objective function consists of several standalone functions. However, two serious disadvantages might confine the application of multiobjective optimization algorithms. First, computational limitations are the first disadvantage of the multiobjective optimization. In the computer science, the computational complexities of the optimization algorithms are defined as the needed time and memory to present an optimal solution. High computational complexities might make the optimization problem cumbersome. In fact, it is required to carry out the numerous simulations or having simulation for a long-term period in the real projects. Hence, it is expected that high computational complexities reduce the engineers' willingness for applying the proposed optimization system. In the present study, the data-driven model was applied in the structure of the optimization model that increases the computational complexities for the system. Multiobjective algorithms inherently have higher computational complexities compared with the single objective optimization algorithms that means more time and memory might be needed for finding the best solution. Hence, the developed single objective function in the present study might be highly advantageous in this regard. Moreover, the limited number of multiobjective optimization algorithms has been developed in the literature that might confine the application of these algorithms. In fact, one of the drawbacks of the evolutionary algorithms is inability to guarantee the global optimization that means using different algorithms might be helpful to find the best solutions. Hence, it might not be proper to use the multiobjective algorithms in the proposed optimization model. Utilizing the single objective function is beneficial for applying a wide range of evolutionary algorithms in the optimization process.
Some points should be discussed for clarifying how the results of the optimization system could connected. Furthermore, advantages of the proposed method regarding the economic benefits of agriculture should be emphasized as well. The results of the proposed optimization system under the current condition and climate change impacts consist of three parts including optimal water use, optimal energy use and optimal production. The optimal water use means the ecological impacts on the river ecosystem as the water resource are alleviated. Thus, the optimal water use could reduce concerns regarding ecological impacts of water supply. Moreover, the optimal energy use is able to minimize environmental concerns regarding the greenhouse gas emission due to farming. In contrast, optimal crop production (yield) is able to minimize the farmers' concern regarding the reduction of benefits due to alleviating environmental impacts under the current condition and impact of climate change. Another should be discussed is how the proposed optimization model could be advantageous in terms of agricultural benefits. As displayed in Fig. 10, rice production is the same in all the scenarios that means the optimization model could protect the farmers' revenue properly. In fact, if reduction of environmental impacts is aimed, the crop production might be reduced without using an integrated framework. Decreasing water and energy use is highly effective on the crop production that means diminishing crop production is predictable in the absence of integrated optimization framework. However, the proposed system in the present study is able to minimize farmers' concerns reading reduction of revenue due to alleviating environmental impacts of water and energy use.
We recommend utilizing the proposed method for facing challenges of the climate change in the agricultural production. The proposed framework corroborates the strong relationship between water and energy for the agricultural production. In other words, using water-energy nexus approach 1 3 is necessary for assessing the agricultural production. A balance between water and energy use is useful to mitigate impact of climate change on the agricultural production. The present study proposed a principal optimization framework to mitigate impact of climate change on the rice production in which many improvements could be carried out in the future studies. In fact, it might open new windows on the application of hydrological models, environmental models and optimization algorithms for managing the impacts of climate change on agriculture and increasing environmental sustainability in the river basin scale. A point should be noted for the future studies. In the case study, water and energy are the main variables for changing the rice production. In other words, other factors are acceptable that might reduce the complexities of the model. However, it might be needed to add other factors such as social aspects and climatic condition to the model. It should be noted that we assumed that the temperature for cultivation of the rice in the future periods is acceptable like the current condition. Hence, it seems that improvement of the yield prediction model is necessary in the future studies that might increase the applicability of the proposed method. It should be noted that the proposed model in the present study is a novel combined model that could be improved based on the needs of other case studies.

Conclusions
The proposed optimization framework could balance the environmental impacts of water-energy use and economic benefits of agriculture (crop production) under different climate change scenarios. In the most pessimistic scenario of climate change, water use should approximately be reduced 25% for protecting river ecosystem. However, the optimization model approximately increased energy use 16% for preserving economic benefits of farming (i.e. yield of the rice). Conversely, model decreased the energy use 40% compared with the current condition due to increasing water supply. In the current condition and all the climate change scenarios, physical habitat loss is less than 50% that means the proposed optimization model is able to minimize environmental impacts of irrigation supply in the river ecosystem properly. The present study provides a robust framework for facing the complexities in the agricultural management in the future periods in which the potential impacts of climate change are inevitable. Many improvements should be considered in the future studies including focus on other crops, using other types of environmental impacts in the river ecosystem assessment, and applying different data-driven models for assessing agricultural energy use. Moreover, the similar frameworks could be developed for assessing agricultural environmental impacts in the wetlands.
Funding Open Access funding enabled and organized by CAUL and its Member Institutions. No funding sources.

Declarations
Conflict of interest Authors declare that there are no conflict of interests.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.