Introduction

Agricultural irrigation accounts for ~70% of global water withdrawals and contributes to 40% of the world’s food production, particularly for rice and wheat, resulting in cereal yields 1.66 times higher than those of rainfed agriculture. However, this comes with substantial burdens on groundwater tables1,2 and other environmental footprints3,4,5. Groundwater, crucial for irrigated agriculture, supplies ~40% of the world’s irrigation6. Yet, groundwater depletion (GWD) is prevalent in many key agricultural regions globally, characterized by high blue water use and unsustainable groundwater practices4, such as in the North China Plain7,8, Northwest India9, and California’s Central Valley10. These irrigated regions also experience substantial increases in fertilizer surplus5,11, greenhouse gas (GHG) emissions12,13 and grey water footprints14, alongside lower nitrogen use efficiency (NUE)15,16 and irrigation water productivity (IWP)14,17. While irrigation has greatly boosted crop production, the existing crop patterns have considerable adverse effects on the environment and groundwater levels.

Most recently, co-benefits of several sustainable development goals (SDGs), such as grain production (SDG 2: Zero hunger), water use (SDG 6: Clean water and sanitation) and climate mitigation (SDG 13: Climate action), have gained new momentum from the urgent call for action by all countries. Improving these co-benefits is of considerable urgency given the increasing global demands for agricultural products18, sustainable water use19, and environment sustainability20,21. The nexus of food, resources, and environment exhibits strong spatial heterogeneity, and these relationships are dynamic, evolving with changes in both crop patterns and management practices. Biophysical benchmarks for ambitious land-sparing targets and associated externalities have been established22. Solution-oriented approaches, such as the spatial optimization of crops to inform policy solutions, have been employed to identify trade-offs and synergies across multiple dimensions23,24,25. However, how to provide co-benefits of food security, high resource use efficiency, and reduced negative externalities related not only to environmental footprints but also to the groundwater table in GWD regions remains unknown.

Furthermore, spatially explicit evaluation of groundwater table variations resulting from sustainable irrigation practices remains challenging due to the lack of monitoring infrastructure and the absence of sustainable groundwater use experiments across the entire GWD region. While the benefits of crop redistribution have been demonstrated on individual or multi-dimensions at a 10 km scale25,26 or on coarser district, prefecture, or provincial scales23, it remains unclear how optimized crop redistribution tailored to local conditions can balance trade-offs and synergies among food supply, irrigation water demand, environmental footprints, and groundwater tables at a finer 1 km scale, particularly in GWD regions.

In the 1980s, agricultural scientists launched the Huang-Huai-Hai (HHH) Innovation Campaign of agricultural science and technology to reclaim saline-alkali land in the HHH Plain of China (Supplementary Fig. 1a). This campaign successfully enhanced grain production capacity, transforming the HHH region into China’s granary, contributing 80.7% of the national wheat production by 202127,28. However, this increase in grain production has led to several challenges, including the unsustainable use of fertilizers and groundwater, and considerable negative environmental impacts5,8. Wheat, the primary water-consuming crop in the HHH region, has made it one of the largest GWD regions in the world2,29,30 (Supplementary Fig. 1b–f). Concurrently, unsustainable intensive agriculture has resulted in excessive nitrogen (N) application and higher environmental footprints5,16,31. The Chinese government has introduced policies aimed at recovering groundwater levels, redistributing crops with higher irrigation-water demand, and reducing agricultural carbon emissions. Nonetheless, there is an urgent need for spatially targeted and fine-scale technical guidance tailored to local conditions.

To address this need, we develop a framework of gridded crop redistribution based on multi-sources data at a 1 km scale in a typical GWD region, aiming for synergistic effects across multiple dimensions—maximizing food production, minimizing resource demands, and reducing environmental impacts, using wheat redistribution in the HHH region of China as an example (Supplementary Fig. 2). We predict groundwater depth based on cumulative net irrigation-water demands and climatic variables following wheat redistribution. Utilizing multiple models and methods, we optimize wheat distribution at a spatial resolution of 1 km and explore three scenarios: (i) minimizing irrigation water demand for wheat without compromising production (S1), (ii) maximizing wheat production while ensuring sustainable groundwater use (S2), and (iii) maximizing both wheat production and NUE while ensuring sustainable groundwater use (S3) (See Methods). Our findings provide effective solutions for wheat redistribution to achieve multiple goals related to food, resources, and environment, supporting spatially targeted and fine-scale technical guidance tailored to local conditions in typical irrigated agriculture regions.

Results and discussion

The multi-benefits of wheat redistribution for food production, resource use and environmental footprints under the three scenarios

We compared the multi-benefits of wheat redistribution for food production, resource use and environmental impacts across the three scenarios with the current level (Figs. 1 and 2a, b and Supplementary Fig. 1g–i). After wheat redistributing under the three scenarios in the HHH region, resource efficiencies—land (yield), water (IWP), and fertilizer (NUE)—are projected to increase by 1–12% for yield (7134.08 kg ha−1 at the current level), 4–21% for IWP (3.67 kg m−3 at the current level), and 2–11% for NUE (47.76% at the current level), respectively. Total grey water footprint (224.76 km3 at the current level) and total GHG emissions (22.35 × 109 kg CO2eq at the current level) are anticipated to decrease by 21–37% and 18–35%, respectively (Fig. 1a). The redistributions also yield savings in wheat-harvested area (16.08 × 106 ha at the current level) by 10–24%, N application (35.28 × 108 kg at the current level) by 8–28%, and blue water (31.22 km3 at the current level) by 16–25%, without any wheat production loss, or with 17–18% production loss, according to different scenarios compared to the current wheat distribution (Fig. 1a).

Fig. 1: Multi-benefits of wheat redistribution.
figure 1

Relative changes in wheat production, resource use, and environmental impacts due to wheat redistribution under three scenarios in the a HHH and b GWD regions. The red dotted circle represents the current level. Bars in dark, medium, and light colors represent the relative percentage changes of the indicators compared to the current level under the scenarios of minimizing irrigation water demand for wheat without compromising production (S1), maximizing wheat production while ensuring sustainable groundwater use (S2), and maximizing both wheat production and NUE while ensuring sustainable groundwater use (S3), respectively. Details on the quantification of each indicator are provided in “Methods”.

Fig. 2: Changes in production patterns after wheat redistribution under different scenarios.
figure 2

Patterns of a wheat-harvested area and b production shown on a 1 km × 1 km grid, relative to the current level under the three scenarios (S1–S3), as well as changes in (c) harvested area and d production in the increased and decreased areas with average yields in both of the HHH and GWD regions under three scenarios. The blue circle and red diamond represent the average wheat yields in the HHH (Yield_HHH) and GWD (Yield_GWD) regions, respectively. Blue and red bars indicate the standard errors of the average yields. Columns in pink, yellow, light blue and dark blue colors represent the four wheat zones: spring wheat zones in the north (I), winter wheat zones in the north (II), winter wheat zones in the Huang-Huai region (III), and winter wheat zones in the mid and lower reaches of the Yellow River (IV).

The current wheat distribution in the HHH region does not represent the most efficient use in land (Supplementary Fig. 1g), water (Supplementary Fig. 1h) and N fertilizer (Supplementary Fig. 1i) in the HHH region. The scenario aimed at minimizing irrigation water demand (S1, shown as dark color bars in Fig. 1a) could result in savings of 10% in harvested area, 16% in blue water use and 8% N application, as well as a 21% increase of IWP compared with the current distribution, all without any loss in wheat production, changes in planting habit, or improvements in management practices. If we exclusively utilize sustainable groundwater for wheat irrigation in the GWD region (S2, depicted as mid-color bars in Fig. 1b), we could conserve 39% of blue water in this area. However, this scenario would result in a 17% reduction in wheat production in the HHH region (S2, illustrated as mid-color bars in Fig. 1a). If we additionally consider the objective of maximizing NUE in the GWD region, grey water use and GHG emissions will decrease by 37% and 35% respectively in the entire HHH region (S3, depicted as light color bars in Fig. 1a). Meanwhile, for the GWD region, these potentials will decrease by 72% for grey water use and 68% for GHG emissions (S3, shown as light color bars in Fig. 1b).

Wheat harvested area in the regions with lower efficiencies of land, water, and N use (lower yield, IWP, and NUE as shown in Supplementary Fig. 1g–i) will decrease under all three scenarios (Fig. 2a and Supplementary Table 1). To ensure the maximum production under each scenario, wheat areas especially in the non-GWD region with higher yield (Supplementary Fig. 1g), IWP (Supplementary Fig. 1h), and NUE (Supplementary Fig. 1i) will increase after optimization (Fig. 2a, b).

The spatial pattern changes of wheat redistribution (Fig. 2) and their impacts on resource demands (Fig. 3) and environmental footprints (Fig. 4) under the three scenarios vary greatly. The results of S1 would obtain the highest average IWP in the HHH region, removing the area with IWP less than 2.7 kg m-3 (Fig. 3c). The average yield (Supplementary Fig. 1g), IWP (Supplementary Fig. 1h) and NUE (Supplementary Fig. 1i) in the increased harvested areas (red color of changes in the three scenarios of Fig. 2a, mainly in the Zones III and IV) were 2418 kg ha−1 (Fig. 2c), 1.86 kg m−3 (Fig. 3c) and 15.03% (Fig. 3d) higher than those in decreased harvested area of the HHH region (mainly in the Zones II and III), respectively. It would also reduce grey water and GHG emissions in the increased harvested area by 2069 m3 ha−1 (Fig. 4c) and 140 kg CO2 eq ha−1 (Fig. 4d), respectively, compared to the average values in the decreased harvested area.

Fig. 3: Changes in resource use patterns after wheat redistribution under different scenarios.
figure 3

The patterns of a blue water demand, and b N input shown on a 1 km × 1 km grid, relative to the current level under the three scenarios (S1–S3), as well as comparisons of c blue water demand with average IWP and d N input with average NUE under the three scenarios. The blue circle and red diamond represent the average IWP or NUE in the HHH (IWP_HHH or NUE_HHH) and GWD (IWP_GWD or NUE_GWD) regions, respectively. The blue and red bars indicate the standard errors of the average IWP or NUE. The blue and red bars are the standard errors of the IWP or NUE in the HHH and GWD regions, respectively. Columns in pink, yellow, light blue and dark blue represent the four wheat zones: spring wheat zones in the north (I), winter wheat zones in the north (II), winter wheat zones in the Huang-Huai region (III), and winter wheat zones in the mid and lower reaches of the Yellow River (IV).

Fig. 4: Changes in environmental impact patterns after wheat redistribution under different scenarios.
figure 4

The patterns of a grey water and b GHG emission shown on a 1 km × 1 km grid, relative to the current level under the three scenarios (S1–S3), as well as c the comparisons of grey water and d GHG emission in the increased and decreased wheat harvested areas under the three scenarios. The blue circle and red diamond represent the average grey water or GHG emissions per unit area in the HHH (Grey water or GHG per unit area_HHH) and GWD (Grey water or GHG per unit area _GWD) regions, respectively. The blue and red bars indicate the standard errors of the average grey water or GHG emissions per unit area. Columns in pink, yellow, light blue and dark blue represent the four wheat zones: spring wheat zones in the north (I), winter wheat zones in the north (II), winter wheat zones in the Huang-Huai region (III), and winter wheat zones in the mid and lower reaches of the Yellow River (IV).

Under S2, the increased harvested areas (indicated in red color in Fig. 2a) were located exclusively in regions with a lower water balance index (WBI) (≤1) and relatively higher IWP (Fig. 5a and Supplementary Fig. 1h), primarily outside the GWD region. The decrease in proportions of wheat harvested area and production in the entire HHH region are both 17% (Change in S2 of Fig. 2a, b). However, the wheat redistribution under S2 would reduce the harvested area in the GWD region by 37% (more than double the reduction under S1) (Supplementary Table 1 and Fig. 1). As a result, blue water use in the GWD region would decrease by 39% compared to the current level, ensuring the sustainable use of groundwater in this area (Supplementary Table 1 and Fig. 1). The decreased harvested area (blue color in Change in S2 of Fig. 2a) was mainly located in the GWD region with non-renewable groundwater (WBI > 1, S2 in Fig. 5a).

Fig. 5: Changes in groundwater depths after wheat redistribution under different scenarios.
figure 5

The patterns of a WBI in the HHH region, b trends of groundwater depths with irrigation water requirements in both the NCP (red color) and GWD (blue color) regions, c groundwater depths changes relative to the current level, and d changes in groundwater depths in the NCP, GWD, I, II, III, and IV zones with the proportion of WBI greater than 1 under the three scenarios (S1–S3).

Under S3, the areas with lower NUE, particularly in the GWD region (Supplementary Fig. 1d, i), were further reduced (Fig. 2a). Compared to S2, a 1% additional loss in production result in 7%, 9% and 5% reductions in land use, N input, and blue water footprint, respectively. Additionally, it leads to lower environmental footprints in the HHH region, including a 15% reduction in grey water footprint and 14% reduction in GHG emissions (Supplementary Table 1).

The implications of wheat redistribution on groundwater depths in the GWD region

In the current wheat distribution, areas with a WBI higher than one (shown in yellow in Fig. 5a) account for 41% of the GWD region, indicating unsustainable use of groundwater for irrigation in these areas. Because a large area with higher IWP overlaps with areas of unsustainable irrigation water use, 35% of the unsustainable area (WBI > 1) remains in the GWD under S1, which aims to minimize irrigation water demand without reducing wheat production in the HHH region (Fig. 5a). In contrast, under both scenarios of S2 and S3, the WBI is less than one in each 1 km × 1 km grid of the wheat-redistribution patterns in the GWD region. This indicates that groundwater could be used sustainably under these two scenarios (Fig. 5a). After optimizing wheat distribution, the average WBI in the GWD region would decrease from the current level of 1.10 to 0.78, 0.58, and 0.43 under S1, S2, and S3, respectively (Fig. 5a).

The rate of groundwater depths decrease in the GWD regions (−1.07 m km−3, shown by the blue points and line in Fig. 5b and Supplementary Fig. 1d) was more than three times that of the entire North China Plain (NCP, −0.31 m km−3, shown by the red points and line in Fig. 5b and Supplementary Fig. 1c) from 2006 to 2016 (during seven wheat growing-periods: 2005–2006, 2006–2007, 2007–2008, 2008–2009, 2009–2010, 2010–2011, and 2015–2016), correlating with the increase in cumulative irrigation water demands for wheat. After optimizing wheat redistributions under the three scenarios, the average groundwater depths in the GWD region will recover by 4.39 m, 9.38 m, and 9.03 m in 2030 compared to the current level, respectively (Fig. 5c, d and Supplementary Table 1). The recovery of groundwater depths under both sustainable groundwater use scenarios of S2 and S3 is primarily attributed to the reduction in areas with higher WBI ( > 1) and lower yields. Under S2, we can achieve sustainable use of irrigated water (Fig. 5a) and higher NUE (Fig. 3d) in the GWD region. Under S3, we can further reduce the wheat harvested area in regions with lower NUE (Fig. 2a and Supplementary Fig. 1i), and increase groundwater depth in the GWD region (Fig. 5c), especially in zones II and III compared to S2 (Fig. 5d).

Maximizing synergies through optimized wheat redistribution

The multi-benefits of food security, high-efficiency resource utilization, environmental mitigation, and sustainable groundwater management are essential for promoting the sustainable development of irrigated agriculture, particularly in the GWD region. Our analysis indicates that the wheat redistribution can maintain production levels without loss while simultaneously minimizing irrigation water demand, thereby assisting in mitigating the impacts of international situations such as food security concerns amidst conflicts. It can also facilitate sustainable groundwater use in the GWD region with an acceptable production loss of 17%, meeting ~70% of China’s wheat demand in 2030, considering the population is projected at ~1.46 billion32. In addition, in the coming years, production losses could potentially be mitigated through irrigation water withdrawals from non-local water resources, such as the South-to-North Water Diversion project30. Moreover, taking into account the trade-offs between IWP and NUE can lead to even greater water and N input savings, with an 18% production loss (meeting 69% of China’s wheat demand) while maintaining sustainable groundwater use. Due to the decrease in the wheat harvested area under the three scenarios, the recovery of groundwater depth through wheat redistribution in the GWD region can be increased by 4.39 m without any loss in wheat production (Fig. 5d and Supplementary Table 1). If we prioritize sustainable groundwater use, we can potentially achieve a recovery of over 9 m in groundwater depths within the GWD region. Additionally, more sustainable scenarios can be explored in the future, such as closing the yield gap33 and increasing NUE34.

Our findings align with the demand to decrease the distribution of crops with higher water demand as part of China’s policy to reduce groundwater use since 201435. Additionally, our study provides a spatially explicit wheat redistribution strategy, identifying where and to what extent production, resource utilization, and environmental outcomes will be affected and improved. Our approach demonstrates superior multi-benefits in maintaining production levels, reducing water demand, mitigating GHG emissions, and restoring groundwater depth compared to other measures, such as crop fallowing36, reducing harvested areas37, and eliminating N application38.

Wheat redistribution also yields additional benefits such as labor savings, enhanced resilience of climate extremes, increased agricultural biodiversity, reduced economic costs, and improved farmer adaption. In the context of this study, the reduction in wheat harvested area can support sustainable farming strategies, such as crop planting based on available water resources, particularly in GWD regions, which are pursued by the Chinese government and align with SDGs. While optimizing the spatial distribution of global croplands considering rainfed potential yields can reduce environmental impacts, it may overlook the sustainable irrigation benefits for grain yield39. Our analysis provides a comprehensive assessment of the four-way trade-offs between food security, resource conservation, environmental impact reduction, and groundwater table recovery, ultimately fostering sustainable agriculture in the GWD region.

The costs and policies associated with the practical implementation of wheat redistribution

We can maximize synergies through optimized wheat redistribution without altering local planting, irrigation, and fertilizer application practices (constraints (2), (6), and (7) in the wheat allocation model, as described in the ‘Methods’ section), demonstrating the feasibility of wheat redistribution. However, the reduction in wheat production and the increase in low-value or low-yield crops may result in decreased incomes for farmers post-redistribution. Although optimizing crop selection to reduce blue water use and N fertilizer can lower crop planting costs, there may be additional expenses associated with adjusting supply chains and transportation in the agricultural market, as well as learning new crop-switching technologies and knowledge. In addition, cultural barriers and dietary preferences could pose limitations on the practicality of implementing wheat redistribution25. Moreover, the redistribution of wheat may put some smallholder farmers at risk of losing their livelihoods if there is a considerable reduction in their wheat harvested areas.

To ensure the feasibility of the wheat redistribution, the government should establish a pricing mechanism for irrigation water costs and provide subsidies to compensate farmers for any income loss, taking local conditions into account. Additionally, the government should scientifically guide the adjustment of wheat planting systems and fallow practices. For example, a previous study estimated that saving 30% to 32% of blue water would require subsidizing farmers an additional 5% of their current income26. Innovative approaches should be explored to establish a mechanism linking irrigation water costs or farmer subsidies with groundwater table recovery, guiding farmers to adjust their planting systems accordingly. Our analysis offers a spatially explicit guide for the government to scientifically allocate agricultural subsidy funding in such GWD regions.

Uncertainties and limitations

We used the spatial production allocation model (SPAM) to allocate county-level statistical data on wheat yield and harvested area to gridded data at a 1 km × 1 km resolution. Previous studies have tested the model’s uncertainty and found that the results depend on the quality and accuracy of the underlying statistics40. Our estimates of wheat yield and harvested area using SPAM showed better agreement with county-level statistical data than the SPAM2010 data (Supplementary Fig. 3a, b). Additionally, we validated our wheat harvested area using the investigation data from well-facilitated farmland41, the accuracy of our results (90.68%) was slightly higher than that of wheat area data produced by remote sensing42 (87.71%) (Supplementary Fig. 3c, d).

In addition, we performed uncertainty analyses by varying the constraints of wheat production and blue water use across different scenarios, and then identified the resulting changes in food production, resource use, and environmental impacts (Supplementary Table 2). In S1, we adjusted the constraints on wheat production to allow reductions of less than 5% and 10% for uncertainties 1 and 2, and increase of 5%, 10% for uncertainties 3 and 4, respectively. In both S2 and S3, we modified the proportions of renewable blue water used for wheat irrigation and the constraint ranges of renewable blue water. The uncertainty analysis showed that, regardless of the production-constraint scenarios, the resource efficiencies of land, irrigation water, and N input would increase (Supplementary Table 3). Although there are some variations in the benefits related to production, resources, and environment, the overall trends remain consistent under different scenarios of wheat redistribution.

Another source of uncertainty involves how the redistribution of other crops following wheat redistribution impacts the overall environmental changes in the HHH region. This region in China is a crucial grain production area, cultivating a diverse range of crops including wheat, maize, rice, soybean, groundnut, cotton, and rapeseed (Supplementary Table 4, Supplementary Note 1). The environmental impacts, considering the substitution between wheat and other crops, indicate that blue water use would decrease by 13.37–16.94% for the water-saving objective. Moreover, N input, total grey water, and total GHG emissions would be reduced by 12.71–19.71%, 12.71–19.71%, and 13.04–17.92%, respectively, under different scenarios (Supplementary Table 5). Crop redistribution also offers notable potential for improvement in the GWD region. By aiming for water-saving objectives, reductions of 14.18–21.56% in the blue water footprint can be achieved, while pursuing fertilizer-saving objectives can lead to decreases of 13.10–28.64% in both N fertilizer application and grey water footprint, along with 14.73–27.43% in GHG emission, depending on various scenarios. The trends in improvement potential under various scenarios align closely with the results when only considering the environmental footprint change of wheat, particularly in the GWD region. However, the absolute reduction values would vary depending on the objectives and crop substitution choices.

Furthermore, the calculation of wheat’s blue water use in this study relied on a dynamic water balance model. As highlighted in ref. 43, the uncertainty of crop water use within this model primarily stems from three key parameters: reference evapotranspiration (ET0), crop coefficients (Kc), and crop calendars. To address this uncertainty, we conducted an analysis by comparing our results and these three parameters with existing datasets44,45 from similar periods. Our findings on wheat’s blue water use are more localized and less uncertain, falling within the range of values from the two existing datasets. This improvement is attributed to the utilization of finer timescale meteorological data, adjusted Kc values tailored to specific climatic and growing conditions, and observed crop calendar data (Supplementary Fig. 4 and Supplementary Table 6).

In addition to quantifying uncertainty, it is important to acknowledge the limitations associated with the scenarios and models utilized in this research. First, our study does not encompass scenarios involving potential increases in wheat yield resulting from technological advancements such as variety change, alterations in available water from non-local resources (e.g. South-to-North Water Diversion)30, anticipated climate change in the future, improvement in irrigation technology (e.g. micro-sprinkling irrigation46, surface drip irrigation47, and return flow from irrigation48), and optimization of N input49. Furthermore, the maximum of crop irrigated water demand is determined using a water balance model without accounting for irrigation losses. However, despite these limitations, our findings offer valuable spatially explicit guidance at the grid-scale for the redistribution of high water-demand crops, which is crucial for practical implementation in the typical GWD region.

Conclusions

We propose a crop redistribution scheme aimed at achieving maximum grain production, sustainable groundwater use, and efficient water and fertilizer utilization simultaneously. Our scheme offers a spatially explicit solution for implementing spatial planning at different administrative levels, sustainable food production systems achieving groundwater recovery in a GWD region. By considering multiple dimensions of the aforementioned objectives synergistically throughout the crop redistribution process, we leverage locally available technologies and agricultural practices while integrating concerns of food security, sustainable groundwater use, and environmental impacts. This framework serves as a valuable tool for enhancing agricultural sustainability, achieving multiple goals of maximizing food production while minimizing resource demands and environmental footprints. When applied to local agricultural management, it bridges the gap between policy and science, providing a nexus for informed decision-making. Our integrated and transdisciplinary approach offers insights for food system management, particularly in implementing spatially tailored solutions for irrigated agriculture regions facing groundwater depletion.

Methods

We conducted a series of spatial optimizations for wheat redistribution to evaluate its potential in mitigating groundwater depletion while simultaneously enhancing food security, conserving resources, and reducing environmental footprint. Various crop parameters, including wheat yield and harvested area, resource inputs such as blue water and N input, as well as externalities of grey water and GHG emissions were incorporated into a linear optimization algorithm across three scenarios. These scenarios aimed to minimize irrigation water demand without compromising wheat production (S1), maximize wheat production while ensuring sustainable groundwater use (S2), and optimize wheat production and NUE while maintaining sustainable groundwater practices (S3) (Supplementary Fig. 2). The optimization models were implemented using the General Algebraic Modeling System (GAMS) software and executed at a spatial resolution of 1 km × 1 km grid scale. The results of the optimization were expressed as a percentage of wheat harvested area. Following the redistribution of wheat, we quantified the externalities associated with wheat production under different scenarios and compared them across four dimensions: wheat production, water and N resource utilization, environmental impacts, and groundwater depth.

Allocation of wheat yield and harvested area

We used the SPAM, an entropy-based approach, to downscale the crop yield and harvested area from county-level statistics to 1 km × 1 km resolution pixels50. This approach operates under the assumption that farmers exhibit risk aversion and aim to maximize profits, thereby enabling the calculation of gridded revenue based on factors such as market accessibility linked to rural population density and the potential yields of wheat under irrigated and rainfed conditions derived from Global Agro-Ecological Zones (GAEZ). The SPAM methodology has been effectively applied in various regions including Brazil51 and sub-Saharan Africa52, as well as on a global scale50,53. Datasets produced by this model at a 10 km × 10 km grid resolution (SPAM2000, SPAM2005, and SPAM2010) have been extensively utilized in crop redistribution research26,28.

The detailed methods of SPAM have been extensively described in the previous refs. 50,53. Here, we provide a brief overview of the main three submodules within SPAM: disaggregation of crop statistics, optimization utilizing the cross-entropy module, and allocation based on the optimization results.

First, we disaggregated wheat area and yield into two farming systems (l) (i.e., irrigated and rainfed) based on the yield and harvested area data from the Ministry of Agriculture and Rural Affairs of China at the county-scale (https://www.moa.gov.cn/). This disaggregation process was conducted using the following formulas:

$${{HA}}_{{cl}=I}={{HA}}_{c}{{Perc}}_{{cl}=I}$$
(1)
$${{HA}}_{{cl}=R}={{HA}}_{c}\left(1-{{Perc}}_{{cl}=I}\right)$$
(2)
$${Y}_{{cl}=I}=\propto {Y}_{{cl}=R}$$
(3)
$${Y}_{{cl}=I}=\frac{{Y}_{{cj}}}{\left(1-{{Perc}}_{{cl}=I}\right)/\propto +{{Perc}}_{{cl}=I}}$$
(4)

where HAcl, Perccl, and Ycl are the harvested area, harvested area percentage, and yield of the wheat farming system l in county c. HAcl=I and HAcl=R represent the wheat harvested area under irrigated (l = I) and rainfed (l = R) farming systems in county c, respectively, while Perccl=I indicates the ratio of irrigated wheat area to the total wheat harvested area in the same county. Ycl=I and Ycl=R denote the wheat yield under these farming systems in county c. We calculated Perccl=I by determining the ratio of irrigated area to the total wheat harvested area in each county, given the substantial proportion (~ 82%) of irrigated wheat in the HHH region54. HAc represents the harvested area in county c, and is the ratio of irrigated yield to rainfed yield of wheat (Supplementary Table 7), obtained from data sourced from county-level statistics, farmer surveys, and expert visits55. Ycj denotes the wheat yield of county c.

The subsequent step entails employing the cross-entropy module to distribute the yield and harvested area from the county level to each 1 km × 1 km grid, which contributes to the core component of SPAM. This process aims to minimize the difference between the pre-allocated shares of physical area (pil) and the allocated shares of physical area (sil) for farming system l at grid i. We used cross-entropy to quantify the difference, which was calculated as:

$${{En}}_{{il}}={\sum}_{{il}}{s}_{{il}}{{{{\mathrm{ln}}}}}{s}_{{il}}-{\sum}_{{il}}{s}_{{il}}{{{{\mathrm{ln}}}}}{p}_{{il}}$$
(5)

where Enil represents the cross-entropy, defined as the log function of probability. Additionally, a series of constraints must be considered in the optimization process. (1) The sum of allocated physical area shares (sil) across all farming systems within a grid cell should equal 1. (2) The sum of allocated physical area across all farming systems within a grid cell should not exceed the actual cropland area within the same grid cell. (3) The physical area allocated to each farming system within a grid cell should not exceed the suitable area for that specific farming system within the same grid. (4) The sum of physical area across all farming systems within a county unit should equal the ratio of actual harvested area to cropping intensity within the corresponding county unit. (5) The allocated physical area under the irrigated farming system within a grid cell should not exceed the area equipped for irrigation within the same grid cell.

Specifically, actual cropland area data and cropping intensity were obtained from the Resource and Environment Science and Data Center at the Chinese Academy of Sciences (RESDC) (https://www.resdc.cn/). Suitable area data for wheat was simulated using the GAEZ model at a 1 km × 1 km grid scale (Supplementary Fig. 5a, b). The irrigated area was sourced from the Global Map of Irrigation Areas v5.0 (GMIAv5.0), expressed as the percentage of the total area at a resolution of 5 arcmin56. This data was resampled to achieve a 1 km resolution. The sil represent probabilities between 0 and 1, while pil indicates the decision to produce a particular crop under a specific farming system, typically dependent on economic and biological factors such as market access (represented by rural population density) and potential yield (calculated by GAEZ model). Detailed calculation methods for pil can be found in previous research53.

The final step involves allocating the wheat harvested area and yield for each grid cell according to the optimization results for each farming system. The allocated wheat harvested area was calculated as follows:

$${{AllocHA}}_{{il}}={s}_{{il}}{{HA}}_{{cl}}$$
(6)

where AllocHAil is the allocated wheat harvested area in grid cell i for the farming system l.

For the allocated wheat yield, we first calculated an average potential yield within the county unit (\(\overline{{{PotY}}_{{cl}}}\)) using the allocated harvested area (AllocHAil) as the weight. The allocated wheat yield at the grid cell for each farming system (AllocYil) was then calculated as follows:

$${{AllocY}}_{{il}}=\frac{{{PotY}}_{{il}}{Y}_{{cl}}}{\overline{{{PotY}}_{{cl}}}}$$
(7)
$$\overline{{{PotY}}_{{cl}}}=\frac{{\sum}_{i\in c}{{PotY}}_{{il}}{{AllocHA}}_{{il}}}{{\sum}_{i\in c}{{AllocHA}}_{{il}}}$$
(8)

where PotYil is the potential yield of wheat in grid cell i for the farming system l calculated using the GAEZ model (Supplementary Fig. 5c for irrigated wheat and 5d for rainfed wheat).

We estimated the suitable area and potential yield for wheat using the GAEZ model, which is based on the AEZ approach developed by FAO and IIASA57. This method employs simple yet robust crop models and standardized crop-modeling and environmental matching procedures to identify crop-specific limitations related to climate, soil, and terrain under varying agricultural input and management conditions. The input data for the GAEZ model included meteorological, soil, terrain, and land use/cover data. Meteorological data, obtained from the China Meteorological Data Service Centre (https://data.cma.cn/), covered parameters such as the monthly minimum and maximum air temperature, precipitation, relative humidity, wind speed at 10 m height (converted to 2 m height), and sunshine hours from 2011 to 2014. These data were interpolated to 1 km resolution using ANUSPLIN software58,59, based on the Digital Elevation Model (DEM). Soil data, including soil type, effective soil depth, and soil water-holding capacity, were sourced from Harmonized World Soil Database v1.2 (HWSD v1.2) (https://www.fao.org/). Terrain elevation data were obtained from the Shuttle Radar Topography Mission (SRTM) C-band, the first publicly available near-global, high-resolution raster DEM with a 90 m spatial resolution (http://srtm.csi.cgiar.org/SELECTION/inputCoord.asp). Land use/cover data were sourced from RESDC and categorized into cropland, woodland, grassland, water body, built-up and unused land. For detailed calculation methods can be referred to the GAEZ model documentation60.

Quantifying the externalities of wheat production

Blue water, IWP, and grey water

We estimated the consumptive freshwater use of wheat production including blue water and grey water, following the water footprint calculation framework14,61. Specifically, blue consumptive water was calculated as the difference between rainwater and water demand, given potential evapotranspiration, based on a soil dynamic water balance model with daily time steps. First, we calculated daily reference evapotranspiration (ET0, mm d−1) using the Penman-Monteith approach and meteorological data. The long-term daily meteorological data, including temperature, precipitation, wind speed, relative humidity, atmospheric pressure, and sunshine hours, were obtained from the China Meteorological Data Service Centre (https://data.cma.cn/). Then, the actual evapotranspiration (ETa) of wheat on day t was calculated according to the Eq. (9)3,62:

$${{ET}}_{a,t}={k}_{c,t}\times {k}_{s,t}\times {{ET}}_{0,t}$$
(9)

where kc,t is the crop coefficient of wheat on day t, ks,t is the dimensionless transpiration reduction factor of wheat on day t, and ET0,t is reference evapotranspiration (ET0, mm d−1) on day t. The kc,t varies in time, and as a function of the crop growth stage. kc,t of wheat in different growth stages were obtained from previous work3, and the growth stages of wheat were obtained from the China Meteorological Data Service Centre. The ks,t factor depends on available soil water, and is described as a function of the soil water content in the root zone (S), including the maximum and actual water content in the root zone. For irrigated wheat, ks,t was assumed to be 1 to represent a condition of no water stress. For the rainfed wheat, it was calculated as follows:

$${K}_{s,t}=\left\{\begin{array}{cc}\frac{{S}_{t}}{\left(1-p\right){S}_{\max }}, & {S}_{t} \, < \, \left(1-p\right){S}_{\max }\\ 1, & {otherwise}\end{array}\right.$$
(10)

where St is the actual available soil moisture at time t (mm); Smax is the maximum value of available soil moisture in the root zone, and p is the fraction of Smax that a crop can uptake from the rooting zone without suffering water stress, as calculated in a previous study3. The total available water capacity of soil at a 5 arcmin resolution was taken from ISRIC-WISE63. Finally, we calculated the rainfed ETa,t,rainfed and irrigated ETa,t,irrigated for each day t. The total blue water (TBWU, m3 y-1) of wheat was then calculated following a published method25 based on the blue water use (BWU, mm y-1, Supplementary Fig. 6a) throughout the entire wheat growing season:

$${BWU}={\sum }_{t=1}^{d}\left({{ET}}_{a,t,{irrigated}}-{{ET}}_{a,t,{rainfed}}\right)$$
(11)
$${TBWU}={BWU}\times {HA}\times 10$$
(12)

where d is the length of wheat growing season, HA is the harvested area of wheat, and 10 is the conversion factor for evapotranspiration to volume (m3 ha−1).

Furthermore, we used irrigation water productivity (IWP, in kg m−3) to represent water use efficiency (Supplementary Fig. 1h). IWP was calculated using the following equation64:

$${IWP}=\frac{{Production}}{{TBWU}}$$
(13)

where IWP is the irrigation water productivity of wheat, and Production is the total wheat production.

The grey water footprint (GWF) is calculated by quantifying the volume of water needed to assimilate the nutrients that reach ground or surface water (Supplementary Fig. 6b). Nutrient leaching or run-off from agricultural fields is a major cause of non-point source pollution. Here, we quantified only the grey water footprint of wheat caused by N use. The equation is as follows14:

$${GWF}=\frac{{N}_{{leach}}+{N}_{{run}-{off}}}{\left({C}_{\max }-{C}_{{net}}\right)}$$
(14)

where Nleach and Nrun-off represent N lost to the environmental system through leaching and run-off (kg N  ha−1), calculated as described in the following section on NUE. Cmax is the maximum allowable concentration of pollutants in water bodies, for which we used the standard of 10 mg L−1 (see ref. 65). For the natural concentration of N (Cnet), we assumed it to be 0, based on a previous study14.

NUE

A simple mass balance model was used to calculate the N use efficiency (NUE) and N surplus (Nsur)66,67. NUE is expressed as the ratio of N outputs (Ny) to N inputs (Ninput). Major Ninput to the cropland include N fertilizer application (Nfer, kg N ha−1), manure application (Nman, in kg N ha−1), biological fixation (Nfix, in kg N ha−1), atmospheric deposition (Ndep, in kg N ha−1), and irrigated N (Nirr, in kg N ha−1) (Supplementary Fig. 7a–c). The Noutput from cropland is the N removal at harvest, estimated by multiplying crop yield by N concentration:

$${NUE}=\frac{{N}_{y}}{{N}_{{fer}}+{N}_{{man}}+{N}_{{fix}}+{N}_{{dep}}+{N}_{{irr}}}\times 100 \%$$
(15)
$${N}_{y}=Y\times {N}_{{perc}}$$
(16)

where Y is the average yield of wheat (kg ha−1), and Nperc is the N content of wheat at harvest, assumed to be 0.0208 according to a previous study68. The Nfer data at the county scale were sourced from ref. 5 and resampled to obtain a 1 km resolution. The atmospheric deposition (Ndep) data were taken from ref. 69. Nfix is the N fixation rate in non-leguminous crops, assumed to be 15 kg N ha−1 y−1 for wheat70. Nirr is the irrigated N rate, assumed to be 8.1 N ha−1 based on a previous study49. The Nman was calculated using the following equation5:

$${N}_{{man}}={{Num}}_{k}+{N}_{{exc},k}+{N}_{{rec},k}+\frac{\left(1-{N}_{{vol},k}\right)}{{HA}}$$
(17)

where the Numk is the population (head) of species k (i.e., pig, sheep, goat, cattle, and poultry) at the year-end, Nexc,k is the excretion rate (kg head−1 y−1) of livestock species k, Nrec,k is the N recovery rate (%) of livestock species k, Nvol,k is the N volatilization rate (%) of livestock species k, and HA is the harvested area of wheat. Statistical data on the populations of pigs, sheep, goats, cattle, and poultry were gathered from the Ministry of Agriculture and Rural Affairs of China at the county scale (https://www.moa.gov.cn/) and resampled to 1 km resolution. The values for Nexc,k and Nrec,k were taken from complied survey data for China from previous research5. Manure loss before application to croplands was primarily due to the volatilization of ammonia gas (NH3). We assumed N volatilization rates of 36% for cattle, pigs, and poultry, and 28% for sheep, and goat, based on ref. 5.

The N surplus (Nsur) is defined as the difference between N input and N output, which can potentially degrade soil quality and contribute to non-point source pollution through leaching and run-off (Supplementary Fig. 7d). We calculated the Nsur using the following equation:

$${N}_{{sur}}={N}_{{fer}}+{N}_{{man}}+{N}_{{fix}}+{N}_{{dep}}+{N}_{{irr}}-{N}_{y}$$
(18)

The N leaching and runoff were further estimated based on the relationships between these indicators and N surplus, as developed in a previous study71. The specific non-linear functions for wheat were as follows:

$${N}_{{leaching}}=13.59\times \exp \left(0.009\times {N}_{{sur}}\right)$$
(19)
$${N}_{{runoff}}=8.69\times \exp \left(0.0077\times {N}_{{sur}}\right)$$
(20)

where Nleaching represents the N leaching of wheat, and Nrunoff represents the N runoff of wheat.

GHG emission

We calculated the GHG emission in the form of N2O from the process of agricultural management—specifically, the application of N through fertilizers and manure to wheat fields. The total N2O emissions due to N application to agricultural soils include both direct and indirect pathways.

To estimate the direct N2O emissions, we used a published non-linear model that describes the relationship between N2O emissions and Nsur71 (Supplementary Fig. 8a). The input data for the non-linear model was Nsur, computed as described previously. The direct N2O emissions (\({{N}_{2}O}_{{dir}}\)) were calculated using the following equation:

$${{N}_{2}O}_{{dir}}=0.54\times \exp \left(0.0063\times {N}_{{sur}}\right)$$
(21)

where \({{N}_{2}O}_{{dir}}\) represents the direct N2O emissions (kg N ha−1).

We also calculated the indirect N2O emissions (\({{N}_{2}O}_{{indir}}\)) following the IPCC’s 2006 GHG guidelines for national GHG inventories (Supplementary Table 8).

For the N volatilization in the forms of NH3 and NOx (Supplementary Fig. 8b, c) caused by N fertilizer application, we calculated the emissions using the following equations71:

$${{NH}}_{3}=-4.95+0.17\times {N}_{{fer}}$$
(22)
$${{NO}}_{x}=0.57+0.0066\times {N}_{{fer}}$$
(23)

where NH3 is the volatilization intensity of NH3 (kg N ha−1) for wheat, and NOx is the volatilization intensity (kg N ha−1) for wheat.

Finally, we used the IPCC AR6 100-year global warming potential (GWP) to convert all the N2O emissions to CO2 equivalents (CO2eq) (Supplementary Fig. 8d).

$${{GHG}}_{{emissions}}=\left({{N}_{2}O}_{{dir}}+{{N}_{2}O}_{{indir}}\right)\times \frac{44}{28}\times 273$$
(24)

where GHGemissions is the total emissions (kg CO2eq ha−1); \(\frac{44}{28}\) is conversion factors from N2 to N2O, and 273 is the GWP72.

Assessment of groundwater sustainability and prediction of groundwater depth changes in 2030 following wheat redistribution

Evaluation of groundwater sustainability

To reflect the groundwater stress from wheat irrigation, we proposed an index of WBI. WBI is defined as the ratio of total blue water use to total renewable blue water. A WBI greater than 1 indicates groundwater shortages, leading to a continuous decline in the groundwater depth. Conversely, the irrigated wheat harvested area can be appropriately expanded, provided there is support for increased irrigation infrastructure. The WBI is calculated as follows:

$${WBI}=\frac{{TBWU}}{T{{BW}}_{{renew}}}$$
(25)
$${{TBW}}_{{renew}}=m\times {{BW}}_{{renew}}\times {HA}\times 10$$
(26)
$${{BW}}_{{renew}}={W}_{{Surf}}+{W}_{{Ground}}\times k-{W}_{{rep}}$$
(27)

where TBWU is the total blue water use, calculated as described in the blue water section; TBWrenew is the total renewable blue water (m3 y−1) (Supplementary Fig. 9a)73. The variable m is the reasonable proportion of the renewable blue water used for wheat, calculated as the ratio of total irrigation water for wheat to the total irrigation water for all crops based on the agricultural irrigation water quota (Supplementary Fig. 9b); BWrenew represents the renewable blue water for all crops (mm y−1); HA is the harvested area of wheat, and 10 is the conversion factor for BWrenew to volume. WSurf is the available surface water resource, and Wrep is the duplicated amount between surface water and groundwater, obtained from the water resources bulletin of each basin, province, and municipality in the HHH region74,75,76,77,78,79,80. WGround is the available groundwater resource, and k is the proportion of groundwater used for agriculture, sourced from the Atlas of Groundwater Resources and Environment of China81. The variable m is proposed to control the amount of agricultural water and optimize the allocation of water resources:

$$m = \frac{{10{WatQuo}}_{{j}={w}}{{HA}}_{{j}={w}}}{{\sum}_{j}({10{WatQuo}}_{j}{{HA}}_{j})}$$
(28)

where WatQuoj is the irrigation water quota for crop j, and WatQuoj=w is the irrigation water quota for wheat (mm y−1). This study only considered wheat, maize, and rice based on the agricultural planting structure in the HHH region. HAj=w and HA are the harvested area for wheat. The WatQuoj at the county scale was sourced from the Water Resources Department of each province and municipality74,75,76,77,78,79,80. The harvested area of other crops was sourced from the SPAM2010 dataset82.

Prediction of groundwater depth changes in 2030

To predict changes in groundwater depth in the HHH region by 2030, we used multiple linear regression models to account for the impacts of both climate variables and wheat irrigated water consumption on the groundwater depth changes.

Long-term average daily groundwater depths (2005–2014) were collected based on data from China GEO-Environmental Monitoring Groundwater Level Yearbook. We selected 32 sites in the HHH region, mainly distributed in the North China Plain (NCP) (Supplementary Fig. 1e)83. To reflect the impacts of wheat planting on groundwater depth, we carefully selected the daily groundwater depths according to the wheat growing season observed at the agrometeorological stations (https://data.cma.cn/) and calculated the average groundwater depths at each station during the entire growing season. To achieve groundwater consumption for wheat irrigation, we assumed the net irrigation water demand from groundwater over-extraction (Wnet) for wheat as the difference between total blue water use (TBWU) and renewable blue water (TBWrenew) for wheat.

$${W}_{{net}}={TBWU}-{{TBW}}_{{renew}}$$
(29)

Then, we simulated future groundwater depth changes in two steps.

First, we analyzed the relationship between groundwater depths and meteorological variables (including temperature, precipitation, and evapotranspiration) as well as cumulative net irrigation water demand from groundwater over-extraction for wheat during the period of 2005–2014. As cumulative groundwater consumption has increased during the past decades, the groundwater depths have declined dramatically84. To explore the relationships between groundwater depths (GD) and other variables including the cumulative net irrigation demand for wheat and climatic variables at each groundwater monitoring well, we fitted a multiple linear regression model as follows:

$${{GD}}_{p}={b}_{0,p}+{{b}_{1,p}{CW}}_{{net},p}+{{b}_{2,p}{Tem}}_{p}+{{b}_{3,p}{Pre}}_{p}+{{b}_{4,p}{PET}}_{p}+{e}_{p}$$
(30)

where GDp and CWnet,p are the groundwater depths and cumulative net irrigation water demand for wheat at monitoring well p, respectively. \({{Tem}}_{p}\), \({{Pre}}_{p}\) and \({{PET}}_{p}\) represent the annual average temperature, annual precipitation and annual potential evapotranspiration at monitoring well p. The \({b}_{0,p}\), \({b}_{1,p}\), \({b}_{2,p}\), \({b}_{3,p}\), \({b}_{4,p}\) are the partial regression coefficients at monitoring well p. The ep is the residual at the monitoring well p. The coefficient of determination (R2) and root mean square error (RMSE) for each monitoring well are shown in Supplementary Table 9.

Second, we predicted the changes in the groundwater depth at grid level based on the above regression relationships, using the cumulative net irrigation water demand for wheat redistribution and the meteorological variables projected for the 2030s85,86. We matched individual monitoring well to the corresponding groundwater zones (Supplementary Fig. 1e) and assumed that the regression relationships within different groundwater zones were consistent with the corresponding monitoring wells. We then resampled the \({b}_{0,p}\), \({b}_{1,p}\), \({b}_{2,p}\), \({b}_{3,p}\), \({b}_{4,p}\) and \({e}_{p}\) at the grid scale (\({b}_{0,r}\), \({b}_{1,r}\), \({b}_{2,r}\), \({b}_{3,r}\), \({b}_{4,r}\) and \({e}_{r}\)). The next step was to use the parameters of spatialization to predict changes in groundwater depths in 2030 under three scenarios (S1, S2 and S3) compared with the baseline scenario, based on the regression relationship between GDp and the independent variables (\({{CW}}_{{net},p}\), \({{Tem}}_{p}\), \({{Pre}}_{p}\) and \({{PET}}_{p}\)). Finally, we simulated the changes in groundwater depth (∆GD) under different optimization scenarios compared with the current level in 2030 according to the following equations:

$${{CW}}_{{net},2030,{current}}={{CW}}_{{net},2005{-}2014,{current}}+{W}_{{net},{current}}\times 16$$
(31)
$${{CW}}_{{net},2030,{opt}}={{CW}}_{{net},2005{-}2014,{opt}}+{W}_{{net},{opt}}\times 16$$
(32)
$${{GD}}_{2030,{opt}} = {b}_{0,r}+{b}_{1,r}{{CW}}_{{ \! net},2030,{opt}}+{{b}_{2,r}{Tem}}_{ r,2030}\\ +{{b}_{3,r}{Pre}}_{r,2030}+{{b}_{4,r}{PET}}_{ \! r,2030}+{e}_{r}$$
(33)
$${{GD}}_{2030,{current}} = {b}_{0,r}+{b}_{1,r}{{CW}}_{ \! {net},2030,{current}}+{{b}_{2,r}{Tem}}_{r,2030}\\ +{{b}_{3,r}{Pre}}_{r,2030}+{{b}_{4,r}{PET}}_{ \! r,2030}+{e}_{r}$$
(34)
$$\triangle {GD}={{GD}}_{{net},2030,{opt}}-{{GD}}_{{net},2030,{current}}$$
(35)

where \({{CW}}_{{net},2030,{current}}\) and \({{CW}}_{{net},2030,{opt}}\) are the cumulative net irrigation water demand for wheat in 2030 under the current level and three optimization scenarios, respectively; \({W}_{{net},{current}}\) and \({W}_{{net},{opt}}\) are the net irrigation water demand for wheat under current level and the optimization scenarios, respectively; 16 represents the number of years from 2014 to 2030. \({{GD}}_{2030,{opt}}\) and \({{GD}}_{2030,{current}}\) are the groundwater depth under the optimization scenarios and current level in 2030. \({{Tem}}_{r,2030}\), \({{Pre}}_{r,2030}\), \({{PET}}_{r,2030}\) are the average values for the three shared socioeconomic pathways (SSP) scenarios (SSP119, SSP245 and SSP585) of annual average temperature, annual precipitation and annual potential evapotranspiration in 2030 for each grid cell r.

Wheat allocation model

We considered three different optimization objectives for wheat production: (a) minimizing irrigation water demand of wheat without production loss (S1), (b) maximizing wheat production in the HHH region while ensuring the sustainable use of groundwater in the GWD region (S2), and (c) maximizing both wheat production in the HHH region and NUE in the GWD region while ensuring the sustainable use of groundwater in the GWD region (S3). Spatially explicit optimization of wheat distribution was performed at a 1 km × 1 km resolution. The input data included yield and harvested area simulated using SPAM, and data on externalities of wheat production, such as actual cropland area, irrigated area, suitable area, blue water, renewable blue water, N fertilizer application, manure application, atmospheric deposition, and the boundaries of provinces or municipalities, GWD region, and groundwater zones. All optimizations were programmed using the General Algebraic Modeling System (GAMS) software (https://gams.com/).

The optimization objectives are formulated as follows:

For S1:

$${Min}{\sum}_{{il},i\in H}\left({O}_{{il}}{{BWU}}_{{il}}\times 10\right)$$
(36)

For S2:

$${Max}{\sum}_{{il},i\in H}\left({O}_{{il}}{Y}_{{il}}\right)$$
(37)

For S3:

$${Max}\left[\beta \frac{{\sum}_{{il},i\in H}({O}_{{il}}{Y}_{{il}})}{{\sum}_{{il},i\in H}({S}_{{il}}{Y}_{{il}})}+\left(1 - \beta \right)\frac{{\sum}_{{il},i\in G}\left({O}_{{il}}{Y}_{{il}}{N}_{{perc}}\right)}{{\sum}_{{il},i\in G}({O}_{{il}}({N}_{{feri}}+{N}_{{mani}}+{N}_{{fixi}}+{N}_{{depi}}+{N}_{{irri}}))}\right]$$
(38)

where H indicates that the grid cell i belongs to the HHH region, and G indicates the grid cell i belongs to the GWD region. Oil is the decision variable i.e., the harvested area allocated for wheat in grid cell i for farming system l. Sil is the harvested area located for wheat in grid cell i for farming system l under the current planting layout. BWUil represents the blue water use for wheat in grid i for farming system l. Yil represents the yield for wheat in grid i for farming system l. β is the weight parameter ranging from 0 to 1, set to 0.5 in this study. Nperc is the N content of wheat at the harvest period, equal to 0.0208. \({N}_{{feri}}\), \({N}_{{mani}}\), \({N}_{{fixi}}\), \({N}_{{depi}}\), and \({N}_{{irri}}\) represent the N from fertilizer application, manure application, biological fixation, atmospheric deposition, and irrigation for wheat in grid i, respectively, which can be computed as described above.

Meanwhile, the constraints for the optimization of wheat distribution are as follows: (1) The sum of allocated physical area across all farming systems within a grid cell should not exceed the actual cropland area within the same grid cell. (2) The allocated physical area under irrigated farming system within the grid cell should not exceed the area equipped for irrigation within the same grid cell. (3) The physical area of each farming system within a grid cell should not exceed the suitable area for the corresponding farming system within the same grid cell. (4) The allocated physical area under rainfed farming system within a grid cell should not exceed the rainfed area under the current planting layout within the same grid cell. This prevents an increase in rainfed wheat areas with high precipitation under the scenario of minimizing wheat irrigation water, which could considerably reduce wheat production. (5) The total blue water use should not increase in the HHH region to prevent further depletion of surface and groundwater resources. (6) The total N application should not increase in the HHH region to avoid further GHG emissions. (7) Only wheat currently grown within a grid cell can be allocated a harvested area within that grid. This is because the environmental conditions, such as the soil and climate characteristics, may inhibit further expansion and limit wheat production in districts where local knowledge is already established87. These constraints ensure that the optimization respects the current physical and environmental limitations while aiming to achieve the defined objectives under three scenarios.

For the scenario aimed at minimizing wheat water demand (S1), we also imposed a constraint to maintain wheat production at current levels to prevent any production shortfalls and ensure the security of the wheat supply. For S2 and S3, we added a constraint that the total irrigation water requirements (TBWU) should not exceed the total renewable blue water supply (TBWrenew) to ensure the sustainable use of groundwater resources. Specifically, within the GWD region, we constrained the TBWU not to exceed the TBWrenew at each grid cell. Additionally, we constrained the TBWU not to exceed the TBWrenew at each groundwater zone. This allowed the water saved by reducing the harvested area to be reallocated to high-yield regions where the harvested area increased, enabling internal water transfer within the same groundwater zones.