A coupled modeling framework for sustainable watershed management in transboundary river basins

There is a growing recognition among water resource managers that sustainable watershed management needs to not only account for the diverse ways humans benefit from the environment, but also incorporate the impact of human actions on the natural system. Coupled natural– human system modeling through explicit modeling of both natural and human behavior can help reveal the reciprocal interactions and co-evolution of the natural and human systems. This study develops a spatially scalable, generalized agent-based modeling (ABM) framework consisting of a process-based semi-distributed hydrologic model (SWAT) and a decentralized water system model to simulate the impacts of water resource management decisions that affect the food–water–energy–environment (FWEE) nexus at a watershed scale. Agents within a river basin are geographically delineated based on both political and watershed boundaries and represent key stakeholders of ecosystem services. Agents decide about the priority across three primary water uses: food production, hydropower generation and ecosystem health within their geographical domains. Agents interact with the environment (streamflow) through the SWAT model and interact with other agents through a parameter representing willingness to cooperate. The innovative twoway coupling between the water system model and SWAT enables this framework to fully explore the feedback of human decisions on the environmental dynamics and vice versa. To support non-technical stakeholder interactions, a web-based user interface has been developed that allows for role-play and participatory modeling. The generalized ABM framework is also tested in two key transboundary river basins, the Mekong River basin in Southeast Asia and the Niger River basin in West Africa, where water uses for ecosystem health compete with growing human demands on food and energy resources. We present modeling results for crop production, energy generation and violation of ecohydrological indicators at both the agent and basin-wide levels to shed light on holistic FWEE management policies in these two basins.


Introduction
Comprehensive watershed management is a challenging task that requires multidisciplinary knowledge.An emerging research area highlights the importance of using watershed management to sustain various ecosystem services for human society (Jewitt, 2002;Lundy and Wade, 2011).While the various services provided by a river are primarily viewed through the prism of human benefits, maintaining a healthy ecosystem can be mutually beneficial to both human society and ecological systems.A failure to maintain adequate levels of riverine ecosystem health may result in compromised human benefits for future generations (Baron et al., 2004).There is therefore a growing recognition among water resource managers that sustainable watershed management needs to not only account for the diverse ways humans benefit from the environment, but also incorporate the impact of human actions on the natural system (Vogel et al., 2015).This is perhaps most prominently advocated in the emerging science of socio-hydrology, which calls for an understanding of the two-way interactions and co-evolution of coupled human-water systems (Sivapalan et al., 2012).This two-way coupling, then, needs to be integrated into computational tools used to aid watershed management.
A coupled human natural systems modeling approach, where the stochastic interactions between agents are represented, also facilitates stakeholder involvement.It can be used as a communication tool to organize information between hydrologists, systems analysts, policy makers and other stakeholders to inform the model and provide meaning to its results.The process of involving stakeholders in the modeling process allows them to observe how their actions affect other agents and observe the system-wide trends that emerge based on low-level agent interactions (Lund and Palmer, 1997).
Traditional watershed modeling does not effectively capture system heterogeneity, limiting its ability to effectively represent the two-way interaction between human and natural systems.Conventional models of water resource systems developed for assisting decision-making treat human benefits as a single objective using a centralized optimization approach, which ignores the heterogeneity among water users and uses (e.g., priority of different water uses along a river system based on socioeconomic differences) (Yang et al., 2009).The decision-maker is usually assumed to possess perfect information with respect to demand and supply of water and other resources in the watershed.If they are considered at all, most ecological functions are considered as constraints in the system, often for numerical convenience and frequently leading to oversimplification (Stone-Jovicich, 2015).
In this paper, we develop a modeling framework that can effectively address both system heterogeneity and the linkage between human society and hydrology that influences water cycling in the watershed.We do so by differentiating key stakeholders of ecosystem services as active agents based on their characteristics such as location and water use preferences, and tightly couple the human system with a processbased watershed model that simulates the stock and flow of environmental variables needed by the stakeholders.
In this two-way coupled natural-human systems modeling framework, the human system is modeled as a decentralized water systems model and is linked to a process-based, semidistributed hydrologic model.Empirical data obtained from surveys of water practitioners are used to develop behavior rules for water use, providing a realistic representation of human behaviors in water resource modeling.In addition to incorporating indirect interaction between the agents through the environment, i.e., surface water flows, a novel advancement offered in this framework is the ability of agents to directly interact by requesting assistance from other agents based on their level of cooperation.A web-based user interface for this coupled model has been developed which enables non-technical stakeholders to use this modeling platform online.The online portal allows for role-play and participatory modeling.We apply this modeling framework to two different transboundary basins where ecological needs are competing with growing human demands on the water resources: the Mekong River basin in Southeast Asia and the Niger River basin in West Africa.
2 Previous studies of coupled natural-human system modeling Coupled natural-human system modeling through explicit modeling of both natural processes (e.g., rainfall-runoff for water supply) and human behavior (e.g., services that humans derive from natural systems, such as water resources) helps reveal the reciprocal interactions and coevolution of the natural and human systems.Modeling efforts coupling the natural and human systems have increased in recent years (Liu et al., 2007), evolving from an approach that focused mostly on understanding the natural processes and that treated human actions as fixed boundary conditions (Sivakumar et al., 2005).The human system coupled with the natural system can be simulation (descriptive) or optimization (prescriptive) based, depending on the modeling objective (Giuliani et al., 2016).
A watershed is a self-organizing system characterized by distributed albeit interactive decision processes.If a coordination mechanism exists, it will guide the interactions among individual decision processes.The agent-based modeling (ABM) framework provides such a mechanism for integrating knowledge and understanding across diverse domains (Berglund, 2015;Yang et al., 2009).In an ABM, individual actors are represented as unique and autonomous "agents" with their own interests.Agents follow certain behavioral rules and interact with each other in a shared environment allowing for a natural representation of realworld, "bottom-up" watershed management processes.A (semi-)distributed hydrological model that can simulate the environment, and which provides ecosystem services, can then be linked with the agent-based model that represents decentralized decision-making processes.This linkage allows us to utilize the strength from both models and better represent a watershed as a coupled natural-human complex system.
Distributed process-based hydrologic models are well suited for linkage with ABMs.Compared to statistical or data driven models, process-based models are more robust for extrapolation or in simulating conditions under changing management practices.Distributed and semi-distributed models have the capacity to reflect the spatial heterogeneity of hydrologic and water quality processes within a river basin.This capacity also facilitates the evaluation of spatially variable user demands for ecosystem services.Open-source hydrologic models, where it is possible for third-party users to incorporate region-specific knowledge into the models to improve performance or extend model capability, are especially suitable for coupling with decentralized water system models.The spatial structure of the hydrologic model and its consistency with the model structure of the ABM it is being coupled to are additional important considerations.
SWAT (Soil and Water Assessment Tool) is one such hydrologic modeling platform with many of the features described above that has been used previously to explore effects of human intervention on basin water resources.It provides built-in functions to simulate reservoir operations, irrigation and a variety of best management practices (BMPs) for nutrient pollution control (Bracmort et al., 2006;Strauch et al., 2013).Its open-source nature allows users to incorporate locale-specific knowledge into the model to improve model performance or extend a model's capabilities.SWAT conducts simulations at the level of the sub-watershed, or hydrological response unit.When the modeling domain of an agent-based model is delineated following the boundaries of a sub-watershed, it has the advantage of spatial unit consistency with agent-based models.Furthermore, it has been coupled with (non-ABM) decision modeling tools to identify cost-effective solutions to basin water resource management challenges (Ciou et al., 2012;Karamouz et al., 2010).We therefore choose SWAT as the hydrologic model for this study.
A fully coupled modeling framework involves continuous information exchange between the agent-based and hydrologic models such that the two models are solved simultaneously or iteratively in each time step.Relevant existing studies that link agent-based models with other simulation models are summarized in Table S1 in the Supplement.A review of the existing literature shows that most coupled natural-human systems models, especially in the context of surface-water management, are only loosely linked and thus do not fully capture the impact of human actions on hydrology (Berger et al., 2007;Giacomoni et al., 2013;Ng et al., 2011;Yang et al., 2012)."Fully coupled" models can be found for groundwater analysis (e.g., Reeves and Zellner, 2010).This is because the common outputs from groundwater models are "stock variables" such as groundwater head, and it is relatively easy to restart the simulation model from the previous step.Surface hydrologic models, on the other hand, usually output flux (i.e., streamflow) and not stock variables (e.g., lake storage and soil moisture).To be "fully coupled" with an agent-based model, a modification of the programming code of the watershed model is usually necessary to output state variables and allow the agent-based model to interact with the watershed model at monthly or daily time steps (Mishra, 2013).
The methodology proposed here is designed primarily to help improve stakeholder understanding of a complex system as well as recognition of various, alternative development pathways for the basin in question.A linkage between an agent-based model and a process-based watershed model, incorporating direct interactions between agents, is a promising method to accurately represent complex coupled natural-human systems as well as to appropriately involve non-technical stakeholders in the assessment.

Methodology
The generalized framework for the two-way coupling between an agent-based model and a process-based watershed model is described here in greater detail.In this framework, the river basin is divided into politically and hydrologically similar sub-regions, where water management is primarily carried out under the ambit of a single administrative unit, which represents an autonomous agent.This approach to delineating regions is also found in other studies, e.g., the Food Production Unit in the International Model for Policy Analysis of Agricultural Commodities and Trade (Robinson et al., 2015).
In this framework, agents follow prescribed rules, based on which their benefits are calculated.Agents make water management decisions, on an annual time step, for agricultural production, hydropower generation and ecological management based on targets set using long-term historical data.They update their actions every year based on their experience from previous years; this behavior can be classified as a hybrid between reactive and deliberative approaches (Akhbari and Grigg, 2013).In this modeling framework, agents can interact both directly and indirectly.Agents interact indirectly through their water usage for agriculture, and changes in streamflow in response to hydropower production.For direct communication between agents, we include a level of cooperation (LOC) parameter that signifies the willingness of an agent to alter their own water management actions to benefit a downstream agent.This setting allows for the incorporation of stochasticity into the agent decision-making process.
Figure 1 shows the higher-level coupled modeling framework.First, user-defined preferences and level of cooperation are defined based on stakeholder input.These input parameters can either be defined by individual users according to specific scenarios of interest, or be determined by directly eliciting the information from the various water-using stakeholders, for example, through surveys.As part of this project, we conducted comprehensive surveys across three transboundary river basins (Indus, Mekong and Niger) to identify water use preferences (Khan et al., 2017).A sample survey questionnaire is provided in the Supplement.The surveys were developed to elicit the perceived importance of various ecosystem services across each basin under a variety of economic and hydrologic future conditions.One of the questions in the survey asked respondents to rank different ecosystem services in order of importance for each agent.These responses were then averaged across all the respondents for each agent to obtain a ranking of the importance of the different ecosystem services.These rankings were used in the decision algorithm for the case study models developed and presented in Sect. 4. Second, other initial input parameters are incorporated into the ABM framework.These include reservoir characteristics, such as storage, release capacity, efficiency and operational rules for each reser- voir.The geographic linkages between subbasins, ecosystem hotspots and agents across the entire river basin are defined in the ABM as well.For each subbasin, agricultural parameters are defined, including the type of land cover, total cropped area and type of crop produced.For each agent, targets are defined for each of the three water uses based on historical flow conditions.These targets form the basis relative to which the agents make their water management decisions.
The ABM, built using the R statistical language, reports agent decisions concerning reservoir operation and irrigated area that are then used as input for the calibrated SWAT model that simulates the hydrology for the next time step.The crop production and reservoir modules in the SWAT model are driven using water management decisions from the ABM and hydroclimatologic conditions.Upon completion, the SWAT model generates three primary output files that are used as input for the agent-based model.These files include the following.
-Proportion of cropped area and crop yield for each hydrologic-response unit (HRU) in each subbasin in each agent.
-Daily storage volume and releases from each reservoir.
-Daily streamflow at the outlet of each of the subbasins across the basin.
The output from the SWAT model is then fed back into the ABM, based on which the agents make water management decisions for the next time step.In the last time step of the modeling run, the ABM provides a summary file summarizing the performances for each of the three water uses: agriculture, hydropower and ecology.
Figure 2 shows the algorithm through which the ABM and the hydrologic model interact, and the process through which various agents make their water management decisions, in two distinct parts.In the first part, the agent's water management decision is made based on its preferences of water use, while in the second part the decisions are made based on its willingness to cooperate.In the first part, the algorithm uses the water use preferences for each agent, and compares the target value with the output from the SWAT model for each of the water uses to make the water management decision for each agent.Under the current setting, the agent is allowed to only make one water management decision every year.However, this can be modified in future studies to allow multiple decisions to be made in a year.Additional information from stakeholders (such as rules of tiebreak) would be needed for this.
For instance, consider an agent that ranks agricultural production higher than other water uses.In this case, the ABM checks to see whether crop production meets the target crop production.If crop production is significantly lower than the target crop production, then the agent decides to increase the irrigated area.If crop production meets the target production, then the ABM checks to see whether hydropower generation for the current time step meets the hydropower generation target.If the hydropower generation target is not met, the agent decides to decrease the number of days actual storage needs to meet the target storage.This allows for greater releases and increased hydropower generation.If the hydropower generation target has also been satisfied, then the ABM moves to the second part of the decision-making algorithm.
An important input to the ABM is the identification of ecosystem hotspots.Ecosystem hotspots are specific regions in the river basin that are especially critical to or indicative of the health of the ecosystem in the entire basin.Ecosystem hotspots can be identified in a variety of ways including through a literature review of critical ecological concerns in a basin and/or input from local ecological experts.For this analysis, for each ecosystem hotspot, relevant Indicators of Hydrologic Alteration (IHA) and Environmental Flow Component (EFC) parameters are selected based on expert opinion to measure ecosystem health (Richter et al., 1997(Richter et al., , 1996)).Baseline values for relevant IHA and EFC parameters, which are streamflow-based indicators, are calculated from daily streamflow of the calibrated SWAT model.The IHA and EFC parameters included for the case study applications described in Sect. 4 include monthly median flows, 7-day annual maximum flow, small and large flood event duration, timing and duration of extreme low flows, etc.We use ±10 % from the baseline value as a decision threshold in the ABM as recommended by research consortium partner WorldFish and Wetlands International.This means the modeled IHA and EFC values deviating from the baseline value by more than 10 % would require an agent to take action.Water management to satisfy ecological targets depends on the specific hydro-ecology of the ecosystem hotspot.For example, a river reach may need low flows during the breeding season, while a downstream wetland may need higher flows to avoid eutrophic conditions.Satisfying multiple ecologic needs, as is often the case in large river basins, can require contrasting interventions and add tremendous complexity to the water management decision-making process.In the case study applications for this modeling framework (detailed in Sect.4), we find that the information needed to fully incorporate ecosystem hotspot management into the ABM-SWAT framework is limited.The link between management actions (e.g., reservoir operations, crop land management) and ecological concerns is not well understood and requires further investigation that is beyond the scope of this work.
In the absence of detailed information on ecological needs, we incorporate ecosystem hotspot management into the model by creating a "flag" when the timing and magnitude of the relevant IHA and EFC deviate from the target values in each hotspot.Thus, while the agents do not actively consider ecosystem hotspots in their decisions, they recognize when violations (deviations from target values) occur.We use these violations to constrain the agent's decision, so that if any of the ecologic targets have been violated and ecologic needs are ranked highest, no action can be undertaken for agricultural production or hydropower generation.This current setting mimics most real-world policies about ecosystem conservation that do not have an active reaction to environmental issues, especially in developing countries.Of course, this algorithm is flexible and allows for a more proactive decision-making process for ecologic management if more information regarding stakeholder perceptions is available.
In the second part of the decision-making algorithm, agents decide whether to alter their water management actions based on requests from downstream agents.This feature aims to represent the possibility of cooperative water management in a transboundary river basin.For instance, in March 2016, China released additional water from its Jinghong reservoir, in response to a request from Vietnam, to help alleviate water shortages in downstream countries in the Mekong River basin (Tiezzi, 2016).In the current framework, a downstream agent can request an upstream agent to change its reservoir operations to alleviate prolonged water scarcity (at least two time steps).For instance, if a downstream agent has been unable to meet its agricultural production target for 2 years, then it can request an upstream agent to increase releases.Wherever available, one upstream reservoir is identified for each agent.
Once a request is made by a downstream agent, the upstream agent first checks to see whether it has surplus storage, after accounting for its own needs, to consider releasing additional water.If the available storage is not sufficiently higher than the target storage, then the upstream agent declines the request and does not change its reservoir operations.If the upstream reservoir has sufficient storage, then it decides on whether to respond favorably to the downstream request based on its willingness to cooperate.In this modeling framework, the LOC represents the probability (from 0 to 1) of the agent responding favorably to a downstream request and incorporates human decision-making uncertainty, making the second part of the decision-making algorithm stochastic to mimic human decision uncertainty.In any given time step, an upstream reservoir can only respond to one request.Once the second part of the algorithm is executed, the water management decisions are made and relevant information is then fed back to the SWAT model as input for the next time step.
This modeling framework is generalizable, tackling the challenge of paucity of transparency and reusability often associated with ABM development (O'Sullivan et al., 2016).The framework design means that the ABM can be adapted to different watersheds by simply preparing a different set of input files without having to modify the structure of the model.An Overview, Design, and Details (ODD) document (Grimm et al., 2010) for the ABM is provided in the Supplement.

Application of the modeling framework
In this section, we show the application of this generalized coupled modeling framework to two transboundary river basins: the Mekong and Niger River basins.We describe the development of the ABM and hydrology model for each of the basins, and then show model outputs illustrating the impacts of agent behavior on agent-specific and basin-wide outcomes.We use the Mekong River basin as an example to show how agents' preferences impact different water uses, while the Niger River basin is used as a case study to demonstrate how interactions between different agents and their willingness to cooperate influence basin-wide outcomes.

Impact of agent preferences -Mekong demonstration
We apply the generalized ABM framework described in Sect.
3 to the Mekong River basin.The Mekong River, with an annual average discharge of 450 km 3 , drains the sixth largest river basin in the world in terms of runoff (Kite, 2001)  finally draining in the Mekong delta in Vietnam.Flow in the upper Mekong in China is mainly comprised of snowmelt, while precipitation from the two monsoon systems provides the bulk of the flow in the lower Mekong (Ringler, 2001).Around 70 million people depend upon the Mekong River for food, water and economic sustenance, and the basin is home to several diverse and productive ecosystems.The Tonle Sap lake, among the most productive ecosystems in the world (Bakker, 1999), is an example of the unique ecology and biodiversity in the basin.Agriculture accounts for about 80-90 % of total freshwater consumption in the Mekong (MRC, 2002), with rice being the most widely grown crop.The Mekong delta is another hotspot of economic activity and produces approximately half of Vietnam's annual rice harvest and over half of Vietnam's fish exports (Kite, 2001).The Mekong is currently in a phase of rapid infrastructure development (storage and hydropower), raising concerns regarding the downstream ecological impact (Urban et al., 2013).
The Mekong was spatially delineated into 12 distinct hydrologically similar agents who make water management decisions to satisfy their own targets.Figure 3 shows the distribution of the agents across the basin and the locations of major existing and planned water infrastructure facilities, and important ecological hotspots identified by local ecological experts.In total, there are 19 major dams (7 existing and 12 planned) and 23 ecological hotspots identified by local ecological experts using the existing literature (Baran et al., 2012).To allow for a more intuitive interpretation of results, here we only model crop production for irrigated rice, but the modeling framework allows for incorporation of any number of crop types.The modeling structure allows for simulations under either existing water infrastructure or future conditions that also include dams under construction.For demonstration purposes, we present results under future water infrastructure.
A SWAT hydrology model was developed, calibrated and validated with streamflow data from 1978 to 2007.Details on model setup and calibration and validation results for the hydrology model are provided in the Supplement.In addition, Fig. S4 in the Supplement shows simulated average hydropower generation under historic streamflow conditions and compares it with the observed hydropower generation for five existing reservoirs during the period of comparison as validation for the ABM. Figure 4 shows an example of how total crop production (of irrigated rice) changes over the simulation period with a different assigned priority (lowest vs. highest) for agriculture for the agent representing southern Laos.Both these simulated crop production time series are run with the same hydrologic time series, so the differences between the levels of crop production are caused by different water management actions.Over the simulation period of 25 years, there is a significant cumulative difference in agricultural production largely because of the compounding effect of increasing irrigated area whenever the crop production target is not met.When agriculture is assigned a lower priority, the agent prioritizes either hydropower generation or ecosystem health and is less likely to make decisions to increase agricultural production.
Different ecosystem services respond differently to changes in external drivers, depending on the nature of water use.Figure 5 shows a comparison of the effect of different priorities on hydropower generation for the Nam Theun 2 dam in the agent representing central Laos.As in the previous example, both the simulated time series are run with similar hydrology to isolate the difference in hydropower generation due only to different agent behavior.For this model, if simulated hydropower generation is less than 90 % of historic (for existing dams) or expected (for future dams) mean annual energy, the agent can decide to change its operation rules for the dam to increase hydropower generation.In this model specifically, agents do so by increasing the minimum monthly releases from their reservoirs.
The fluctuations in HP generation from year to year are caused by changes in hydrology, while the differences between the blue and red lines represent the agent preference regarding the relative importance of hydropower.We observe that the annual fluctuations in hydropower generation (due to hydrology) are significantly greater than the slight changes in generation stemming from modified reservoir operations.Time steps with high streamflow conditions lead to very similar outcomes regardless of preference.The difference is more prominent in low-flow conditions, where a higher prioritization of hydropower leads to an increased "minimum" level of hydropower.Despite the fact that the difference between hydropower generation due to a change in prioritization is not as significant as that for the agricultural production, annual differences in hydropower generation can be as high as 8 % (210 GWh).In the context of energy shortages in the Mekong, this difference is non-trivial.Another interesting feature to note in Fig. 5 is that when the agent decides to increase releases in a time step for larger hydropower generation, generation in the next time step is reduced because of reduced storage.The emergence of this myopic behavior pattern also gives us confidence in the model as it replicates how hydropower generation decisions are made in the real world.
Finally, we also investigate the impact of changing priorities on ecologic performance.For each of the 23 hotspots, relevant indicators of ecologic health using the IHA and EFC framework are identified.As explained in Sect.3, agents can protect ecological health by choosing to limit water management actions for other water uses (agriculture and hydropower).Simulation results for this model showed that different agent preferences do not have a significant impact on ecological violations.The amount of water available (hydrology) has a much more pronounced impact.A reason for the lack of a negative impact of changes in reservoir operations on ecological performance is that reservoir capacities are low relative to streamflow.It is important to note here that the eco-hydrological indicators we used in the current modeling framework do not account for fish migration patterns and sediment transport, which are among the biggest concerns about hydropower in the Mekong.Future studies can link the current framework with more complex ecological models to address these concerns.

Impact of agent cooperation -Niger demonstration
To illustrate the system-wide impacts of varying levels of agent cooperation, we apply this generalized ABM framework to the Niger River basin.The Niger River drains an area of over 2 million km 2 spanning nine riparian countries in West Africa, making it the ninth largest river basin globally in terms of area.The Niger River is spread across a wide range of ecosystem zones, and the basin is thus notable for its high spatial and temporal hydrologic variability on interannual and decadal scales (Ghile et al., 2014).Based on GDP, all nine countries of the Niger basin fall in the bottom quartile of national incomes (Ogilvie et al., 2010).Agriculture constitutes a large part of the economic output for the region (approximately 33 %), with livestock and fisheries also contributing substantially in some areas (Welcomme, 1986).Owing to the lack of a well-developed irrigation system, most of the agriculture in the Niger is rainfed, with only 20 % of available arable land under cultivation.Investment in water resource infrastructure and institutions offers a potential pathway to economic development for the basin population and several large dams are slated for construction under the existing Niger Basin Authority investment plan.However, the downstream impacts of upstream infrastructure have become a contentious issue.
For the Niger basin, 15 agents were identified based on hydrologic characteristics and administrative boundaries.A map of the system showing the agent and subbasin boundaries, and existing and planned water infrastructure, is provided in Fig. 6.Nineteen ecologic hotspots identified by local ecological experts using the Niger Basin Atlas (Aboubacar, 2007)  We run this model under two different settings and then compare the results to evaluate the basin-wide impacts of cooperation between agents.In the first setting, agents make water management decision solely to satisfy their own objectives without interacting directly with other agents.In the second setting, agents' decisions are driven by both their own objectives, and their willingness to cooperate with other agents.Willingness to cooperate, represented in the model with the level of cooperation parameter (LOC), can be set on a scale of 0 to 1 and signifies the probability of an agent responding favorably to a request from another agent to alter its water management decisions.In this model, agents with reservoirs respond to a downstream request by increasing the minimum flow if storage in the reservoir is above the target storage.For the purposes of demonstration, we set the LOC for agents to 1 to simulate a fully cooperative environment.Both model runs are made with the same set of agent preferences.To illustrate impacts of future infrastructure development, we run both the simulations under the future state of water infrastructure.
Over the course of the 26-year simulation period, we observe 73 instances of agents requesting help successfully, with many of these requests made during low-flow years.We see that additional releases from an upstream agent willing to cooperate can often, but not always, result in an appreciable increase in crop production compared to when the agents are solely interested in satisfying their own objectives.For example, in year 20 of the simulation, the Outlet Delta agent successfully requests the upstream Jebba reservoir for additional water releases, and experiences an increase in food production of almost 50 000 tons without any decrease in production in the upstream agent.
Figures 7 and 8 illustrate the changes in reservoir operation and its impact on streamflow downstream when an upstream agent decides to cooperate.For Jebba reservoir, Fig. 7 shows the difference in reservoir releases between the "cooperation" and "no cooperation" runs, the blue region representing the additional volume that is released based on the decision of the agent to cooperate.Figure 8 shows the available streamflow downstream of the dam under both the simulation scenarios: the red line indicates releases when the agent alters its reservoir operations in response to the request while the blue line shows releases in the model where the agents do not cooperate.It is interesting, but not surprising to note, that additional water released leads to reduced releases in subsequent time steps due to reduced storage.
This change in the timing of water availability has the potential to both negatively and positively affect all downstream users, including those that were not part of the negotiation that led to the altered water management action (i.e., "thirdparty impacts").The occurrence of third-party impacts is dependent on the context; they do not necessarily occur every time, and if they do occur, they can be either positive or negative.In these modeling runs, we observe many instances of varying third-party impacts.For example, in response to consecutive years of reduced agricultural production, the Niger Inner Delta (South) Agent requests the upstream Fomi Dam for additional releases in year 13 of the simulation.The agent managing Fomi Dam, Siguiri-Kankan, agrees to the request and increases its minimum releases.Not only does crop production in Niger Inner Delta (South) increase as a result, but crop production in Niger Inner Delta (North) is also positively impacted.However, the Office Du Niger Agent suffers from a decrease in food production.
It is pertinent to note here that additional releases do not necessarily increase crop production; it is possible that there are constraints other than water availability that are limiting crop production.In the same year of the simulation as the previous example, the agent representing Mid-stream Niger requests additional releases from Touassa Dam and experiences an increase in crop production.Crop production in the mid-stream does not change appreciably as a result; however, production in another downstream agent, Mid-Stream Nigeria, is increased.In the current model, agents make requests when they are unable to meet crop production targets.However, the modeling framework allows for making requests dependent on other factors (e.g., ecological needs).
These third-party impacts, also referred to as externalities in the natural resource economics literature, are also seen in ecologic performance.The nature and magnitude of thirdparty impacts on ecologic performance are dependent on the specific ecosystem.Arguably, ecologic health is even more sensitive than agricultural production to changes in the timing and magnitude of streamflow.In these simulations, we see evidence of this impact.In year 9, in response to a request from Mid-Stream Nigeria, Kandaji reservoir releases additional water that (compared to the no cooperation setting) positively affects the ecosystem hotspots in Mid-Stream Niger and Mid-Stream Nigeria, but results in increased violations of ecological targets in the downstream Outlet Delta.In particular, the ecological parameter seen to be violated is the IHA parameter for minimum average 7-day flow.Despite the increase in total annual flow due to the additional releases, the change in the flow timing leads to an ecologically inferior outcome for the Outlet Delta.This finding supports the argument that evaluations of ecological health performed at coarse timescales (e.g., annual) may overlook finer timescale flow parameters that are critical to ecosystems (Palmer et al., 2005).In the absence of detailed data relating flow conditions to aquatic health in the Niger Outlet Delta, it is difficult to ascertain the exact impact that the violation of this target would have on the delta's ecosystem.

Dynamic coupled natural-human systems modeling
The generalized coupled modeling framework presented in this paper adopts many of the principles from the Shared Vision Modeling (SVM) approach (Palmer et al., 2013).To improve allocation of scarce resources across competing uses, it is crucial to understand the values placed on various water uses by stakeholders in the watershed.For the case study applications, model development was preceded and followed by extensive stakeholder engagements.Before the model development began, an electronic survey of water users in each of the river basins was conducted to analyze perceptions of the relative importance of different water uses.Rules derived from these surveys improve representation of the interactions between heterogeneous subsystems.Moreover, to make this modeling framework more accessible to users, a web-based interface has been developed where users can perform model simulations with differently specified agent behavior rules.
The online interface allows users to visualize and save results from several modeling runs.Information from the modeling runs made on the online platform can be used to further develop agent behavior rules and have stakeholders evaluate the results to gain insight into emerging development pathways in the basin.In addition to the utility provided by the visualization of the outcomes, the exercise of tailoring the modeling framework to a specific basin requires stakeholders to conceptualize the water system better.A beta version of the website with the model for the Mekong River basin has been developed and tested with stakeholders in the Mekong.
Third-party impacts, which are costs or benefits borne by a party due to the actions of others, have been recognized as an obstacle to promoting cooperative water management practices in a water system with many heterogeneous users (Petersen-Perlman et al., 2017).While the existence and importance of third-party impacts are widely acknowledged, they are not easily quantified, making them difficult to incorporate into stakeholder discussions on water management in transboundary settings.The case study results for the Niger River basin presented here quantify these third-party impacts on agricultural production, hydropower generation and ecological performance.Quantification of the impacts, both positive and negative, of the actions of water users can help develop a shared understanding of the water system dynamics among stakeholders (Skurray et al., 2012).By offering a way to fully couple human and natural systems with several ecosystem services, with flexibility to incorporate varying levels of importance for heterogeneous users, the modeling framework presented here can be useful as a tool to stimulate cooperative water management in transboundary settings.

Limitations and future work
The case study models developed use observed climate data to develop hydrologic time series for model simulations.Observed streamflow data are used for model simulations under the future infrastructure setting as well.However, significant uncertainty exists regarding future hydroclimatology and its impact on water resources in these basins (Lauri et al., 2012).A climate stress-test approach where the agent's response to varying hydroclimatological conditions is evaluated can provide insight into sensitivity to climate variables (Brown et al., 2012).
Another useful extension of this modeling framework would be to incorporate seasonal forecasts of water availability into the decision-making process of agents.Water managers often perceive the advantages offered by seasonal forecasts as being low (Pagano et al., 2002), even though the economy-wide benefits of seasonal forecasts can be substantial (Rodrigues et al., 2016).This modeling framework can be used to highlight the potential benefits of shortterm seasonal forecasts for agents' decisions on water allocation and willingness to cooperate with other agents, and introduce another dimension of stochasticity to the agent decision-making process.The seasonal forecasts used, however, would need to be geographically suitable and temporally appropriate for each agent's operations.
The development of coupled river basin models needs to carefully address several tradeoffs to ensure that the models are scientifically sound and computationally tractable.The focus of this work is to develop a generalized ABM framework that addresses model transparency and model/module reusability (An, 2012;Parker et al., 2003).To address this, the geographic delineations of our agents are relatively larger than traditional agent-based models (which define individual water users as agents).This is a necessary simplification in order to balance model complexity (or the level of detail of simulated decision processes) and computational resource and data availability.Furthermore, it is pertinent to recognize that agent-based models are best used to explain existing relationships or phenomena, rather than as prediction tools.Another related limitation associated with large-scale agentbased models is reliance on informal validation.For the case studies presented here, we validate the ABM with internal checks, for instance by comparing modeled and observed hydropower generated (Fig. S4).We also address this limitation through the use of surveys to inform agent behavior rules.
To further improve the agent decision module, Bayesian decision theory would be a useful avenue of future research to better address uncertainty of human decisions (Kocabas and Dragicevic, 2013;Van Oijen et al., 2011).However, this approach is computationally costly, especially in our setting with a variety of different agents, water use preferences and willingness to cooperate.High performance computing technology might become necessary for this purpose.
The coupled modeling framework described in this paper operates on an annual time step.This means that exchange of information between the ABM and SWAT takes place at the start of every year.The framework can be made more realistic by configuring the models to interact at the finer timescale at which water management decisions are made, i.e., monthly or weekly.While the modeling framework is sufficiently flexible to allow for a range of water management actions, in the modeling framework described here, we model ecological health management in a passive rather than active manner.Active ecologic health management, where the agents make specific decisions (especially with regards to reservoir operations), requires a more in-depth understanding of the basin ecology than was available for either of the two transboundary rivers used as case studies for this paper.

Conclusion
Sustainable watershed management requires water managers and policy makers to have a clear understanding of their water system and its interactions with the natural environment.This study develops a spatially scalable, generalized agentbased modeling (ABM) framework consisting of a process-based semi-distributed hydrologic model, SWAT and a decentralized water system model to simulate the impacts of water resource management decisions on the food-waterenergy-environment nexus (FWEE) at the watershed scale.The two-way coupling provides a holistic understanding of the FWEE nexus.A novel advancement offered in this framework is the ability of agents to directly interact by requesting assistance from other agents based on their level of cooperation (LOC).Quantification of the LOC is especially useful for transboundary river basins with several unique actors with different water management objectives.Among various other future uses, this modeling system has been developed for the CGIAR Research Program on Water, Land and Ecosystems to assess tradeoffs between agricultural production, productivity, other water-based ecosystem services and ecosystem health.To support non-technical stakeholder interactions in developing country settings, where CGIAR operates, a web-based user interface has been developed.This online portal allows for end-user role-play, participatory modeling and inference of prioritized ecosystem services and ecosystem health.
We show the flexibility of this modeling framework by applying it to two large transboundary rivers as case studies and demonstrate its ability to reveal the impact of water use preferences and willingness to cooperate on region-specific and basin-wide outcomes.In the case studies, we see that agent preferences have a more pronounced effect on crop production compared to hydropower generation.Changing preferences has a relatively smaller impact on ecological health, but that is heavily dependent on the river basin, ecological health indicators and water management actions.The impact of agent cooperation revealed the presence of both positive and negative third-party impacts that need to be acknowledged and accounted for when considering cooperative river management in transboundary settings, especially at finer timescales.
Code and data availability.The source code for the coupled agentbased model and the online web interface is available at https: //github.com/qzhao22/WLE_TOOL_INTERFACE/.Readers with questions regarding the code and data used in this analysis can direct their request via email to Hassaan F. Khan, hfkhan@umass.edu.
Author contributions.HFK and YCEY developed the ABM.HX developed the SWAT hydrologic models.CR provided guidance on project direction and manuscript preparation.HFK prepared the manuscript with contributions from all co-authors.
Competing interests.The authors declare that they have no conflict of interest.Special issue statement.This article is part of the special issue "Coupled terrestrial-aquatic approaches to watershed-scale water resource sustainability".It is not connected with a conference.

Figure 1 .
Figure 1.Overview of the modeling framework coupling ABM with SWAT.

Figure 2 .
Figure 2. Modeling workflow including the two-part algorithm through which agents make water management decisions.

Figure 3 .
Figure 3. Basin map for the Mekong River basin showing agent boundaries and major dams included in the model.

Figure 4 .
Figure 4. Difference in crop production caused by the differing prioritization of agriculture for the southern Laos agent.

Figure 5 .
Figure 5. Difference in hydropower generation due to changes in prioritization of hydropower for the Nam Theun 2 reservoir.

Figure 6 .
Figure 6.Basin map for the Niger River basin showing agent boundaries and major dams included in the model.

Figure 7 .
Figure 7. Change in reservoir release caused by the agent's willingness to cooperate with downstream agents.The area in blue (red) represents additional (reduced) water released compared to model runs where the agent does not cooperate.

Figure 8 .
Figure 8.Comparison of monthly streamflow immediately downstream of Jebba reservoir between model runs when an agent decides to cooperate and when it does not cooperate.