Hydroeconomic modeling for assessing water scarcity and agricultural pollution abatement policies in the Ebro River Basin, Spain

Water scarcity and water quality degradation are major problems in many basins across the world, especially in arid and semiarid regions. The severe pressures on basins are the consequence of the intensification of food production systems and the unrelenting growth of population and income. Agriculture is a major factor in the depletion and degradation of water resources, and contributes to the emissions of greenhouse gases (GHG). Our study analyzes water allocation and agricultural pollution into watercourses and the atmosphere, with the purpose of identifying cost-effective policies for sustainable water management in the Ebro River Basin (Spain). The study develops an hydroeconomic model that integrates hydrological, economic and water quality aspects, capturing the main spatial and sectoral interactions in the basin. The model is used to analyze water scarcity and agricultural pollution under normal and droughts conditions, providing information for evaluating mitigation and adaptation policies. Results indicate that drought events increase nitrate concentration by up to 63% and decrease water availability by 42% at the mouth of Ebro River, highlighting the tradeoffs between water quantity and quality. All mitigation and adaptation policies reduce the effects of climate change, improving water quality and reducing GHGs ’ emissions, thus lowering environmental damages and enhancing social well-being. Manure fertilization and optimizing the use of synthetic fertilizers are important cost-effective policies increasing social benefits in a range between 50 and 160 million Euros. Results show that irrigation modernization increases the efficient use of nitrogen and water, augmenting social benefits by up to 90 million Euros, and enlarging stream flows at the river mouth. In contrast, manure treatment plants reduce private and social benefits even though they achieve the lowest nitrate concentrations. Our study provides insights on the synergies and tradeoffs between environmental and economic objectives. Another finding is that drought conditions decrease the effec- tiveness of policies, and increase the tradeoffs between water availability and nitrate pollution. The results contribute to the discussion of designing cost-effective policies for the abatement of agricultural polluting emissions into water and the atmosphere.


Introduction
Water resources are vitally important for both human livelihoods and natural ecosystems. Water withdrawals have risen sharply in the last century, placing massive pressures on water resources and causing severe water scarcity and degradation problems in most river basins worldwide, especially in arid and semiarid regions Dasgupta, 2021). These negative impacts are linked to the strong growth in population and income. Climate change is altering precipitation patterns and making extreme weather events more frequent and intense.
Drought is one of the most devastating natural disasters, with serious effects like the shortage of freshwater to meet societal requirements (Ahmadi et al., 2019). Water scarcity and water quality degradation are serious global problems. The challenge is to ensure good quality water to fulfill human, environmental, social, and economic demands in order to support sustainable development (UNESCO, 2021;Berthet et al., 2021). Addressing water scarcity and quality is one important topic of the eighth phase of the Intergovernment Hydrological Programme (IHP--VIII), which focuses on "Water Security: Responses to Local, Regional andGlobal Challenges (2014-2021)". There are critical connections between water availability and water quality (Jury and Vaux, 2005), and both have been associated with human health (Myers and Patz, 2009), food security (Rockström et al., 2009;Simelton et al., 2012) and sustaining natural ecosystems (Poff et al., 1997). This means that water availability and quality should be assessed in a consistent manner to account for the relationships between water availability and quality.
Nonpoint pollution is responsible for 38% of pressures affecting water bodies in Europe, mainly due to agricultural sources such as nitrates and pesticides (European Environment Agency, 2018). Agriculture is a major source of water quality deterioration and GHG emissions to the atmosphere. Both water pollution by nutrients and GHG loads are complex problems arising from excessive use of fertilizers and intensive livestock farming (Bluemling and Wang, 2018). Nitrous oxide (N 2 O) and methane (CH 4 ) are a potent GHGs that contribute to the planet global warming (IPCC et al., 2007;Kanter et al., 2017). Rivers receive large quantities of nutrients, which cause water eutrophication and create large hypoxic dead zones in some regions (Breitburg et al., 2018). Parris (2011) highlights that agricultural water quality is a major environmental issue in OECD countries, and it is a relevant matter for policy consideration in all OECD countries.
Protecting water resources and natural ecosystems requires robust institutions, coupled with compelling and enforceable water policies. Sustainable river basin management is a quite challenging task, considering the current scale of global water degradation in basins. The methodologies needed to address this challenge call for a better understanding of water management problems in order to deploy effective and politically viable measures dealing with water scarcity, droughts, climate change and pollution. Sustainable management of water resources for different uses will not only depend on water quantity withdrawals, but also on nutrient loads, organic matter, salinity, water temperature, and other pollutants (Van Vliet et al., 2017;Barbieri et al., 2019).
The use of hydroeconomic modeling is increasing, driven by the advances of integrating hydrology, environment, and socio-economics in the analysis of water resources management. Several studies investigate the problem of water allocation among sectors using hydroeconomic modeling to assess water policies Kahil et al., 2015Kahil et al., , 2016aKahil et al., , 2016aEscriva et al., 2018). Other studies emphasize sectoral and spatial interactions in catchment areas (Bekchanov et al., 2015;Kahil et al., 2016bKahil et al., , 2018Dogan et al., 2018;Crespo et al., 2019). Despite the widespread use of hydroeconomic modeling in assessing water allocation, the inclusion of the policy analysis for the abatement of water pollution is limited.
The inclusion of water quality is a topic of growing relevance, although there are few studies analyzing water quality by using hydroeconomic modeling. Some examples are salinity pollution (Cai et al., 2003;Aein and Alizadeh, 2021), arsenic in drinking water (Ward and Pulido, 2008), organic matter loads (Moraes et al., 2010), biochemical oxygen demand (Gunawardena et al., 2018), nitrate pollution (Carolus et al., 2020), and environmental and salinity damages in terms of water savings, replacement costs or crop production damages Young, 1991, 1994;Brown et al., 1990;Cai et al., 2002;Divakar et al., 2011). Recreation benefits such as boating and fishing are sometimes included in relation to stream flows evaluation, and travel cost or contingent valuation techniques are used for valuation of the ecosystem services (Ringler et al., 2004;Babel et al., 2005;Booker et al., 2005;Ringler and Cai, 2006;Ward and Pulido, 2008. In Spain, there are only a couple of previous studies on water pollution abatement using hydroeconomic modeling, where the modeling framework was applied to a hypothetical groundwater system (Peña-Haro, 2009, 2011, 2011. Some studies assess the tradeoff between water quantity and quality using a simulation model (Yang et al., 2015). However, the tradeoffs between water scarcity and water quality degradation using an optimization model remain unsettled in the literature. The advantage of using an optimization model is in the capacity of the model to maximize the economic benefits under water scarcity and agricultural nonpoint pollution simultaneously, which involves a more realistic approach. This integrated hydroeconomic model is designed to find the most cost-effective management policies (Heinz et al., 2007) and to make socially optimal policy decisions (Gunawardena et al., 2018). The assessment of the relationship between water quantity and quality is important to strengthen hydroeconomic modeling, in order to understand and realize its full power to inform critical policy debates.
In this paper, an integrated hydroeconomic model is developed addressing both water allocation and agricultural nonpoint pollution, with the purpose of looking at the tradeoffs between water quantity and water quality under normal and drought conditions. The model estimates agricultural pollution impacts on both the watercourses (nitrates) and the atmosphere (nitrous oxide and methane). The integration of hydrological, economic and environmental components captures the interactions among components. This provides a better assessment of water allocation options among sectors and spatial locations, showing the large negative impacts of droughts on the system. 1 Selected climate change mitigation and adaptation policies are evaluated under normal climate and severe drought conditions in order to identify the effectiveness and robustness of policies. These policies could boost the efficient use of nitrogen and water in agricultural activities, reduce pollution loads and improve water and air quality, or protect environmental flows. The hydroeconomic model is developed to analyze the Ebro River Basin in northeastern nearly all basins in Spain are under mounting scarcity pressures and water quality problems that require effective policy intervention (Lassaletta et al., 2009). Climate change and agricultural nonpoint pollution problems have to be tackled locally, with practical alternatives addressing water depletion and pollution.
This study contributes to the literature performing a detailed concurrent assessment of water allocation and pollution abatement solutions at river basin level, using hydroeconomic modeling. The study analyzes how to achieve a more sustainable management of the Ebro Basin, but also contributes to the scientific debate on sustainable policies and measures for water management worldwide. The results of this paper highlight the strong links between water quality and water quantity in the basin, and show that drought conditions reduce water availability and dilution processes, increasing nitrate concentration in water media. Our results indicate also that mitigation and adaptation policies have a double effect by abating pollution into the atmosphere and in watercourses, thus reducing environmental damages and enhancing social welfare.
The paper is organized as follows. Section 2 presents a general description of the study area and the main economic activities in the basin. Section 3 explains the development of the integrated hydroeconomic model for the Ebro basin. Section 4 describes the main results of the mitigation and adaptation policies, and the drought impact in 1 Costs of drought damages have been estimated at $8 billion per year in the United States (NOAA, 2021), and around 9 billion € per year in the European Union (Cammalleri et al., 2020). Hernández et al. (2013) estimate the cost of the 2005 drought in the Ebro basin at 0.5% of GDP. The evidence during recent years indicates that the drought anomaly in Europe is unprecedented (Büntgen et al., 2021).
water quantity and quality, and section 5 discusses the main findings. Finally, section 6 summarizes the main conclusions.

The Ebro Basin
The Ebro Basin, located northeast of the Iberian Peninsula, is one of the main European Mediterranean basins. It covers an area of 85,600 km 2 , a fifth of the Spanish territory, and its streamflow is one of the largest in the country. Natural ecosystems of great value cover 30% of the basin area. Precipitation occurs mainly in the Pyrenees, where it exceeds 1000 mm/year, while it does not exceed 350 mm/year in the central part of the basin, where conditions are semi-arid (CHE, 2015). The most important tributaries (Zadorra, Aragon, Gallego, Cinca and Segre) supply the canals of the main irrigation districts and also the most important urban areas in the basin (Fig. 1).
The renewable resources of the Ebro basin are estimated at 14,600 Mm 3 , and withdrawals amount to 8460 Mm 3 , of which 8110 Mm 3 are surface diversions and 350 Mm 3 are groundwater extractions (CHE, 2015). Water use in agricultural activities is estimated at 7680 Mm 3 and urban extractions amounts to 357 Mm 3 supplying three million inhabitants, including households and industries connected to urban networks. The irrigated crops in the Ebro Basin are field crops, fruit trees and vegetables covering an area of 750,000 ha, distributed under surface, sprinkle and drip irrigation technologies (CHE, 2016). The Ebro River is one of Spain's rivers with substantial minimum environmental flows at river mouth. The Ebro water plan of 2015 established the current level of this environmental flow at 3000 Mm 3 /year.
The Ebro Basin Authority is responsible for water management, water allocation, water quality, and water planning and control. The special characteristic of this institutional approach is the key role played by stakeholders, which are involved at all decision making in the basin governing bodies and in local watershed boards. The Ebro Basin Authority or Confederación Hidrográfica del Ebro (CHE, 2020) indicates that nonpoint pollution represents one of the main pressures on the Ebro coming from agricultural and livestock activities. Almost half surface waters in the basin are being significantly affected, particularly in its middle and lower reaches (Ollero, 2007;Vericat and Batalla, 2006). The mean annual streamflow has decreased 40% in the last 50 years because of the expansion of irrigation, decreasing rainfall and revegetation (Buendia et al., 2016). The ecological condition of water bodies is threatened by these hydrological alterations and nonpoint pollution loads, impairing the dilution capacity. Herrero et al. (2018) highlight that changes in land use, rainfall, water temperature, and nitrate concentration could lead to a general decrease in the ecosystem quality of water bodies within the basin. Overall, water quality pressures from agricultural nonpoint pollution are degrading the status of water bodies in the Ebro, and require the active intervention of state and federal public authorities together with all water stakeholders.

The hydroeconomic model
Water is an essential component of sustainable development, underpinning almost all types of economic activities, human water security, and ecosystems services. Challenges to water management such as water scarcity, pollution loads, and the impacts of climate change are threatening human wellbeing and biodiversity. Hydroeconomic analysis is one type of water-economy modeling, which is based on the hydrologic network of river basins. The hydroeconomic approach has clear advantages in evaluating management and policy strategies for adaptation to climate change, by providing efficient water allocations and pollution abatement across water uses and spatial locations. Hydroeconomic models have achieved greater sophistication by integrating agronomic, hydrologic, and economic components (Cai et al., 2003;Harou et al., 2009;Booker et al., 2012;Ward, 2021). This involves a more realistic approach to water allocation and water quality trade-offs across space and sector, and less reliance on temporally and spatially integrated demand functions used by economywide models (Bekchanov et al., 2017).
The hydroeconomic model is used to analyze water allocation among sectors and spatial locations, nonpoint pollution loads across the basin, and also to evaluate drought scenarios and climate change mitigation and adaptation measures. The policy analysis deals with both water allocation adjustments under droughts and climate change, and pollution abatement of nutrient loads and GHG emissions. The model includes the main water uses in the basin: irrigation, livestock, and urban and industrial. Dryland crops are also included in the assessment of pollution emissions. The model integrates three components: (1) the hydrological component, (2) the regional economic component, and (3) the environmental component (Fig. 2).

The hydrological component
The hydrological component is a reduced form hydrological model of the Ebro basin, calibrated with observed stream flows. The reduced form hydrological model is a node-link network, in which nodes represent physical units impacting the stream system, and links represent the connection between these units. The nodes are classified into supply nodes such as rivers, and demand nodes such as irrigation districts, livestock, households and industries. The links could be rivers or canals, and stream flows between supply and demand nodes are characterized by simplified equations using the hydrological concepts of mass balance and continuity of river flows (Kahil et al., 2015). The representation of the interactions among nodes is based on detailed information on each node's spatial location and physical characteristics. The component incorporates information on inflows, withdrawals, return flows and losses, and water metering at selected measurement stations in the basin. The model can simulate the flows at each node and the distribution of water availability between sectors and spatial locations. The hydrologic component is developed using the databases of CHE (2016), and it is calibrated with the observed historical allocations in selected stations of the basin (see Fig. 1S for further details on the Ebro hydrological system). The mathematical formulation is given by the following equations: The first equation shows the mass balance and determines the water outflow Wout d in river reach d, which is equal to the inflow Win d minus water losses Wloss d , and minus the diversions for irrigation Div IR d , urban use Div URB d and livestock use Div LIV d . The second equation guarantees flow continuity in the basin. Win d+1 is the water inflow into the following river reach d + 1 as the sum of the outflow from the upstream water reach Wout d , the return flows from upstream irrigation dis- , and the runoff entering the river reach from tributaries RO d+1 . The third equation specifies that the water outflow in river reach d must be greater than or equal to the minimum environmental flow imposed on that river reach.
The hydrologic component is calibrated by introducing slack variables in every river reach to balance supply and demand at every node. These variables represent unmeasured water sources or uses. This calibration procedure reproduces the water flows observed in the reference conditions. Water inflows, outflows and characteristics of flow rates in rivers and channels have been taken from databases and reports by CHE (2016) and CEDEX (2020).

The regional economic component
The regional economic component consists of optimization models for irrigation districts, for livestock and dryland crops, and for urban economic surplus. For irrigation, the component is set at irrigation district scale to maximize the benefits of crops subject to a set of technical and resource constraints. Yield functions are linear and decreasing in cropland area, with constant input and output prices. The optimization problem is as follows 2 : where B IR k is the private benefit in each irrigation district k and C ′ (IR) ijk is net income per hectare of crop i using irrigation technology j. The decision variable of the optimization problem is X IR ijk , the area of crop i with irrigation system j. Irrigated crops are grouped into field crops, vegetables and fruit trees, using surface, sprinkler and drip irrigation systems. Field crops are irrigated by surface and sprinkler irrigation, while vegetables and fruit trees are irrigated by surface and drip irrigation.
Equation (5) is the land constraint and it represents the land available in each irrigation district k equipped with irrigation system j, Tland kj . Equation (6) is the water constraint and it represents the water available in each irrigation district k, Twater k , where W ijk is the requirement for water per hectare and per crop i with irrigation system j. The level of available water, Twater k , is the variable linking the optimization model of the irrigation districts and the hydrological component. Equation (7) is the labor constraint and it represents the labor available in each irrigation district k, Tlabor k . L ijk is the requirement for labor per hectare of crop i with irrigation system j. Equation (8) is the nitrogen constraint and it represents the nitrogen available in each irrigation district k, Tnitrogen k . N ijk is the nitrogen applied per hectare of crop i with irrigation system j. Equation (9) is the non-negativity constraint of the crop surface area. Net income per hectare C ′ (IR) ijk is the difference between revenues and costs and it is defined as: where P i is the price of crop i, Y ijk is the yield of crop i under irrigation system j in irrigation district k, and CP i represents the direct and indirect costs of crop i. The Ricardian rent principle is used in the yield function by assuming that yield decreases as the scale of production increases. The yield function is linear and decreasing in the area of crop i under irrigation system j and it is expressed by: Positive mathematical programming (PMP) is used to calibrate irrigated crop production following the approach of Dagnino and Ward (2012) in order to solve the aggregation and over-specialization problems. The procedure estimates the linear yield function parameters β0 ijk and β1 ijk .
Livestock and dryland cultivation components are set at watershed board scale, and maximize benefits subject to technical and resource constraints. A constant yield production function for crops and constant input and output prices are used (see A1 in Appendix A of Supplementary Materials for further details). The economic benefits of urban water use are determined using a social surplus model, by maximizing the consumer and producer surpluses for the main urban centers in the basin, subject to the water supply and demand balance constraint. The optimization problem is expressed as follows: subject to where B URB u is the sum of the consumer and producer surpluses in urban center u. The variables Q du and Q su are water supply and demand in urban center u, respectively. The parameters a du and b du are the intercept and the slope of the inverse demand function, P du = a du − b du .Q du . The parameters a su and b su are the intercept and the slope of the inverse water supply function, P su = a su + b su .Q su . Equation (13) indicates that water supply is greater than or equal to demand. The variable Q su is the quantity of water supplied and it is the variable linking the urban model with the hydrological component. The water demand parameters have been obtained from the estimates by Arbués et al. (2004) and Arbués et al. (2010).

The environmental component: water and atmosphere pollution
Agricultural nonpoint pollution is analyzed in the environmental component, assessing the environmental damage derived from agricultural activities in the Ebro Basin. The impact of nonpoint pollution is assessed by estimating the nitrate loads into watercourses and GHG emissions from irrigated and dryland crops, and from livestock. GHG emissions from cropland include direct and indirect nitrous oxide (N 2 O), while livestock emissions include methane (CH 4 ) from enteric fermentation and nitrous oxide and methane from manure management. The environmental component includes the minimum environmental flows at each section of the basin. The estimation of the social costs of agricultural nonpoint pollution is a complex task that requires a detailed analysis of the biophysical processes generating source emissions and transport and fate processes, the damages from water and atmosphere pollution, and the costs of these damages.
In this study, the methodology applied to estimate GHG emissions from agriculture is the Tier 1 method of the IPCC (2019a; 2019b). The nitrogen pollution is estimated from leaching and runoff from crops, and from the nitrogen excreted by livestock. The biophysical information for each crop and irrigation system are taken from literature reviews and fertilization practices in Spain published by the Spanish Ministry of Agriculture. Emission factors and the data used in the estimation of GHG emissions are taken from IPCC (2019a; 2019b). We assume also that the NO 3 -N loads reaching watercourses are 40% of all nitrogen loads at the source of pollution, and the NO 3 -N loads reaching the Ebro river mouth represent only 10% of all nitrogen loads at the source of pollution. This is based on the results of Lassaletta et al. (2012), which indicate a high level of retention in the basin (90%). The environmental damage of agricultural activities is the sum of the cost of GHG emissions and the cost of nitrogen pollution into watercourses, and are given by the expression: where the damage of GHG emissions is determined by the volume of GHG emissions (GHG E) and the social cost of carbon (SC) set at 40 €/tCO 2 e, which is taken from OECD estimates (Smith and Braathen, 2015) which are close to current US EPA regulation (US$51/tCO 2 e). The environmental damage from nitrates is calculated multiplying the volume of nitrate loads from crops and livestock (Nload), by the cost to removing nitrate from water (NC) at 1.3 €/kg NO 3 -N (Martínez and Albiac, 2006). Details on calculations are presented in Appendix A of Supplementary Materials.

Ebro optimization model and model application
The optimization model of the Ebro Basin integrates the three components described above, and the objective function represents social benefits, the sum of private benefits (B) minus environmental damages (ED) (See A3 in Appendix A of Supplementary Materials for further details). The maximization of social benefits covers all water sectors and spatial locations. The optimization problem is given by: subject to all hydrological, technical, economic and environmental constraints of irrigated, dryland, and livestock activities. The mathematical programing GAMS package has been used for the Ebro model. The model has been solved using a nonlinear programming algorithm (CONOPT). Ward (2021) indicates that GAMS might be an effective tool for implementing linear, non-linear, and integer optimization. It can solve large systems of non-linear equations simultaneously. The system is flexible, open, and self-documenting, with obvious connections between model formulation and solution.
The hydroeconomic model is used to analyze the interdependence between water quantity and water quality, under normal water inflows and drought scenarios. Drought scenarios are used to understand future drought severity levels, and the ensuing impacts of water scarcity and pollution on social benefits in the basin. Moderate and severe drought scenarios assume reductions of 30% and 40% in water inflows, respectively, relative to the flows under normal climate conditions. Then, the model is used to assess selected mitigation and adaptation policies under normal climate and severe drought conditions. This assessment highlights the role that policies could play in the abatement of nonpoint pollution in watercourses and the atmosphere, and also in identifying the tradeoffs between water quality and water scarcity. The analysis shows the effectiveness of policies under extreme droughts and the impacts on water use, pollution loads and their environmental damages, and social benefit outcomes. The selected policies are P1: Optimization of nitrogen fertilization (by reducing fertilization to crop requirements); P2: Substitution of synthetic fertilization by organic fertilization; P3: Irrigation modernization; P4: Manure treatment plants, (Table 1).

Table 1
Description of policies.

P1
Efficient use of nitrogen fertilization at crop requirements without impacts on yields.

P2
Substitution of synthetic by organic fertilization up to 60% share (from current 27%).

P3
Replacing surface irrigation by more efficient irrigation technologies.

P4
Use of manure treatment technologies to reduce nitrogen emissions.

Water allocation, and nonpoint pollution under normal and drought scenarios
The results of water allocation, environmental damages and social benefits under the baseline and drought scenarios are presented in Table 2. Under normal climate conditions, the. social benefits are 3375 M€ and the total water use reaches 3874 Mm 3 . The irrigated land covers 557,000 ha of field crops, fruit trees and vegetables. Dryland covers 1,194,000 ha and livestock herds amount to 2769 thousand Livestock Units (LSU). Employment in the basin is 37,000 Annual Work Units (AWU) for irrigated crops, 21,500 AWU for dryland crops, and 34,000 AWU for livestock rearing. Results show that nitrogen emissions at the source are 236,000 tNO 3 -N and GHG emissions are 7.15 MtCO 2 e from agricultural activities, which concentrate in Canal de Urgel, Canal de Bardenas, and the lower sections of the Segre and Gallego tributaries, given the large irrigated cropland and swine herds in these areas ( Fig. 3a; Fig. 4). Nitrogen loads entering watercourses in the Ebro are around 94,000 tNO 3 -N, and the nitrate concentration at the river mouth is estimated at 11.3 mg/l NO 3 − under normal climate (Fig. 3b). The environmental damages from water pollution and GHG emissions are 409 M€, which are subtracted from the farming private benefits in order to calculate social benefits. Under drought conditions, water allocation to irrigation districts is reduced proportionally to their regular allocation, while water allocation to urban areas and livestock is maintained. Urban areas take priority over any other water use, followed by livestock. In normal weather conditions, animals only use 1% of water withdrawals, and during droughts water is not a limiting factor for livestock. Under moderate drought, water diversions for irrigation are reduced by 30% with private benefits dropping to 739 M€. Moderate drought reduces irrigated acreage by 35%, especially for less efficient irrigation system. GHG emissions and nitrogen pollution at the source are reduced, while the nitrate concentration at the Ebro River mouth increases by 40% due to the reduction of river flows. Under severe drought conditions, water withdrawals for irrigation are reduced proportionally by 40%. Irrigated cropland generates 686 M€ in private benefits using 2098 Mm 3 of water. The irrigated acreage falls almost by half and nitrogen pollution at the source decreases. However, the nitrate concentration at the mouth of river increases by 63%.
The results show that droughts reduce crops with low profitability and high water requirements, and the cropland acreage under less efficient irrigation technologies (Fig. 2S in Appendix B of Supplementary   Fig. 3. Nitrogen emissions at the source and in water bodies at municipal level. Materials). The drought scenarios illustrate what are the more efficient water and land management options for adaptation to water scarcity, which vary between irrigation districts and respond to factors such as crop diversification, the level of modernization of irrigation systems, and the access to water resources (Fig. 3S in Supplementary Materials). In addition, results highlight the tradeoff between nitrate concentrations and water availability. Nitrate concentrations increase under drought conditions, as the dilution processes worsen driven by water scarcity.

Policy analysis under normal and drought conditions 3 4.2.1. Optimization of nitrogen fertilization
The efficient use of nitrogen fertilization in irrigated and dryland crops in the Ebro Basin is an interesting policy that can reduce nonpoint pollution into the atmosphere and watercourses. This policy increases the profit of crops by 45 M€ while reducing environmental damages by 12 M€, achieving higher social benefits. The increase in private benefits results from the drop of nitrogen fertilization (− 39,000 tN) which reduces nitrogen leaching (− 7000 tN) and crops N 2 O emissions (− 196,000 tCO 2 e). Cultivated area and water withdrawals increase, reducing the streamflow at the Ebro mouth. Nitrate loads at the source in the basin are reduced to 229,000 tNO 3 -N, declining nitrate concentrations at the river mouth by 0.3 mg/l NO 3 − .
Under drought conditions, despite the reduction of streamflow at the mouth to 5341 Mm 3 , this policy still improves water and atmosphere quality by reducing nitrate concentration to 18.2 mg/l NO 3 − and GHG emissions to 6.79 MtCO 2 e, compared to drought conditions without policies. The results point out also that the policy under drought reduces nitrate loads at the source to 220,000 tNO 3 -N but increases water withdrawals to 2566 Mm 3 . Compared with the policy in normal flow, nitrate concentration at the mouth rises 65%, and the reason is drought decreases water availability and impairs the dilution processes. In both cases, normal and drought conditions, this policy is efficient in mitigating agricultural pollution into the atmosphere and watercourses (although reductions are moderate), and in enhancing private profits. The policy benefits both farmers and the environment, generating synergies between environmental and economic outcomes (Table 3). However, its implementation requires the training and willingness to cooperate of farmers.

Substitution of synthetic fertilization by organic fertilization
Substituting synthetic fertilization by organic fertilization is also an interesting policy for reducing nonpoint pollution to the atmosphere and water streams, and avoid the high abatement costs of manure treatment plants. Increasing the circular use of manure as fertilizer from the current 27% up to 60% would promote a more sustainable agriculture by reusing nutrients in the soil and preventing pollution. This study assumes that the cost of manure application amounts to 3.7 €/m 3 for a distance of 10 km, which includes transport and specialized equipment costs (Daudén et al., 2011). Results show that manure fertilization increases irrigated land to 584,000 ha and water withdrawals to 4031 Mm 3 , reducing streamflow at the river mouth by 112 Mm 3 . This policy increases organic fertilization up to 153,000 tN, while synthetic fertilization declines, achieving a reduction of 300,000 tCO 2 e in.
GHG emissions and 28,000 tNO 3 -N in nitrate loads into watercourses, which decreases nitrate concentration at the Ebro mouth by 32% to 7.7 mg/l NO 3 − . Environmental damages decrease by 109 M€ and private benefits increase by 30 M€ because of the cost savings of organic fertilization, augmenting social benefits up to 3531 M€. Under drought conditions, the policy abates nitrate loads at the source to 189,000 tNO 3 -N and GHG emissions to 6.81 MtCO 2 e, while water withdrawals amount to 2564 Mm 3 . However, nitrate concentration increases at the river mouth by 39% to 15.7 mg/l NO 3 − because of the drought lower stream flows. Compared with drought conditions without any policy, manure fertilization improves water and air pollution, lowering environmental damages (− 82 M€) and increasing social benefits (+119 M€). This policy entails synergies in reducing both atmosphere and water pollution, and synergies between economic and environmental outcomes under normal and drought conditions. It shows also an acceptable tradeoff between water quantity (streamflow at the mouth) and quality (pollution abatement) (Table 3).

Irrigation modernization
Modernization investments involve upgrading irrigation technologies, which enhance the efficiency of water use and reduce nitrate and GHG emissions. Modernization increases cultivated land to 566,000 ha after substituting surface irrigation by sprinkler and drip systems. However, advanced irrigation systems reduce water withdrawals to 3173 Mm 3 and nitrogen fertilization to 85,000 tN, increasing the efficiency of water and nitrogen use. Therefore, nitrate loads at the source and nitrate concentration at the Ebro mouth are reduced, while the streamflow at the mouth increases. N 2 O emissions also decrease to 0.72 MtCO 2 e. This shows that modernization generates suitable tradeoffs between streamflow, nitrate concentrations and GHG emissions. Advanced irrigation technologies increase yields and farmers' benefits, but modernization costs are very high. As a consequence, the private benefits of irrigation decrease but they are still advantageous compared with the baseline.
Under drought, modernization reduces water use, nitrogen leached, and GHG emissions, increasing social benefits by 85 M€ compared to drought without policies. Although modernization increases streamflow at the mouth, the abatement of nitrate concentration is very small, which shows the tradeoff of this policy between water quantity and quality (Table 3).

Manure treatment plants
Manure treatment plants reduce direct and indirect nitrogen loads into watercourses and nitrous oxide emissions into the atmosphere from manure management. These abatement technologies involve high investment, operation and maintenance costs. This study considers plants of 50,000 m 3 /year with nitrification and denitrification processes, with total cost at 7 €/m 3 of manure (Flotats et al., 2011). Results under normal flow and drought conditions show that the installation of manure treatment plants maintains water withdrawals by agriculture and streamflow at the river mouth, but achieves significant abatement of both nitrate concentration at the Ebro mouth (by more than half to 5.5 and 8.6 mg/l NO 3 − , respectively for normal and drought years) and GHG emissions (down to 6.65 and 6.43 MtCO 2 e, respectively). Environmental damages are curbed by around 80 M€ but the costs of this policy are close to 280 M€, reducing both private and social benefits ( Table 3). The investments in manure treatment plants would be reasonable for higher social carbon costs above the current estimates of 40 €/tCO 2 e, or for river reaches where highly valuable aquatic ecosystems are damaged by nitrates. Also, manure treatment plants could be the only alternative in areas generating large quantities of manure that cannot be reused as fertilizer because of the lack of cropland in the surroundings.

Discussion
This research provides a comprehensive analysis of water allocation and agricultural nonpoint pollution in the Ebro basin under normal and drought events, together with the relationship between water quantity and quality. Drought conditions reduce agricultural withdrawals and pollution loads to water media and the atmosphere, although nitrate concentrations increase because of the substantial fall in stream flows. Yang et al. (2015) indicate that these tradeoffs between water quantity and quality are important in considering sustainable development outcomes.
The results on water allocation and agricultural pollution loads during normal weather and droughts provide useful information for decision making. Climate impacts would undermine the sustainability of water systems in the Ebro under current management practices, threatening both irrigated agriculture and environmental flows. The results of drought scenarios call for decisive policy interventions by local, state and federal stakeholders to reduce the vulnerability of the economic sectors, and also to protect the natural environment. This research evaluates several policies relevant for regional and basin water planning. These policies promote the efficient use of water and nutrients, enhance farming conditions and environmental outcomes, and increase farmer's income in some cases. Successful policy implementation and enforcement entail the involvement of water stakeholders in water planning, along with the general public support that would motivate political representatives.
Several policy initiatives have been taken in some countries to address the abatement of agricultural nonpoint pollution, such as the European Nitrates Directive (European Commission, 1991), limiting nitrogen emissions from farming systems to protect groundwater and surface waterways. The purpose is to reduce nitrate pollution into water bodies caused by excessive nitrogen fertilization and manure surplus. However, the achievements of the Nitrates Directive during the last three decades are questionable because the entry of nitrogen in soils has not been curtailed. 4 The main problems with the Directive are that the use of homogeneous measures across very heterogeneous European regions in terms of pollution loads, and the flimsy enforcement mechanism based on penalizing agricultural subsidies . Another case is the conservation programs in the United States for reducing agricultural nonpoint pollution. Despite spending 5 billion US dollars per year in conservation programs over the last two decades, there is no clear general improvement of water quality in basins (Ribaudo, 2015).
Our results indicate that the selected policies contribute to the abatement of nonpoint pollution, and improve both water and air quality. The results reveal the tradeoffs and synergies between economic and environmental effects of these abatement policies. Nitrogen optimization (P1), manure fertilization (P2) and irrigation modernization (P3) are interesting policies that reduce polluting emissions into the atmosphere and watercourses, while enhancing the private benefits of farmers. Those policies deliver synergies between the economic and environmental outcomes. However, manure treatment plants (P4) deliver a strong reduction of nonpoint pollution and environmental damages, but they also reduce private benefits because of the high investment and operating costs. This reduction in farmers' income indicates that the uptake of this policy by farmers would be challenging, requiring strong command and control measures coupled with public incentives or subsidies. Drought conditions limit the effectiveness of pollution abatement policies compared with normal weather. However, these policies still have significant economic and environmental positive effects compared to drought conditions without policies. The analysis of mitigation policies supports decision making and contribute to the ongoing policy discussion for designing basin wide sustainable water management.
The use of manure as fertilizer is an effective policy to cut back nitrate concentration, improving water and atmosphere quality (Baccour et al., 2021). According to Strokal et al. (2020), incorporating manure as crop fertilizer is an effective strategy for drastically reduce eutrophication. This policy is considered an important solution to prevent the entry of nitrogen in soils by substituting synthetic fertilizers (Khan and Chang, 2018;Ma et al., 2019;MOA, 2018). Moreover, manure fertilization is quite interesting in the Ebro Basin, especially in Aragon, because the volume of available manure in the region can meet all nitrogen requirements by crops (Orús, 2006). Albiac et al. (2016) indicate that the use of organic fertilizers in Europe could decrease the use of synthetic fertilizers by almost half, thus reducing nitrous oxide emissions and nitrogen loads in watercourses, which would generate around 5200 M€ in environmental benefits. Dalgaard et al. (2014) indicate the successful implementation of this policy in Denmark, with a mix of command and control (fines) and institutional instruments, by showing farmers that substitution of synthetic fertilizers with manure was profitable.
Another interesting policy is irrigation modernization, which enhances water efficiency at parcel level and abates pollution loads. According to Borrego-Marín and Berbel (2019), the impact of irrigation modernization on improved water quality is significant at the basin scale and the implementation of this strategy minimizes nitrogen leaching into water bodies, while providing economic benefits similar to our results. Garcia-Garizábal and Causapé (2010) estimate a 20% reduction in leached nitrogen following the adoption of water conservation measures in an irrigation district in the Ebro. Albiac et al. (2017) indicate that irrigation modernization in Spain could reduce GHG emissions by 2.1 MtCO 2 e, but involves quite high investment costs. Grafton et al. (2018) emphasize the paradox of irrigation efficiency, which indicates that advanced irrigation technologies increases irrigation efficiency at district level, but could also increase water consumption in the basin. Gains in irrigation efficiency promote more water-intensive crops, double crops or irrigated land expansion, resulting in higher evapotranspiration and lower return flows to watersheds. To avoid the paradox, modernization projects of irrigation districts should include water balances that prevent increases in evapotranspiration.
The choice of policies depends on the objectives of decision makers, but also on the availability of biophysical and economic information. The uptake of policies is related to their cost-efficiency, acceptability by stakeholders, appropriate design of implementation and enforcement mechanisms, and resulting transaction costs. Successful implementation requires effective policies that are socially viable and include appropriate enforcement mechanisms ensuring compliance by stakeholders. A mix of command and control, economic and institutional instruments are needed to facilitate the implementation of sustainable water management. Better education is also important, as seen by the Science Technology Backyards initiative in China, in which scientists, students, and farmers exchange their expertise. In other terms, collective action and cooperation among farmers, policymakers, scientists, and other stakeholders are needed to achieve sustainable policies (Jiao et al., 2016). Overall, implementing cost-effective management strategies requires the successful deployment and uptake of policies and technology packages by stakeholders, as well as organizing their active cooperation.
Our study is novel in two key aspects: First, an optimization model is used to analyze the tradeoffs between water quantity and quality in order to maximize the social benefits of water from agricultural activities and urban centers. Second, the evaluation of nutrient pollution into watercourses and GHG emissions into the atmosphere from irrigated, dryland, and livestock activities under normal and severe droughts conditions. The evaluation of selected policies with the model provides clues on suitable combinations of mitigation and adaptation policies for water and air quality enhancement.
A certain number of simplifying assumptions have been used in developing the hydroeconomic model. The model includes a reduced form hydrological framework, which does not include reservoirs and their linkages with stream flows. Moreover, the model is static and does not include dynamic aspects regarding water allocations, basin stream flows, and drought events. This may change the effectiveness of mitigation and adaptation policies over a multi-year horizon. Despite these limitations, the hydroeconomic model is a good analytical tool to assess the effects of drought scenarios under selected mitigation and adaptation policies for enhancing water allocation and curbing water and air pollution.
Future work could address model improvements such as incorporating significant additional biophysical processes (pollution transport and fate processes, other pollutants), and including water storage of reservoirs and hydropower generation. Other improvements are considering the headwater inflow variables stochastic, modifying the time step of the model from yearly to monthly, and improving the model calibration and validation. The introduction of stochastic variables would be an interesting advance for a better representation of droughts and climate change. This will improve the estimation of nonpoint pollution loads into water streams for a better assessment of policies. Another important aspect that could be included in the analysis is the strategic behavior of stakeholders' in order to figure out the acceptability and stability of cooperative solutions for the abatement of water pollution loads and GHG emissions.

Conclusions
Water availability and agricultural nonpoint pollution in the Ebro River are analyzed under normal and drought conditions using an integrated hydroeconomic model. The study analyzes a set of mitigation and adaptation policies to address water scarcity and quality, and emissions of greenhouse gases. Results indicate that drought conditions reduce crops with low profitability and high water requirements, raising nitrate concentrations by up to 63% and highlighting the tradeoff between nitrate concentrations and water availability. The assessment of mitigation and adaptation policies provides insights on the synergies and tradeoffs between environmental and economic objectives, as well as on the potential tradeoffs between water quantity and water quality. All evaluated policies improve water quality and reduce the emissions of greenhouse gases. However, the most cost-effective policies are the reduction of nitrogen fertilization, the substitution of synthetic fertilization by manure, and the improvement of irrigation technologies. These cost-effective policies would facilitate the achievement of sustainable water management goals in the basin. Our study could support the decision-making process by contributing to the ongoing policy discussions for the design of basin wide sustainable policies. The findings in the Ebro could have interest also for other rivers basin, especially in arid and semiarid regions with similar agricultural and climate conditions.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.