This paper investigates strategies to alleviate the effects of droughts on the profitability and sustainability of irrigated agriculture. These strategies include conjunctive management of surface water and groundwater resources, and engineered improvements such as lining of irrigation canals and addition of regional pumping well capacity. A spatially distributed simulation-optimization model was developed for an irrigated system consisting of multiple surface water reservoirs and an alluvial aquifer. The simulation model consists of an agronomic component and simulators describing the hydrologic system. The physical models account for storage and flow through the reservoirs, routing through the irrigation canals, and regional groundwater flow. The agronomic model describes crop productivity as a function of irrigation quantity and salinity, and determines agricultural profit. A profit maximization problem was formulated and solved using large-scale constrained gradient-based optimization. The model was applied to a real-world conjunctive surface water/groundwater management problem in the Yaqui Valley, an irrigated agricultural region in Sonora, Mexico. The model reproduces recorded reductions in agricultural production during a historical drought. These reductions were caused by a decline in surface water availability and limited installed pumping capacity. Results indicate that the impact of the historical 8-year drought could have been significantly reduced without affecting profit in wet years by better managing surface water and groundwater resources. Namely, groundwater could have been more heavily relied upon and surface water allocation capped at a sustainable level as an operating rule. Lining the irrigation canals would have resulted in water savings of 30% of historical reservoir releases during wet years, which could have been used in subsequent drier years to increase agricultural production. The benefits of a greater reliance on groundwater pumping by installing additional wells are limited due to pumping restrictions near the coast to avoid seawater intrusion and due to increased pumping costs.
 In many arid and semiarid regions, irrigated agriculture is threatened by water shortages caused by droughts, by water mismanagement, and by increased competition for limited water resources. Possible strategies to deal with water shortages and prevent loss of agricultural profit during droughts include (1) improved conjunctive management of surface water and groundwater resources, (2) improved water use and distribution efficiency by, e.g., minimizing losses from irrigation canals and improving field-scale irrigation efficiency, and (3) water markets to redistribute water from surplus to deficient areas.
 Improved management of existing surface water and groundwater resources is crucial for maintaining the food supply from irrigated agriculture [Rosegrant et al., 2002]. This can be achieved by optimal operation of surface water reservoirs [Labadie, 2004] and groundwater systems [Bredehoeft et al., 1995]. Bredehoeft and Young  found that groundwater use in conjunction with surface water can double agricultural revenues, and that benefits may be greater during drought periods. In addition, groundwater can provide a buffer or insurance against uncertain surface water supplies [Tsur, 1990].
 However, increased groundwater use for irrigation may have negative effects such as higher production costs compared with surface water, especially when it results in declining aquifer heads [Addams, 2005], lower crop yields due to the lower quality of groundwater compared with surface water [Lefkoff and Gorelick, 1990], seawater intrusion in coastal aquifers [Willis and Finney, 1988; Reichard and Johnson, 2005], and land subsidence [Wilson and Gorelick, 1996]. Therefore the impacts of alternative management strategies that rely to a greater extent on groundwater pumping should be carefully assessed.
 More efficient use of water in irrigated agriculture has been identified as another important strategy for dealing with water shortages [Gleick, 2003]. The economic benefits of increases in efficiency for irrigated agriculture have been discussed at the basin scale [Cai et al., 2003], at the field-scale as related to irrigation uniformity [Letey et al., 1984; Alvarez et al., 2004], and at the scale of individual plants related to crop irrigation scheduling and deficit irrigation [Yaron et al., 1980]. However, although the benefits of greater water-use efficiency for agricultural profits are clear, secondary effects such as reduced infiltration and recharge of underlying aquifers, as well as effects on downstream users, also need to be considered to account for detrimental impacts. Finally, water markets allow water to be redistributed to its greatest beneficial use, potentially resulting in an overall increase in profit. For example, Lefkoff and Gorelick  and Booker et al.  reported annual profit increases for irrigated agriculture between 17% and 33%, respectively.
 In this paper we investigate the benefits of conjunctive surface water and groundwater management and increases in water-use efficiency for one of the most important agricultural regions in Mexico, the 6800-km2 Yaqui Valley in the state of Sonora. From subsistence farming, this region has grown over the past 60 years to accommodate over half a million people and thousands of farms. The Yaqui Valley is famous for its highly productive engineered wheat strains. Wheat has historically been the dominant crop in this region, and in 2002 has provided up to 40% of the nation's irrigated wheat production (see http://www.siap.sagarpa.gob.mx/integra/Agricola/anuarios/AAgricola.zip). Since 1942, irrigated agriculture in the Yaqui Valley has relied on the supply of water from surface reservoirs. A historical drought (1996–2004) has drawn down reservoir levels, resulting in severe cuts in water supply and widespread fallowing [Addams, 2005; McCullough, 2005]. Because of large variability in the supply of surface water for irrigation, groundwater could potentially play a greater role in sustaining agricultural production in the Yaqui Valley. However, increased groundwater may lead to declining hydraulic heads, higher production costs, and the risk of seawater intrusion in this coastal aquifer system. The objective here is to identify improved strategies for managing surface water and groundwater resources in a sustainable manner, such that the impacts of prolonged drought periods on the local agricultural economy are minimized.
 Given the complexity of water management at the regional scale and the need to account for interactions between the surface water and groundwater systems, an integrated surface water/groundwater simulation model was developed and linked together in a unified optimization management model. Large-scale constrained nonlinear optimization [Gill et al., 2002] is used to find optimal management strategies within the constraints of the physical and agricultural systems represented by the integrated simulation models. Simulation-optimization methods have been used extensively in groundwater management [e.g., Gorelick, 1983; Yeh, 1992; Ahlfeld and Heidari, 1994; Wagner, 1995; Bredehoeft et al., 1995; Freeze and Gorelick, 1999; Feyen and Gorelick, 2004] and in conjunctive use [e.g., Bredehoeft and Young, 1983; Matsukawa et al., 1992; Reichard, 1995; Rao et al., 2004; Vedula et al., 2005]. This paper builds on these previous simulation-optimization studies, and features three particular strengths: (1) A complex spatially distributed groundwater model is directly incorporated into the optimization procedure, (2) an efficient methodology is used for solving the resulting CPU-intensive problem, i.e., using analytical Jacobians and a sequential solution procedure, and (3) the resulting integrated water management model is applied to a large-scale real-world problem in a developing country, generating insights that are also relevant to other irrigated systems.
 The main objective of this paper is to present the integrated water management model and apply it to the Yaqui Valley to quantify the sustainability and profitability of various alternative water management strategies compared with existing management practices. Our working hypothesis was that the impact of a historical drought on agricultural production and profit in the Yaqui Valley could have been mitigated by either an alternative management scheme using the existing infrastructure or an improvement in the existing infrastructure, i.e., lining of irrigation canals and addition of regional pumping well capacity.
2. Yaqui Valley Study Area
2.1. Agriculture and Water Resources
Figure 1 shows the location of the Yaqui Valley, which lies between the Sea of Cortez to the southwest and the Sierra Madre Mountains to the northeast. The Valley climate is semiarid with an average annual precipitation of ∼300 mm, most of it falling in the summer from June to September. Annual potential evapotranspiration averages 2000 mm. Most of the farmland in the Valley is part of the Yaqui Irrigation District (Figure 1), hereinafter called “the District.” The dominant crop is winter wheat, which is grown from November to April, and is irrigated using a combination of surface water and groundwater. The surface water system consists of three reservoirs on the Yaqui River (Figure 1) with a total capacity of ∼7000 × 106 m3. Median annual Yaqui River runoff is ∼2700 × 106 m3, generated by lower evaporation rates and higher precipitation rates at higher elevations in the Yaqui River basin. Surface water releases from the downstream Oviachic reservoir are conveyed to the District by means of three main irrigation canals, which are mostly unlined. Along the way, water is diverted by the various agricultural water management units, known as modules, that make up the District. Water is further distributed to individual fields within each module by means of a network of secondary irrigation canals. At the time of this study (2004), 333 wells (dots in Figure 1b) were operational with a total annual capacity of approximately 400 × 106 m3 to provide additional water for crop production. Although about half of the wells are privately owned, most of them are operated by the District, which supplies 90% of all groundwater, through a contracting system (“Plan Collectivo”) whereby well-owners contract their wells to the District. Throughout the District, a near-surface drainage network has been installed to drain surplus irrigation water from fields out to the Sea of Cortez. These drains are primarily open drainage ditches, with a small percentage of subsurface drainage pipes, at a depth of 1 to 2 m below the land surface. Most of the soils in the valley are clayey vertisols with organic matter contents less than 1% [Lobell et al., 2002].
 An estimate of the available storage in the deep aquifer under the District is made by summing the available storage under confined conditions (above the top of the screened wells), assuming a specific storage of 10−4 m−1, plus the remaining storage under unconfined conditions, assuming a specific yield of 0.2 and dewatering of two thirds of the aquifer thickness. This results in a value of approximately 100,000 × 106 m3, which is much larger than the available storage in the Yaqui reservoir system (7000 × 106 m3). Hence temporary pumping from groundwater storage to mitigate droughts could play a central role in a sustainable water management plan for the Yaqui Valley. Note that the above estimate ignores potential subsidence. Historically, groundwater use has been limited due to the abundant availability of cheap low-salinity (0.5 dS/m) surface water. Groundwater salinity varies spatially with mean and standard deviation of 2.2 and 1.3 dS/m, respectively. Groundwater is deemed suitable for irrigation of wheat, since wheat yield is only affected at soil salinity levels (ECe) of 8.6 dS/m or more [Maas, 1990]. However, more salt-sensitive crops such as corn may suffer yield reductions at soil salinity levels above 3–4 dS/m.
2.2. Water Management in the Yaqui Valley: Institutions and Policies
 All management and regulation of the water sector in Mexico is currently concentrated in the Comisión Nacional del Agua (CNA), or National Water Commission. This federal agency is responsible for operating, maintaining, and planning the surface water reservoir systems and exerts complete management control over groundwater in Mexico. Both individually and District-owned wells must be authorized by government permits, and the CNA often restricts pumping and establishes maximum extraction rates for aquifers that are heavily used. The District on the other hand has responsibility for operation and maintenance of the main irrigation canals, the collector drains, and the roads. At the smallest scale, the modules that make up the District are responsible for operation and maintenance of all secondary canal networks. The modules hold a right to District-delivered water proportional to their irrigable area. The modules can supplement their supply with private irrigation well water; however, historically most private well capacity (more than 80%) has been contracted to the District.
 Annual water planning occurs in September by a Hydraulic Committee, composed of the local CNA presence and several representatives from the District. The Hydraulic Committee proposes an annual allocation of irrigation water for the District by drafting an irrigation schedule for the entire year based on available water storage in the reservoirs, a forecast of upcoming in-season (October–April) basin runoff, and an anticipated cropping pattern. The annual allocation proposal is then reviewed and authorized by a federal CNA committee in Mexico City. The proposal also includes an estimated groundwater pumping volume, but historically irrigation has relied heavily on cheap, high-quality surface water and groundwater has accounted for less than 10% of water supply. When available reservoir storage is insufficient to irrigate the entire valley, which requires roughly 2150 × 106 m3, the stated CNA drought policy is to allocate the available storage plus the minimum in-season run-off volume on record (300 × 106 m3). However, because of negotiation by farmers' representatives serving on the Hydraulic Committee, actual allocations during the historical drought (Figure 2) were typically less conservative than that and are better described by the following empirical rule (Figure 3), which was obtained by linear regression using historical data on reservoir allocation and available storage:
where RA is annual reservoir allocation to the District and AS is available storage at the end of September, both in units of 106 m3. Available storage is calculated as the total storage in the three reservoirs minus 1650 × 106 m3, which accounts for dead storage (950 × 106 m3), evaporation (300 × 106 m3), and diversions to other users (400 × 106 m3), which includes water supply to first-priority users (i.e., 250 × 106 m3 to indigenous farmers in the Valley, and 100 × 106 m3 for urban water supply in the Valley), and ore mining and urban water supply in the upper basin (50 × 106 m3). The drought management policy described by equation (1) has resulted in significant over-allocations (allocations greater than reservoir inflows) causing decreases in reservoir storage (Figure 2) and widespread fallowing in the 2003–2004 growing season when only 17% of the valley was irrigated. In the following sections we describe our simulation-optimization model that was developed to identify improved water management policies that reduce the negative impact of droughts on agricultural production and profit.
3. Integrated Surface Water and Groundwater Simulation-Optimization Model
 The water management model presented here mimics profit-maximizing behavior of a single hypothetical planner who makes water use and cropping decisions for the entire District subject to institutional and resource constraints. Although in reality decisions are made at the farm scale, the annual plan of the Hydraulic Committee includes decisions on reservoir allocations and groundwater pumping rates as well as suggested crop acreages for the upcoming growing season. Therefore the plan determines to a large extent the constraints under which farmers can make individual decisions in the upcoming growing season. Hence, under the current institutional constraints, the annual planning process is simulated by a single profit-maximizing decision-maker, which in fact closely resembles the results of the negotiation process of the Hydraulic Committee. This approach is appropriate for forecasting the effect of policies and infrastructural changes at the District level. Further discussion of private versus public optimization of groundwater use is given by Gisser and Sanchez , Reichard , and Koundouri , among others.
 The management objective can be formulated as follows: Given initial water storages in the reservoirs and the aquifer at the start of the growing season (end of September), determine the amounts of water to release from the reservoirs, the amounts of water to pump from the aquifer, and the crop acreages, such that total agricultural profits in the District are maximized subject to institutional, logistical, and resource constraints. Physical constraints are represented by integrated simulation models for the various subsystems, i.e., the surface water reservoirs, the irrigation canal network, the crop root-zone, and the aquifer system. Mathematically, the following nonlinear constrained optimization problem is solved,
where FObj is the objective function which depends on the vector of decision variables x with lower bounds lx and upper bounds ux, and F is a vector of smooth linear and nonlinear constraint functions also dependent on x. The various parts of the model are discussed in more detail in the following sections.
3.2. Decision Variables, x
 The decision variables and their bounds are listed in Table 1. The decision variables include (1) crop acreages, (2) groundwater pumping, and (3) reservoir releases. Lower and upper bounds for the decision variables in Table 1 are based on observed minima and maxima during the period 1995–2005. Annual District-scale crop acreage decisions, CropAcy,cr, directly affect income and profit from irrigated agriculture subject to crop prices and production costs. In addition, given differences in crop water requirements, salt tolerance levels, and irrigation schedules, crop acreage decisions permit flexibility in dealing with water shortages, changes in irrigation water quality, and timing of irrigation water demand. The model includes 12 different crops, the most important ones being wheat, maize, safflower, cotton, vegetables, alfalfa, and citrus. Soybeans were a significant crop until a widespread whitefly infestation in 1995 [Naylor et al., 2001], and are therefore not considered. District-scale crop acreages are downscaled to the modules by assuming that each module has the same crop mix, or
where ModAream is module irrigable area. Although this constraint may seem restrictive, it is supported by module wheat acreage data over the period 1996–2003. It is a consequence of a CNA regulation that the District must provide water to the modules proportional to their irrigable areas. As a surrogate for this required condition, equation (3) in effect ensures spatial equity among the modules in terms of agricultural production and opportunity for profit. When we tested the replacement of (3) with the less restrictive constraint of proportional water allocation, combined with module-based cropping decisions, we observed no significant effect on simulated wheat acreages, profits, and water allocation decisions. The advantage of using equation (3) is that the number of decision variables is much smaller, namely, crop decisions are made at the District scale instead of the module scale.
Table 1. Elements of the Decision Variables Vector, x
release from Angostura to Novillo in year y and month t
n × nt
release from Angostura to urban and mining users in year y and month t
n × nt
reservoir release from Novillo to Oviachic in year y and month t
n × nt
reservoir spill in year y, month t, and reservoir k (k = 1…3)
n × nt × 3
 Annual planning of groundwater use involves decisions on monthly groundwater pumping rates from all 333 wells. For given crop acreages, pumping determines how much water is consequently required from the surface reservoir. Wells in the Yaqui Valley can be divided into wells that discharge into one of the main irrigation canals (93 out of 333, denoted by wdm), and wells that discharge into a secondary canal (240 out of 333, denoted by wds). In the model, annual pumping decisions are made for total pumping into one of the three main canals k (PumpDMy,k) and total pumping into secondary canals for each of the modules m (PumpDSy,m). Pumping into a main canal brings irrigation water available to all downstream modules and hence is especially valuable during water shortages for modules with a low pumping capacity. However, it results in larger conveyance losses and lower efficiency compared with pumping into a secondary canal. Conveyance losses consist of leakage from unlined irrigation canals and are calculated using a canal routing model, described in Appendix B. Groundwater pumping decisions at the module and canal levels are downscaled to individual wells based on well pumping capacities, and hence
where PumpCapw is monthly pumping capacity for well w, which was determined from maximum historical pumping rates. As discussed later, pumping decisions are also affected by groundwater salinity and hydraulic lift. In addition, monthly groundwater pumping is assumed to follow monthly crop water demand, with annual pumping decisions distributed as
where fGWt,cr is a given groundwater irrigation schedule for crop cr and IRcr is the seasonal irrigation requirement of crop cr. Equations (4) and (5) reduce the number of decision variables and ensure that pumping patterns generated by the model are realistic.
 Finally, surface reservoir release decisions include monthly releases from Angostura to Novillo, Qy,t,1, monthly releases from Angostura to mining and urban users, Qy,t,min, and monthly releases from Novillo to Oviachic, Qy,t,2. Note that releases from Oviachic reservoir to the District are not included as independent decision variables, but are instead calculated based on the irrigation water demand in the District, which in itself depends on the crop acreage and groundwater pumping decisions. This is further discussed in section 3.4. Reservoir spills, Spilly,t,k, are also included as decision variables for optimization purposes and are only allowed to occur when reservoirs are at full capacity. This is achieved by minimizing the total volume of reservoir spills, as shown in (6) and discussed in section 3.4.
3.3. Objective Function, FObj
 Following annual decision making by the Hydraulic Committee, the approach taken here is to solve a sequence of annual optimization models over a period of n years, where each year the following objective function is maximized,
where DistProfy is total District profit [Mexican pesos, M$] in year y and the second term is used to minimize reservoir spills, as discussed later. District profit is the total profit summed over all modules in the District,
where CPy,cr is crop price [M$/t], Yy,m,cr is crop yield [t/ha], CSy,cr is crop subsidy [M$/ha], CCy,cr is crop production cost excluding water costs [M$/ha], and DCy,m represents maintenance and water delivery costs paid by the module to the District. Crop yield is calculated as a function of irrigation water volume and salinity by means of an agronomic model fcrop, that accounts for water and salt stress effects on crop yield (Appendix A). Crop subsidy and crop production costs are parameters specified exogenously to the model (Table 3). Crop subsidies consist of direct income payments from the government PROCAMPO program, which pays farmers for planting crops [Addams, 2005]. During 1996–2005, crop subsidies amounted to 4–10% of total income. Each module pays a share of the total District cost proportional to its share of District-delivered water,
where FCy is the total annual maintenance cost [M$], and CWy,m and GWy,m are surface water and groundwater use by module m in year y. The second term in parentheses represents groundwater pumping costs summed over all wells. Pumping costs for each well are calculated based on energy costs and the hydraulic lift needed to bring water to the surface. As discussed in the next section, by means of a regional groundwater model this calculation accounts for both local in-well drawdowns and frictional losses as well as interactions between wells.
3.4. Constraints, F
 The constraints and their bounds are listed in Table 2, including constraints on crop acreages, pumping capacity, reservoir storages and releases, leaching rates, and water table and aquifer head levels. Lower and upper bounds for the constraints in Table 2 are based on observed minima and maxima of District-wide total production during the period 1995–2005. The first set of constraints ensures that the total crop acreage grown in the District does not exceed the total irrigable area in every year of the simulation,
where the summation is over the winter and perennial crops. The next set of constraints introduces limits on the amount of groundwater pumping allowed, as limited by the monthly pumping capacities of the individual wells,
Monthly pumping capacity for each well in (10) was estimated as the maximum historically observed monthly pumping rate from that well. This prevents the optimal solution from relying on unrealistically high pumping rates. However, how this pumping happens during the month is left unspecified. Given the relations in (4) and (5), these constraints may be reformulated at the scale of the main canals and modules,
These constraints ensure that total monthly groundwater pumping from each set of wells does not exceed the total monthly pumping capacity of these wells. Note that the constraint depends not only on the amount of pumping but also on the timing of irrigation water demand. Hence peaks in water demand during the year will limit groundwater pumping.
The n is number of years simulated (= 10); ncrops is number of crops (= 12); nmod is number of modules (= 42); nt is number of months per year (= 12); nl is number of pairs of groundwater cells for gradient constraint (= 41).
Upper limit is a function of available storage at the start of the year, as, e.g., in equation (1).
winter crop acreage in year y
pumping constraint for main canal k in year y and month t
n × nt × 3
pumping constraint for module m in year y and month t
n × nt × nmod
Angostura reservoir storage in year y and month t
n × nt
Novillo reservoir storage in year y and month t
n × nt
Oviachic reservoir storage in year y and month t
n × nt
reservoir release from Oviachic to the District in year y and month t
n × nt
annual reservoir release to the District in year y
field-scale leaching fraction for crop cr in module m in year y
n × nmod
average water table depth in year y and module m
n × nmod × ncrops
groundwater head difference near the coast in year y for each pair l of groundwater model cells
n × nl
 Constraints for monthly reservoir storages Sy,t,k are calculated based on a monthly water balance for each reservoir k,
where ROy,t,k is monthly runoff into reservoir k, Py,t,k and Ey,t,k are precipitation and evaporation depths, Ay,t,k is reservoir surface area, Qy,t,k−1 and Qy,t,k are releases from the upstream and the current reservoir, respectively, fc is a coefficient (equal to 0.9) accounting for conveyance losses between the two reservoirs, and Qy,t,kfix are fixed (required) releases for priority water users (urban water users and indigenous farmers in the Valley). Monthly runoff is specified based on river discharge data into each reservoir. Reservoir surface area depends nonlinearly on the reservoir storage, here approximated using the previous month's storage,
where ak and bk are coefficients, which were obtained by fitting equation (13) to experimental data on reservoir storage and area. Reservoir spills in (12) could result in a decrease in reservoir storage. However, during the period from 1995 to 2005, spills did not occur either in reality or in the simulations. For completeness of the model, we ensured that spills could only occur when the reservoir storage was at its upper limit; simulated total spills are minimized in (6), where α is a sufficiently small scaling factor that prevents a possible spill-term from dominating the profit-maximizing objective.
 The next set of constraints relates to monthly releases from Oviachic reservoir. As discussed earlier, releases from the other two reservoirs are treated as independent decision variables. Releases from Oviachic (Qy,t,3) instead are calculated from the irrigation water demand in the District that is not met by groundwater pumping,
where CWy,t,m is canal water demand from module m in year y and month t, and Qleak,y,t,r is canal seepage loss from reach r in year y and month t,
where CWy,t,m,cr is canal water demand from crop cr in module m, and fcanal denotes the canal model (Appendix B), and
where fWRt,cr is a monthly irrigation schedule for crop cr. Following (5), monthly groundwater use by crop is proportional to crop water demand,
Equations (15)–(18) constitute a “bottom-up” calculation, which starts at the smallest spatial scale in (18), summing the water requirements not met by groundwater over all crops in each module using (17), and then accumulating these sums over all modules in the District. This means that groundwater pumping directly determines the demand for surface water (17), which in turn, through (15), (14), and (12), affects surface water availability (reservoir storage). Water distribution losses within the modules by seepage from the secondary irrigation canals are accounted for by module-specific but constant efficiency coefficients (ModEffm). Water seepage losses from the main irrigation canals on the other hand are determined using a spatially distributed water balance (fcanal) for a series of canal reaches. The canal model is discussed in Appendix B. In addition to constraints on monthly releases, we also implement an upper limit on annual release from Oviachic reservoir as a function of total available storage at the start of each year, according to the empirical operating rule (1).
 The next set of constraints in Table 2 puts an upper limit on the field-scale leaching fraction,
The first term represents water losses due to nonuniform irrigation practices at the field scale, with IrrigEffcr a crop-specific field-scale irrigation efficiency. The annual irrigation amount for crop cr in module m and year y, AWy,m,cr, is the sum of canal water and groundwater applied to the crop,
The second term in (19) accounts for deep percolation losses due to reduced plant growth caused by salt stress,
where fcrop is the agronomic model (Appendix A), which calculates crop yield and deep percolation as a function of irrigation water amount (AW) and salinity (ECi), which is a mix of canal water and locally pumped groundwater,
Monthly salinity of the delivered canal water (ECcw) is determined with the canal model (Appendix B), and groundwater salinity (ECgw) is spatially variable but constant for each individual well. Accounting for changes in groundwater salinity would require the simulation of aquifer salt transport, which is not done here. Long-term salinity data suggest that groundwater salinity values have remained stable even if they are spatially variable, being higher in some areas due to the presence of evaporite deposits. We account for this fixed spatial variation in groundwater salinity.
 Constraints on the water table depth (WTDy,m) and on the hydraulic gradient near the coast (CHDy,l) are also included, where l is the index of all nl gradient control pairs (nl = 41). Minimum water table depths are imposed to ensure that management decisions do not result in soil salinization by means of capillary rise from a shallow water table, since interannual salt accumulation is not explicitly accounted for in the model. The coastal head gradient constraint on the other hand prevents saltwater intrusion and subsequent degradation of groundwater quality. Both of these constraints are calculated as a function of the rates of irrigation-related groundwater recharge (by module, Ry,m), canal seepage losses (by reach, Qleak,y,t,r), and groundwater pumping (by well, PumpWy,w) by means of a regional groundwater model frgw [Schoups et al., 2005],
where recharge includes nonuniform field leaching, deep percolation losses, and seepage losses from main and secondary canals. Hydraulic heads (drawdowns) calculated with the regional groundwater model are used to calculate pumping cost in each well, and are adjusted to account for local in-well drawdown,
where EnCosty is energy cost [$/kWh], kEN is energy requirement per unit lift and per unit volume of water [kWh/m/(106 m3)], PumpEffw is energy efficiency of the well [ ], Elevw is land surface elevation of the well [m], hy,t,w is regional aquifer head [m], kDD is a spatially variable conversion factor for calculating in-well drawdown using the Thiem equation [Lerner, 1995], and Tw is transmissivity at the well. Note that PumpEffw in (25) parametrically accounts for well losses. Regional hydraulic heads depend on recharge and pumping as calculated by the groundwater model frgw,
The pumping costs in (25) are summed annually and used to calculate module profits in (8).
Table 3 lists the parameters of the integrated model, which are classified by type, i.e., general, crop, module, reservoir, well, and groundwater model parameters. Parameter values were derived from a variety of sources, as indicated in Table 3, which also gives ranges for each parameter. The hydraulic parameters of the regional groundwater model were obtained by a multiobjective calibration method [Schoups et al., 2005]. The canal distribution and agronomic models were independently calibrated using data from the Yaqui Valley [Addams, 2005]. In the results section we will describe how predicted crop acreages, reservoir levels, and pumping costs compare with historical conditions in the Yaqui Valley.
Table 3. Parameter Ranges of the Integrated Surface Water/Groundwater Model and Data Sources for Their Estimation
 The constrained nonlinear optimization problem represented by (2) was solved using the large-scale gradient-based sparse system solver SNOPT [Gill et al., 2002]. For each set of decision variables, the integrated simulation models were run to calculate the objective function, the constraints, and the nonzero Jacobian elements (Table 4). Given the relatively large computational demand of the integrated simulation models, and especially the groundwater model, two particular strategies were employed to increase the efficiency of the optimization. First, a subset of the nonzero elements of the Jacobian were analytically derived (Appendix C) and coded, thereby eliminating the need to approximate these elements by finite differences and reducing the number of calls to the simulation model. Table 4 shows the structure of the Jacobian, indicating the nonzero elements and the derivatives that were determined analytically or numerically. Second, for each optimization problem, SNOPT was run twice in succession. The first time, an initial guess is provided by the user and the optimization problem is solved without running the groundwater model but instead maintaining the initial aquifer heads constant. The resulting optimal solution is then used as a new initial guess for a second optimization which now includes the groundwater model. Because of the computational burden of running the groundwater model for each set of decision variables, this strategy was found to be faster overall by a factor of 1.5–2 compared with solving a single cold-start optimization problem with the groundwater model. The reason for this net gain in speed is that an initial fast “good” solution in the first run led to rapid convergence in the second run of the optimization problem with the groundwater model present. The approach is somewhat similar to the method of Cai et al. . The optimization problem includes approximately 140 decision variables, 700 constraints, and 3000 nonzero Jacobian elements per year. The management model was run for a period of 10 years, covering 1995 to 2005, by sequentially maximizing annual profits.
Table 4. Structure of the Jacobian Matrix of the Optimization Model for Year y, Indicating Nonzero Elements When Conditions in Brackets Are Satisfied and Calculated Analytically (A) or Numerically (N)
N (ki = kj)
N (mi = mj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
A (ti ≥ tj)
N (mi = mj)
3.7. Sustainability Indices
 Sustainability of alternative management strategies is evaluated in terms of the following three indices modified from Cai et al. :
where REL is reliability, RES is resiliency, and IVUL is invulnerability or the opposite of vulnerability. IrrFracy is the fraction of total irrigable land irrigated in year y, n is total number of years, and nfail was chosen as the number of consecutive years that irrigated acreage is smaller than 85% of total irrigable land. Values for these indices vary between 0 and 1, with higher values indicating greater sustainability. They are combined into an overall sustainability index,
with values between 0 and 3. Sustainability in terms of salinization of soil and groundwater resources is handled directly through the water table depth (23) and aquifer gradient constraints (24), through which salinity increases are implicitly constrained instead of simulating salt transport explicitly.
4. Results and Discussion
 The results consist of two main sections. First, the accuracy of the simulation-optimization model as a management tool is explored by inspecting the degree to which historical water management practices are reproduced. Second, we present an evaluation of alternative management strategies that improve upon historical management of the system in terms of profit, irrigated acreage, and sustainability.
4.1. Historical Water Management
 First, we explored how well the simulation-optimization model mimics historical conditions in the Yaqui Valley by comparing management model results with observed data on profits, crop acreages, reservoir releases, and groundwater pumping for the period 1995–2005. As shown in Figure 2, this period coincided with a historical drought during which reservoir storage reached an all-time low. Such a comparison also yields valuable insights into the factors that caused reductions in agricultural productivity and profit. Historically, reservoir releases to the District have been based on available reservoir storage at the start of the growing season at the end of September. Therefore, for the historical comparison, the empirical operating rule of (1) was implemented in the model as an upper limit for annual release from the downstream Oviachic reservoir. The model was then run sequentially by maximizing annual District profit for the period 1995–2005 using annual data on crop prices, production costs, and crop yields. Bounds on the decision variables were set at their historical minima and maxima, and data on groundwater and reservoir levels for 1995 were used as initial conditions. The use of historical bounds is necessary to incorporate certain market constraints that are not explicitly accounted for in the model (e.g., production limit for vegetables). The historical data show enough variability from year to year, so that the model did not become overly constrained.
Figure 4 compares observed and simulated crop acreages, groundwater pumping, reservoir releases and storages, pumping cost, and profits. Total irrigated acreages (Figure 4a) were well reproduced by the model, simulating an initial decrease due to the disappearance of corn as a summer crop, followed by a sharp decline in irrigated area during the 2003–2004 growing season when less than 20% of the District was irrigated. Prediction of wheat acreage, the main crop, was deemed successful although imperfect. One difficulty is that available data on crop prices were end-of-season prices, which varied significantly from year to year and did not necessarily correspond to perceived or expected prices at the time of planting. For example, the 2005 end-of-season price for wheat indicated that wheat was not profitable, but nevertheless 60,000 ha of wheat were grown during the 2004–2005 growing season. As shown by Addams , small differences between expected and real crop prices can likely explain discrepancies between observed and simulated acreages of individual crops. For the results in this paper, the only price adjustment for wheat was in 2005, when the 2004 wheat price and production costs were assumed. Apparently, in 2005 farmers decided to grow wheat based on the previous year's profitability, even though wheat ended up being unprofitable. Figure 4a shows that the model is able to reproduce the trend in wheat production, the significant reduction in both total and wheat irrigated acreage during the 2003–2004 growing season, and a modest rebound in production during 2004–2005.
 The reduction in agricultural production for the 2003–2004 growing season was caused by a sharp decrease in the amount of water available for irrigation. Figure 4b shows that the model reproduces changes in total reservoir storage, including the decline to the dead storage level in 2004. Figure 4c shows that using the empirical reservoir operating rule (equation (1)), the model replicated the cut in surface water released from the reservoir in 2004, when actual surface water allocation to the District was virtually zero and irrigation basically depended on groundwater pumping. Interestingly, in 2004 historical pumping amounted only to 310 × 106 m3 (the simulated value was 355 × 106 m3), which is less than the maximum historical pumping of 435 × 106 m3 in 2003. Possible causes for the limited pumping are that pumping costs were too high or that groundwater salinity was deemed too high for irrigation. However, pumping costs (Figure 4d) only amounted to a relative small fraction (about 4%) of total production costs. In addition, when rerunning the model with zero energy costs and by ignoring the effect of salinity on crop yield in 2004, simulated pumping increased only slightly, from 355 to 381 × 106 m3. It was also verified that the coastal hydraulic gradient constraint to prevent seawater intrusion was not binding. Instead, another constraint must have been limiting, as suggested by Figure 5. This figure illustrates that in 2004 during the peak-demand month of March, well capacity remained unused in modules having a large pumping capacity. Pumping into main canals on the other hand was at capacity. The reason for these results is that due to the spatial equity constraint of water distribution and crop production in the modules (equation (3)), agricultural production and pumping was limited by water availability in modules without access to additional irrigation water from secondary canal wells. This suggests the potential benefit of installing more wells that pump into main canals upstream of modules with limited pumping capacity or that pump into secondary canals for modules currently lacking any wells. As an alternative, surplus groundwater from high-capacity modules could be traded on the existing intermodule water rental market, although historically, through 2004, less than 5% of total water use has been traded in this manner [Addams, 2005]. So, whereas in wetter years (1996–2003) agricultural production is limited by irrigable area (equation (9)), in drier years (2004–2005) water availability is the limiting factor through the mathematical constraints of annual reservoir release (equation (1)) and monthly reservoir storage (equation (12)) for surface water, combined with the spatial equity (equation (3)) and nonuniform pumping capacity (equation (11)) constraints for groundwater. Note, finally, that the model underestimates groundwater pumping costs after 2001 (Figure 4d), which may be due to an underestimation of total groundwater use in 2002 (Figure 4c) and the ability of the model to find optimal pumping rates with lower pumping costs compared with reality.
 As a consequence of the reduced water availability in 2004, agricultural profit also decreased dramatically, even becoming negative according to the data (Figure 4e). Figure 4e actually indicates two periods of lower profit, both reproduced by the model. The first period from 1999 to 2001 corresponds to a cycle of decreasing crop prices combined with increasing production costs. This result reveals the vulnerability of Yaqui Valley agriculture to world market price fluctuations under the North American Free Trade Agreement (NAFTA) [Naylor et al., 2001]. The second period of lower profits includes the 2003–2004 and 2004–2005 growing seasons, when water scarcity was the main limiting factor, especially in 2004. Note that the model, which achieves optimal profitability, is able to avoid negative profits during this period since it “sees” the actual end-of-season crop profitabilities and hence chooses to grow only profitable crops, including profitable wheat. These results demonstrate that agricultural profit in the Yaqui Valley depends not only on water availability but also on changes in crop prices and production costs. In this paper we are only concerned with increasing water availability as a means of increasing agricultural production. For that reason, we assume that wheat was and will be a profitable crop, and in the following sections we will propose alternative water management strategies under that assumption.
4.2. Alternative Water Management Strategies
 The purpose of this section is to investigate whether the historical drought impacts on agriculture could have been avoided with alternative water management practices. We first look at the potential benefits of improved conjunctive surface water/groundwater management using the existing infrastructure. Afterward, we look at possible engineered improvements to the existing infrastructure, such as installing more wells and lining the irrigation canals. We use an annual timescale for decision-making to evaluate operating rules and infrastructural effects that will work well under the current institutional framework, which is built upon annual instead of multiannual decision-making.
 In this case study we evaluate whether the impact of the drought could have been mitigated using different reservoir allocation rules than the historical one in (1), namely, ones that rely to a greater extent on groundwater use during wet years. Three new “conjunctive-use rules” were tested by changing slope and intercept of the operating rule in (1), with smaller slopes indicating greater conjunctive use of surface water and groundwater (Table 5). The three rules in Table 5 correspond to a sequence of greater reliance on groundwater in wet years to save surface water for dry years. The model was again run for the period 1995–2005 for the three conjunctive-use rules and the results were compared with historical management.
Table 5. Alternative Conjunctive-Use Operating Rules, Specifying Annual Reservoir Allocation RA as a Function of Available Reservoir Storage AS at the Start of the Year Using a Linear Operating Rule, RA = a × AS + b
Figure 6a shows resulting values for the three sustainability indices of (27) for each of the improved operating rules. It is clear that conjunctive-use rules CU1 and CU2 result in similar sustainability index values compared with the data and the historical rule. However, conjunctive-use rule CU3 clearly outperforms historical management in terms of resiliency and especially in terms of invulnerability. Rule CU3 consists of a temporally constant annual reservoir allocation of 1450 × 106 m3, which in the initial wet years results in less surface water and more groundwater use than occurred historically (Figures 6c and 6e). As a consequence, reservoir storage at the start of the 2003–2004 growing season is greater (Figure 6d), enabling farmers to irrigate a much greater acreage (Figure 6b). Therefore conjunctive-use rule CU3 reduces the vulnerability of the system to extreme droughts by using reservoir water more cautiously during wet years and compensating for the reduction in surface water by increased groundwater pumping. The allocation limit of 1450 × 106 m3 however does not allow one to grow any summer crops during the first two years (Figure 6b). The impact on agricultural profit is negligible during wet years, but overall profit more than doubles during the 2003–2004 growing season compared with management using the historical rule (Figure 6f). It is concluded that the impact of the historical drought likely could have been significantly reduced without affecting profit in wet years by better managing surface and groundwater resources, namely, by pumping more annually and allocating reservoir water more conservatively through an upper limit on annual reservoir releases of the form of (1). This finding confirms our working hypothesis about water management in the Yaqui Valley and the impact of the historical drought. Since the result is based on a single 10-year period, its robustness needs to be tested over a wide range of future runoff scenarios. This will be investigated in a later study, together with the determination of an optimal operating rule [Schoups et al., 2006].
4.2.2. Infrastructural Improvements
 Infrastructure improvements are being considered as part of a District Modernization Plan, including lining of the irrigation canals and installation of 200 new production wells [McCullough, 2005]. The estimated cost is M$713 million (M$ = Mexican pesos), which will be funded by the federal government and supplemented by a small area-based fee paid by farmers to the District until 2013. In this section we investigate the potential benefits of these improvements by comparing them with management during the historical drought. We ignore the associated costs since they are borne mostly by the federal government.
 The obvious benefit of lining the irrigation canals is that seepage losses are reduced and more water can be used for irrigation. In addition, reduced groundwater recharge may lower the water table and decrease the risk of soil salinization by capillary rise. A potential expected negative effect is that hydraulic heads might decrease as a result of lower recharge rates, resulting in higher pumping costs. We ran the model for the period 1995–2005 using the historical operating rule in (1) as an upper limit for reservoir releases, in combination with, first, lining all the secondary canals, and second, lining both the secondary and main irrigation canals. Main canal lining was simulated by lowering the canal bed conductivity in (B2) by an order of magnitude, whereas secondary canal lining was implemented by uniformly increasing module irrigation efficiency in (15) to the largest observed value of 0.98.
Figure 7a shows that lining the secondary canals results in more sustainable management of the system, especially in terms of increasing the invulnerability index. Lining both secondary and main canals leads to even greater sustainability. The main impact of lining is that more crop acreages can be grown during the 2003–2004 and 2004–2005 growing seasons (Figure 7b) compared with historical conditions. In fact, after lining the canals total irrigable land, (9) becomes the only limiting factor to agricultural production, even in the driest years. The greater conveyance efficiency allows smaller reservoir releases (Figure 7c) and greater reservoir storage (Figure 7d). During the first 5 years, lining of the secondary canals results in water savings of on average 294 × 106 m3, and lining the main canals yields an additional 288 × 106 m3 per year. Average annual water savings from lining amount to 30% of the average annual historical reservoir releases. This number corresponds well to District records that indicate that during that same period 33% of the annual reservoir releases were lost by seepage from the secondary and main canals. A further effect of the water savings is that less groundwater pumping occurs (Figure 7e), basically at the minimum rate of 200 × 106 m3 per year. The impact on agricultural profit is again negligible during wet years, but profit more than doubles during the 2003–2004 growing season compared with management without lining (Figure 7f). Figure 8 shows that canal lining reduces groundwater recharge by ∼50%. Surprisingly, the anticipated negative impact on hydraulic heads in the deep aquifer did not occur. Instead, reduced recharge resulted in reduced agricultural drainage and evaporation from the shallow water table (“noncrop ET” in Figure 8) and also lower rates of groundwater pumping. We also found that canal lining resulted in simulated total pumping costs that were smaller than for historical management with unlined canals.
 As was concluded from the historical comparison in section 4.1, installing additional wells in modules that currently have limited or no pumping capacity may increase agricultural profit during droughts. Here we investigate to what extent this is possible and whether the benefits of the additional water outweigh the costs. Before solving the optimization problem, a list of potential well locations was identified for each module in the District by focusing on areas of low aquifer salinity and high aquifer transmissivity. The optimization model was then run for different additional-well scenarios, corresponding to additional installed pumping capacities of 50, 100, 200, and 300 × 106 m3 per month. Each new well would pump into a secondary canal and have a monthly pumping capacity of 0.25 × 106 m3. Therefore adding a capacity of 50 × 106 m3 amounts to installing 200 new wells.
Figure 9 shows how the simulated sustainability index and irrigated acreage change as a function of added pumping capacity. Optimization results are shown for cases with and without accounting for pumping cost, and with and without considering the seawater intrusion gradient constraint (equation (24)). When pumping cost and seawater intrusion are not considered, sustainability can be greatly increased relative to the historical value of 2 by installing more wells (Figure 9a). For an additional capacity of 300 × 106 m3 or 1200 wells, a maximum sustainability index value of 3 is obtained. This result shows that reduced crop yield due to salinity stress is not a concern, even when groundwater is the main source of irrigation water. Pumping cost and seawater intrusion on the other hand significantly reduce the benefits from added pumping capacity in terms of sustainability (Figure 9a). Furthermore, their relative importance varies from year to year as shown in Figures 9b and 9c. During the 2003–2004 growing season, seawater intrusion is by far the dominating constraint on agricultural production (Figure 9b), when groundwater pumping in coastal modules is limited to prevent seawater intrusion (Figure 10). Wheat profitability in 2004 is large enough to pay for the additional costs of increased groundwater pumping, even at an additional monthly capacity of 300 × 106 m3 and a 2004 pumping rate of 1400 × 106 m3.
 The situation is completely reversed during the 2004–2005 growing season, when pumping costs are the main factor limiting agricultural production (Figure 9c), at least for additional capacities over 50 × 106 m3, due to the cumulative drawdown from earlier pumping. Under these conditions, wheat cannot be profitably grown with groundwater as the main irrigation source. These results illustrate that a greater reliance on groundwater requires profit margins for wheat larger than the ones in 2005. Otherwise, wheat may have to be replaced with more high-valued crops such as citrus and vegetables [Addams, 2005]. Note also that installation and maintenance costs for newly installed wells were not accounted for in the current analysis, and therefore our results are optimistic. Given an installation cost of M$1.2 million per well (J. L. Minjares, CNA, personal communication, 2005) and an average annual profit of approximately M$1 billion, installing 200 wells would cost 25% of annual profits. Therefore federal support would be needed to significantly increase pumping capacity in the Valley. However, our results show that even if installation costs are not an issue, pumping costs and seawater intrusion will limit groundwater-based agricultural production to about 50% of total irrigable land (Figure 9).
 Even though results showed that crop yield reduction due to salinity stress is not a major concern of increased groundwater use, a potential limitation is that interannual salt accumulation is not explicitly accounted for in the simulation models. As discussed earlier, salt accumulation is implicitly accounted for by means of the water table depth constraint which prevents capillary rise from a shallow water table. Figure 11 shows changes in water table depth during the period 1995–2005 for some of the alternative strategies discussed so far. In every case, water tables are declining, which points to a decreasing risk of soil salinization. In addition, groundwater salinities are such that for the current leaching fractions, severe salinity stress of salt-tolerant wheat is unlikely.
5. Summary and Conclusions
 A spatially distributed simulation-optimization model was developed for an irrigated system consisting of multiple surface water reservoirs and an alluvial aquifer. The simulation model consists of physical models describing water flow through the reservoirs, the irrigation canals, and the aquifer system, as well as an agronomic model. A profit maximization problem was formulated and solved using large-scale constrained optimization. The resulting CPU-intensive problem was solved efficiently by (1) analytically deriving and coding part of the Jacobian matrix and (2) using a sequential solution procedure where an improved initial estimate was found by first solving the optimization problem without the groundwater model.
 The model was applied to a critical real-world conjunctive surface water/groundwater management problem in the Yaqui Valley, an irrigated agricultural region in Sonora, Mexico. First, the simulation-optimization model was used to reconstruct historical water management and its impact on agricultural production during a historical drought. The model reproduced observed changes in agricultural production, in particular the reduction in reservoir storage, irrigated acreage, and agricultural profit during the 2003–2004 growing season. Because of the spatial equity constraint of water distribution within the study area, agricultural production had mainly been limited by water availability in areas without access to additional groundwater. Simulated effects of pumping cost and salinity stress were much less important. Results further indicated that agricultural profit in the Yaqui Valley depends not only on water availability but also on changes in crop prices and production costs.
 Alternative management strategies were explored and their sustainability was assessed. It was found that the impact of the historical drought could have been significantly reduced without affecting profit in wet years by managing surface water and groundwater resources in a different way than has been done historically, namely, by pumping more annually at a rate of 400–450 × 106 m3 and limiting annual reservoir allocation to 1450 × 106 m3. Lining of the irrigation canals would have saved 30% of historical reservoir releases during wet years, which were used in subsequent drier years to increase agricultural production. Groundwater recharge was reduced by 50% due to lining, which had an impact mainly on the shallow groundwater system, resulting in lower water tables and less evaporation and drainage. Since the current well capacity is not sufficient to irrigate the entire District, installing additional wells may also reduce the impacts of droughts. However, it was found that both seawater intrusion and pumping costs significantly limit the potential benefits of increased groundwater pumping.
 The alternative management strategies investigated in this paper apply only to the historical period from 1995 to 2005. Even though tree ring data indicated drought conditions of the 1997–2003 period are the most severe in the last 300 years [Diaz et al., 2002; D. Battisti, University of Washington, personal communication, 2005], at this point it is unclear whether these strategies will be beneficial and sustainable for future water management in the Yaqui Valley. Therefore the work presented here needs to be extended by testing the proposed strategies over a wide range of future runoff scenarios to better assess the sustainability of alternative water management. For example, for more severe droughts the proposed upper limit of 1450 × 106 m3 on annual reservoir allocation may have to be lowered in order to maintain agricultural production throughout the drought. Lining the canals is likely to be beneficial over a wide range of future run-off scenarios, since reduced recharge was found to have a negligible effect on deep aquifer hydraulic heads.
 Other management strategies such as investments in more efficient irrigation technologies or the practice of deficit irrigation could also be investigated with the present model. However, these were not considered here because of two specific constraints that exist in the Yaqui Valley. First, required capital investments for improvements in irrigation technology provide a significant barrier and would have to come from sources unassociated with the water management sector. Second, more efficient irrigation practices would also have to be accepted by creditors, who typically do not allow farmers to under-irrigate.
 The overall methodology of this study, relying on a linkage of state-of-the-art optimization techniques and sophisticated simulation models, may be applied to any other region to study conjunctive use. Although the quantitative results of this study are specific to the region studied, several overall conclusions apply to other irrigated settings. For example, the paper confirms the finding of Bredehoeft and Young  about the benefit of groundwater use in the face of large uncertainty in surface water supply. Whereas in their case farmers installed enough well capacity to irrigate the entire area, we found that in the Yaqui Valley complete reliance on groundwater is not feasible because agriculture is dominated by wheat, which is a low-value crop (pumping cost constraint) and groundwater is pumped from a coastal aquifer (seawater intrusion constraint). These results may apply to other coastal irrigated systems in developing countries that are based largely on the production of low-valued crops.
Appendix A:: Agronomic Model
 The agronomic model predicts crop yield and deep percolation losses as a function of seasonal irrigation depth and salinity. The model accounts for both water and salt stress effects on crop yield and incorporates a simplified model for soil salinization as a function of amount and salinity of the irrigation water [Letey et al., 1985],
where RY is relative yield (RY = 1 if there is no salt stress), ECe is root-zone average soil salinity, EC50 and p are parameters of the salt stress function, YD is the yield decrement due to salt stress, Yns is crop yield in the absence of salt stress, ECi is irrigation water salinity, LF is leaching fraction, defined as deep percolation DP divided by available infiltration AW, ETmax is the crop water demand under nonstress conditions, Ymax is potential crop yield under nonstress conditions, and AWt is the value of available infiltration at which crop yield is zero. Assumptions and limitations of the model were discussed by Letey et al. . A disadvantage of the model is that it requires an iterative solution, because of the mutual dependence of RY, YD, LF, ECe, and DP. This may lead to insufficient numerical accuracy when applying nonlinear gradient-based optimization algorithms. One approach then is to approximate the model by smooth cubic splines [Addams, 2005], but this may be cumbersome when a large number of crops are considered. Here, we used a different noniterative calculation of crop yield and deep percolation by introducing the following approximation to the soil salinity model in equation (A3):
where a is a parameter which was found to be related to p as a = 1.04p − 1.94. With this modification, and after some algebraic manipulations, the leaching fraction LF can be obtained by solving the following cubic equation:
where Q, D and W are calculated from the coefficients of the cubic equation. Once the value of LF is known, values for actual crop yield and deep percolation follow from equations (A1)–(A5). This simplified model was found to be an excellent approximation to the original model given by equations (A1)–(A5). The main advantage is that it does not require any iteration to solve for LF and the other dependent variables.
Appendix B:: Canal Model
 The canal model performs monthly water and salt balances for the main irrigation canals in the District, which were discretized into a number of reaches. Water and salt are routed through the canals by accounting for all inflows and outflows in a reach. Ignoring storage at the monthly timescale, the canal reach water balance is
where Qmdpt is canal flow at the midpoint of the reach, Qin is inflow at the upstream end of the reach, Qsource is the net of groundwater pumping into the reach and water diversions from the reach, Qleak is canal leakage or seepage through the canal bottom, and Qout is outflow at the downstream end of the reach. Canal seepage is described by the Darcy equation,
where Kv is vertical conductivity of the canal bed material, Δz is thickness of the canal bed material, h is stage in the reach, and W and L are width and length of the reach. Finally, stage and discharge are related by the following approximation to Mannings equation [Addams, 2005]:
where b is a coefficient, which depends on the slope and roughness of the canal reach. As discussed in the main text, the canal model is initially run in “upstream” mode, i.e., starting from the downstream end of the canals and moving upstream toward the reservoir, in order to calculate the reach-by-reach leakage terms and finally the water demand from Oviachic reservoir. Therefore in “upstream” mode the model finds the required inflow into the reach to satisfy the known outflow, given groundwater pumping and water diversion rates for the reach (Qsource), and accounting for leakage losses along the reach. Combining equations (B1)–(B3), we obtain in “upstream” mode,
Stage h in the reach is readily computed from this quadratic equation, which is used to calculate Qleak with equation (B2) and Qin = Qout + Qleak − Qsource. The canal model is then solved in “downstream” mode to calculate canal water salinities for each reach in the canal. In this case, the calculation starts at the upstream end of the canals, where the salinity is determined by the salinity of reservoir water, and it moves downstream by assuming complete mixing of waters of different salinities within each reach,
where ECout is salinity of water at the downstream end of the reach and of canal diversions within the reach, ECin is water salinity at the upstream end of the reach, Qgw is groundwater pumping into the reach, and ECgw is groundwater salinity. The two main outputs from the canal model are thus the monthly amounts of reach-by-reach canal leakage to groundwater and the monthly salinities of the reach-by-reach canal diversions. The former is included as recharge in the regional groundwater model to calculate new water table depths and aquifer heads. The latter is used to determine irrigation water salinity, which is input into the agronomic model (Appendix A) to determine crop yield as a function of salinity stress.
Appendix C:: Analytically Derived Elements of the Jacobian
 The derivatives of reservoir storage with respect to releases and spills (Table 4) can be obtained analytically. The monthly water balance for reservoir k in equation (12) is written as
with Ai,k = akSi −i = t + nt(y − 1). Sequential application of the chain rule yields for the derivative of reservoir storage with respect to reservoir release,
where the coefficient depends on the connectivity of the reservoir system. For k1 = 1…3 corresponding to storages in (1) Angostura, (2) Novillo, and (3) Oviachic, and k2 = 1…3 corresponding to (1) release from Angostura to Novillo, (2) release from Angostura to mining and urban users, and (3) release from Novillo to Oviachic, we get the following 3 × 3 connectivity matrix [Labadie, 2004],
The derivatives of storage with respect to spills take exactly the same form as in equation (C2) with k2 = 1…3 now corresponding to spills from the three reservoirs, and with the coefficient matrix equal to
 Finally, derivatives of the objective function with respect to spills, equation (6), are constant and equal to −α.
 We gratefully acknowledge data contributions from the Yaqui Irrigation District and from the CNA in Mexico. We also appreciate valuable insights and data contributions from I. Ortiz-Monasterio. We thank Michael Saunders for providing us with the SNOPT optimization code and giving valuable advice on its use. We are most grateful to the David and Lucile Packard Foundation and the UPS Foundation for their generous support of this research. Constructive comments by the associate editor, two anonymous reviewers, and Eric Reichard have improved an earlier version of this manuscript.