<mark>groundwater are determined by the relative difference between groundwater level and river stage (Mukherjee et al., 2018). In regions that are exposed to over‐extraction of groundwater, the resulting lower discharge can reduce groundwater’s contribution to the baseflow and can substantially decrease the streamflow of rivers (Mukherjee, 2018). This in turn can enhance salt concentrations in rivers because of lower dilution capacity. Excessive irrigation can also raise water tables from saline aquifers and cause seepage of saline groundwater into freshwater (Mateo‐Sagasta et al., 2010)</mark> .

## 2.4 Weather Data

Our weather data come from Matsuura and Willmott (2001). This gridded data set contains monthly observations of precipitation and average temperature at the 0.5 degree gridcell level. We transform these data into average monthly temperature, and total precipitation (mm), per year, for each gridcell.

# 3. Empirical Strategy

To determine the impact of saline water on crop productivity, we estimate a crop production function. Specifically, we estimate the following equation: Δlog�NPP����α�λ∗g�WQ����δ∗f�climate����σ� �ρ� � θ � ∗Y�ε�� (1) where NPP�� is net primary productivity in gridcell i of year t; g�WQ��� is a measure of water quality; f�climate��� are measures of temperature and rainfall; σ� are gridcell fixed effects, which account for time invariant factors which impact agricultural productivity; ρ� are year fixed effects; and θ � ∗Y are region specific time trends, to account for local changes in economic or political structures which may impact agricultural production.

As discussed in the prior section, several restrictions are placed on the data set to ensure accuracy. First, only gridcells with at least 30 percent cropland according to the ESA data set are included. In robustness checks, this threshold is changed to 75 percent and 90 percent. Agriculture in gridcells must also be irrigated, as described in section 2.3. Gridcells must be no more than 100 kilometers from their matched monitoring station, to ensure that water quality at the station accurately reflects irrigation water quality. This threshold is somewhat arbitrary and chosen to balance two competing factors: higher distance thresholds reduce the average relationship between measured upstream water quality and actual water quality in the gridcell, while lower distance thresholds reduce the number of observations in our study. In section 5 we present results where this threshold is varied for robustness.

In order to avoid bias caused by reverse causality, gridcells are carefully matched to monitoring stations which are strictly upstream from them. It is well known that if drainage is not carefully managed, irrigated agriculture can impact the salinity of discharged water. Thus, downstream water salinity can be impacted by upstream agricultural production. In addition, water extractions for agriculture or other uses can also impact downstream salinity levels. Thus, to ensure that the impact of water salinity on agricultural production is properly identified and that salinity levels are entirely exogenous, a careful matching of gridcells to upstream monitoring stations was done. In the Mekong and India analyses, this was done through the use of a hydrological connectivity approach, where the streamflow from each gridcell was traced upstream until a monitoring station was found. The hydrological connectivity approach is a process in which areas of land (such as districts or grid cells) are connected to water quality stations through the drainage network based on the direction of surface runoff. To achieve this process, the following steps 6