Introduction

Globally, groundwater stores around 1400 Pg carbon (C), similar as soils and twice as much as the atmosphere1. Groundwater is tightly linked to C dynamics in the atmosphere because it receives C mainly through plant uptake and subsequent respiration, releases C to surface waters where a large proportion of it is emitted back to the atmosphere, or delivers C to oceans2,3. Therefore, even small changes in the C flux between groundwater and atmosphere could have large impacts on atmospheric carbon dioxide (CO2) concentrations1. Dissolved C also regulates key characteristics and processes in aquatic ecosystems such as pH and metabolism4. Despite this potential importance, groundwater C dynamics are usually neglected in C budgets and models2,5,6, which may lead to biased evaluations and predictions of landscape and global C fluxes with implications for aquatic ecosystem functioning, climate change predictions and the development of soil C sequestration activities.

The C export from land to surface waters has doubled globally since 1750 due to anthropogenic perturbations7. Ongoing climate and land use change may mobilize fossil C stored in the subsurface, which would cause further climate warming and aquatic ecosystem perturbations8,9. These estimates and predictions were mainly based on observations or modeling of surface water C dynamics, but for a rigorous evaluation of the underlying mechanisms, direct estimates of groundwater C dynamics are needed. Only few studies have examined groundwater C dynamics at large spatiotemporal scales relevant for landscape and global C cycling assessments. Based on global groundwater observations, a recent study predicted dissolved organic carbon (DOC) in groundwater to increase due to climate and land use changes10. However, groundwater C typically mainly consists of dissolved inorganic carbon (DIC), i.e. the sum of CO2, bicarbonate (HCO3), and carbonate (CO32−)11,12,13. The relative proportion of these species is driven by pH dependent equilibrium reactions. Studies on long-term dynamics or large-scale patterns of groundwater DIC are rare and analyses of long-term DIC dynamics over large scales are lacking11,13. Current research is therefore missing a potentially important component of the C cycle with implications for the magnitude, origin, and fate of land-atmosphere C fluxes.

Groundwater DIC can be expected to be highly sensitive to anthropogenic activities7,13. For example, increased temperature, atmospheric CO2 concentration or nutrient availability can stimulate plant growth, soil respiration and hence groundwater C uptake and weathering13,14. Increased precipitation may further enhance C leaching15, whereas drought or human groundwater extraction may decrease C sequestration16. Expansion of agricultural and urban areas increases soil disturbance and input of substances that can fuel weathering or organic C decomposition17. Perhaps most importantly, atmospheric deposition of strong acids originating from air pollution changes the uptake and mobilization of C species through weathering and carbonate equilibrium reactions17,18. Under pristine conditions, weathering in most soils converts carbonic acid to HCO3. In the presence of nitric or sulfuric acids, however, weathering of non-carbonate rocks would not generate any HCO3. Acid inputs, if not neutralized by the groundwater buffering system, may also shift the carbonate equilibrium towards more CO2. While there is compelling evidence that atmospheric acid deposition has impacted the carbonate system over decadal time scales in many surface waters across the globe17,19,20,21, studies in groundwater are lacking.

Here, I report significant large-scale decadal increases in groundwater molar DIC and CO2 concentrations across Sweden. I attribute these trends to a partial recovery from historic anthropogenic acid deposition and increased soil respiration. Based on the results, I discuss likely scenarios for future conditions and for other regions worldwide, and discuss the need for a closer integration of groundwater into C cycle and ecosystem models. My findings are based on groundwater chemistry data collected in a certified and standardized manner by the Swedish national environmental monitoring program. Measured pH, alkalinity and water temperature allowed me to calculate DIC and CO2 using a carbonate speciation model. The dataset includes 12,154 observations from 207 sites collected since 1962. Here, I focus on 5742 observations from 55 sites (25 wells and 30 springs) with continuous monitoring during 1980–2020. The sites are representative for the Swedish forest dominated landscape and cover a wide range of latitudes from the temperate to the subarctic biome (55–68°N), well depths (2–231 m), bedrock mineral composition (silicates (n = 41), carbonates (n = 14)), aquifer types (unconfined (n = 40), confined (n = 15)) and water chemistry (Table 1). The variety of sites provides valuable geographical and hydrogeological context for discussions on the potential drivers of the observed DIC and CO2 trends.

Table 1 Physicochemical and geographical characteristics of the studied groundwater sampling sites.

Results and discussion

Decadal increase in groundwater DIC

Groundwater DIC and CO2 increased significantly across Sweden during 1980–2020. DIC and CO2 increased on average by 0.09 (0.06–0.13) mg C L−1 yr−1 and 0.06 (0.04–0.09) mg C L−1 yr−1, respectively (Fig. 1, numbers in parentheses give 95% confidence intervals based on uncertainties in raw data). Relative to median concentrations, the increase was 0.69 (0.42–0.97)% yr−1 and 1.20 (0.73–1.66)% yr−1, which corresponds to a total increase during the study period of 28 (17–40)% and 49 (30–68)%, respectively. The relative rate increase in groundwater CO2 was about twice as large as in the atmosphere22. The DIC and CO2 trends were robust even when transforming DIC and CO2 concentrations to account for the composition of other major constituents such as base cations and acid anions (Supplementary Methods 2, Supplementary Fig. 1e, f). Across Sweden, significant increasing trends outnumbered other trends. DIC and CO2 increased significantly (p < 0.05) in 58% (42–75%) and 60% (35–71%) and decreased in 5% (0–15%) and 2% (0–25%) of all sites, respectively. DIC and CO2 trends did not vary significantly with geographical or hydrogeological settings (latitude, well depth, bedrock mineral composition, aquifer type), but DIC increases tended to be lower in deeper wells (p = 0.048 (0.015–0.137) and at higher latitudes (p = 0.057 (0.016–0.170, Supplementary Table 3). The trends in the dataset of 55 sites were consistent with the larger dataset that includes up to 207 sites with ≥10 years of data (Supplementary Fig. 2).

Fig. 1: Trends in DIC and CO2 concentrations across Swedish groundwater sampling sites during 1980−2020.
figure 1

a, b Time series of DIC and CO2, lumped for all sites and normalized to site-specific median values of 1980–2020. Lines show local quantile regressions (green = median, blue = 90% percentiles). Note that a few outliers are not shown. c, d Linear trends in DIC and CO2 during 1980–2020 as boxplots, point estimates and maps. Boxplots show medians (thick line), interquartile ranges (box) and 1.5 times interquartile ranges (whiskers) and significance of two-tailed Student’s t-test with null hypothesis h0: mean = 0 (***p < 0.001). Each circle represents one site. Circle size symbolizes significance of site-specific trends (p < 0.05). For statistical details, see Supplementary Table 1. For diagrams on DIC and CO2 concentrations and trends relative to median DIC and CO2 concentrations as well as relative to trends in the concentrations of major cations and anions, see Supplementary Fig. 1.

The main input variables to DIC calculations, alkalinity and pH, shifted markedly during the study period. Alkalinity, here expressed as bicarbonate alkalinity (HCO3, see methods), remained unchanged until 2000 but increased afterwards by 0.03 (0.02–0.06) mg C L−1 yr−1, as a mean among all sites (Fig. 2a, c). Conversely, pH declined until 2000 by 0.008 (0.005–0.014) yr−1 and remained at low levels afterwards (Fig. 2b, d). The pH decline corresponded to an increase in H+ ion activity of 2.9 (1.7–4.2)% yr−1. Changes in HCO3 and pH were detected across the whole range of sites covering pH of 5.15–8.10 and HCO3 of 0.4–64.1 mg C L−1 (Fig. 2e). Most of the sites exhibited a significant break point in linear trends for pH and HCO3 (64% and 69%, respectively), clustering around the year 2000 (Supplementary Fig. 3). Hence, 2000 divides the study period into distinct regimes with different primary DIC drivers. As inferred from the C speciation model, the DIC increase could be mainly explained by increasing CO2 resulting from declining pH and stable HCO3 during 1980–2000, and by the HCO3 increase and stable pH during 2000–2020 (Supplementary Fig. 4).

Fig. 2: Shifting drivers of DIC during 1980−2020.
figure 2

a, b Time series of HCO3 and H+ activity, respectively, lumped for all sites and normalized to site-specific median values of 1980–2020. Lines show local quantile regressions (green = median, blue = 90% percentiles). c, d The linear trend in HCO3 and pH during 1980–2000 and 2000–2020 as boxplots. Boxplots show medians (thick line), interquartile ranges (box) and 1.5 times interquartile ranges (whiskers). Each circle in boxplots represents one site. Boxplots show significance levels of two-tailed Student’s t-test with null hypothesis h0: mean = 0 (n.s. not significant, ***p < 0.001). e Site-specific median DIC as a function of HCO3 and pH during 1980–2000 and 2000–2020. White lines show trajectories between the periods. DIC isoclines are based on the carbonate speciation model, using median water temperature and chemistry among sites. For statistical details, see Supplementary Table 1.

Shifting weathering and acidification pathways drive DIC increase

I mainly attribute the observed DIC increase to a partial recovery from historic atmospheric acid deposition and subsequent shifts in the sources and pathways of weathering and acidity. Acid deposition peaked in the 1970s and led to a historic decline in HCO3 and pH throughout Sweden until ~198023. The decline has partly reversed since 1980 due to emission control and subsequent deposition reductions of mainly sulfate (SO42−)24,25. This is reflected in an increase in HCO3 (1.59 (0.69–2.71) μEq L−1 yr−1 as mean among sites) that was equivalent in magnitude to a decline in SO42− (1.36 (0.69–2.15) μEq L−1 yr−1) during 1980–2020 (Supplementary Table 2). Trends in HCO3 correlated mainly and negatively with trends in acid anions (SO42−, NO3) according to multivariate linear regressions (Supplementary Table 3, Supplementary Fig. 6). This tight association suggests recovery from acidification as the main driver of HCO3. Here, changes in weathering dynamics play an important role. Overall weathering rates likely remained unchanged during the study period, because the most common base cations (Ca2+, Mg2+, Na+), accounting for 97% of the positive charges did not change (Supplementary Table 2, Supplementary Fig. 5). However, the increase in HCO3 was likely caused by shifts in weathering pathways, where contributions to weathering by sulfuric acid decreased relative to carbonic acid during the study period. This is indicated by two commonly used proxies, SO42−/(SO42− + HCO3) and (Ca2++Mg2+)/HCO3, where ratios >0 and >1, respectively, indicate major contributions of sulfuric acid to weathering17,18. Swedish groundwater showed ratios of 0.31 (0.24–0.38) for SO42−/(SO42− + HCO3) and 1.49 (1.27–1.74) for (Ca2++Mg2+)/HCO3 during 1980–2000 (Fig. 3a, b). Both ratios decreased significantly during 2000–2020, indicating decreased influence of sulfuric acid (Fig. 3c–f). The declines were largest towards lower latitudes where atmospheric SO42− deposition has been most pronounced25, and were more negative in unconfined aquifers which are particularly sensitive to acidification26 (Supplementary Fig. 7a−d, Supplementary Table 3). A SO42− decline could theoretically also be expected from lower pyrite oxidation due to rising groundwater levels, which was not found here (Supplementary Fig. 8a, Supplementary Table 2). Together, this stresses that recovery from atmospheric acid deposition has likely been the main cause for the observed SO42− and HCO3 trends (Fig. 4).

Fig. 3: Recovery from acidification drives HCO3− concentrations.
figure 3

a, b Major influence of sulfuric acid on weathering as indicated by boxplots where SO42−/(SO42− + HCO3) > 0 and (Ca2++ Mg2+)/HCO3 > 1 for most sites. c, d Ongoing recovery from acidification as indicated by decreasing SO42−/(SO42− + HCO3) and (Ca2++ Mg2+)/HCO3 since 2000. The figures show time series observations, lumped for all sites and normalized to site-specific median values of 1980–2020. Lines show local quantile regression (green = median, blue = 90% percentiles). e, f Boxplots of trends in SO42−/(SO42− + HCO3) and (Ca2++Mg2+)/HCO3 during 1980–2000 and 2000–2020. Boxplots show medians (thick line), interquartile ranges (box), 1.5 times interquartile ranges (whiskers) and significance levels of two-tailed Student’s t-test with null hypothesis h0: mean = 0 (a, e, f) or mean = 1 (b) (n.s. not significant, ***p < 0.001). Each circle in boxplots represents one site. For statistical details, see Supplementary Table 1.

Fig. 4: Conceptual diagram of hypothesized patterns and main drivers of decadal groundwater DIC trends.
figure 4

Boxes show states or processes and arrows show fluxes. Symbol size scales qualitatively with concentration, process rate or flux. Patterns and drivers are considered typical for acid sensitive landscapes under the influence of reductions in atmospheric acid deposition. Reductions in atmospheric acid deposition shifts weathering pathways towards lower importance of sulfuric acid (H2SO4) relative to carbonic acid (H2CO3), leading to higher HCO3 production in non-carbonate bedrock. Higher forest productivity and decreased atmospheric acid deposition may cause larger organic carbon (OC) supply and soil respiration, potentially further stimulated by climate warming and atmospheric CO2 increase. CO2 production from soil respiration contributes acidity and a shift in the carbonate equilibrium towards more CO2 at the expense of HCO3.

An important precondition for the DIC rise was that HCO3 and pH did not recover in concert from acid deposition. A parallel recovery in HCO3 and pH would not necessarily imply an increase in DIC, because at least part of the additional HCO3 would originate from consumption of CO2 (Fig. 2e)27. Here, however, rising HCO3 and falling pH collectively indicate both higher DIC and CO2 (Supplementary Fig. 4). The absence of pH recovery is characteristic for areas with acid igneous bedrock and can be explained by slow weathering and exhausted acid buffering capacity21,26,28,29. This is supported here, because pH declines were more pronounced in relatively weakly buffered aquifers with silicate minerals in the reservoir bedrock, compared to more strongly buffered aquifers with carbonates (Supplementary Fig. 7e, Supplementary Table 3). A reduction in weathering and hence hydrogen ion consumption could theoretically lead to groundwater acidification. However, this is unlikely here, because weathering rates likely remained unchanged, as discussed above, and trends in major weathering products could explain only little of the observed H+ trends among sites (Supplementary Table 3). An alternative driver could be enhanced acid input from trees due to increased removal of base cations from forest ecosystems as a result of increased forest harvest intensity30. This process can indeed at least in part explain the relatively slow pH recovery in Swedish forest soils30. Yet, it is unlikely to explain pH trajectories in groundwater, because it would imply a decrease in base cations30, which was not observed here (Supplementary Table 2). Well-established theory27 predicts that pH trends can be uncoupled from HCO3 trends during different stages of acidification if processes other than weathering or ion exchange affect the charge balance in groundwater. For example, pH could drop in response to increased organic acidity. This is unlikely here, because organic acids contribute only little to acidity as indicated by low total organic carbon (TOC) concentrations (mean 2.3 mg L−1, near equivalent to DOC19) and cation-to-anion ratios close to 1.0 with no significant trends (Table 1, Supplementary Table 2)14. Other potential drivers include episodic salt intrusions in coastal areas, and nitrification and nitrate-leaching, but in Sweden these effects are relatively short-lived or local28,30. Absence of overall trends in Cl and NO3 among the study sites further support this notion (Supplementary Table 2).

The most likely driver of the observed pH trends is increases in groundwater CO2 (Fig. 1b)24. Through its effects on soil acidity and carbonate equilibria, CO2 can affect pH and HCO3 to the same quantitative extent as acid deposition and therefore alter or delay recovery from acid deposition23,31,32. Increased CO2 may have resulted from enhanced soil respiration as caused by several mechanisms (Fig. 4). First, recovery from historic nitrogen deposition may have altered microbial activities, destabilized organic matter against decomposition, and enhanced C inputs to roots and hence increased heterotrophic or autotrophic soil respiration33,34. Nitrogen deposition has indeed decreased by ~35% across Sweden since the 1980s25. Even though NO3 did not decline consistently among Swedish aquifers (Supplementary Table 2), study sites with the largest NO3 decline showed the largest increase in H+ and HCO3 and hence DIC and CO2 (Supplementary Fig. 6, Supplementary Table 3), possibly because of higher soil respiration and dissociation of more CO2 in groundwater. Second, recovery from soil acidification may have increased the bioavailability of nutrients and enhanced primary productivity, root growth and microbial activity35. Swedish soils are indeed slowly recovering from these effects28. Another consequence of this recovery is increased leaching of DOC acting as a potential substrate for CO2 production19,21. While groundwater DOC trends cannot be fully evaluated here due to incomplete data before 2000, the increased DIC and constant HCO3 during 1980–2000 may indicate substantial aerobic DOC decomposition36. Third, large-scale drivers other than atmospheric acid deposition must have contributed to the CO2 rise in groundwater. This is because atmospheric deposition effects would be expected to decline with latitude, as discussed above, but CO2 trends did not vary with latitude (Supplementary Table 3). One such alternative driver could be forest productivity. More productive forests produce more litter inputs and allocate more C to roots and therefore may yield higher soil respiration37. Forest productivity has indeed increased across Sweden by nearly 50% since the 1950s38. Fourth, rising atmospheric CO2 concentrations may have led to increased respiration by roots and microbes14. Atmospheric CO2 concentrations have indeed been rising by 22% during 1980–202022. Fifth, warming may have stimulated soil organic carbon decomposition39. Swedish groundwater warmed indeed by 0.038 °C yr−1, on average among sites (Supplementary Table 2, Supplementary Fig. 5), which could potentially have increased soil respiration by 10–26% (Supplementary Discussion 1).

Several alternative mechanisms could theoretically lead to changes in DIC but have likely minor influence here. For example, decreasing water levels would lead to a concentration of solutes through longer residence and reaction times and smaller water volumes. However, I did not find any significant change in water levels and no significant relationship between water levels and DIC among a subset of 15 sites with parallel water level and chemical measurements (Supplementary Fig. 8b, Supplementary Table 2). Moreover, liming applied in forestry, agriculture or water management adds HCO3 and rises pH17. In Sweden, liming contributes on average 4% to riverine carbonates and has decreased substantially since 1980 and hence cannot explain a large-scale DIC increase40. Notwithstanding, the multitude of environmental changes that have taken place in Sweden during the past decades make it difficult to disentangle the contribution of single mechanisms and call for future more detailed mechanistic research.

The dynamic role of groundwater in the contemporary C cycle

Regardless of the exact driver, this unique four-decade long study reveals substantial changes in groundwater C cycling across a 450,000 km2 region with diverse hydrogeological settings. These dynamics have important consequences for the role of groundwater in the contemporary C cycle. Whether groundwater is a sink or a source for atmospheric C has been debated for decades1,3,14. Traditionally, groundwater has been regarded as a global C sink over geologic time scales because more CO2 is consumed during silicate weathering than released during subsequent precipitation of the weathering products (HCO3 and e.g. Ca2+) as carbonate rock in oceans1,3. My findings challenge this view, because they indicate that elevated sulfuric acid inputs have caused an imbalance between HCO3 and base cations (Fig. 3), which prevents carbonate rock formation and weakens the C sink over decadal time scales18. While these changes have started to reverse, they may take decades or centuries to recover because of an exhausted acid buffering capacity26,27,29. My findings also stress that the temporal evolution may depend on the hydrogeological settings, with somewhat more dynamic responses in shallower or unconfined relative to deeper or confined aquifers. Land use and climate changes may further modify the trajectories through their potential effects on soil respiration14,37,39.

The C sink function of groundwater is also challenged by the emerging evidence that groundwater can act as a source for atmospheric C, because it contributes to a large extent to globally important C emissions from inland waters and C export to oceans2,5,41,42. An important question is to what extent rising groundwater DIC would propagate into C emissions from receiving surface waters. Indeed, DIC has been rising during the past decades in many diverse northern hemisphere surface waters, including Swedish waters17,19,21,32,43,44,45, even if this was not the case everywhere20,46,47. In contrast, CO2 concentrations have often not changed in the same pace or direction20,47,48. In Sweden, the mismatch in ground- and surface water CO2 trends could be explained by the relatively short periods for which surface water CO2 trends are available (≤17 years)48,49 relative to the time it may take for groundwater CO2 changes to propagate to surface waters (~several decades)50,51,52. Alternatively, increased CO2 export may be easily missed because CO2 is quickly degassed to the atmosphere42 or processed by metabolism in surface waters and these processes may have intensified48. Furthermore, changes in hydrological flow paths may have favored DIC over CO2 export to surface waters48,49. Finally, riparian zones may have lost part of their capacity to enrich groundwater in CO2 just before it discharges into surface waters2,42, as a consequence of historic large-scale perturbations such as drainage ditching and maintanence53. This process is speculated to have contributed to declines in stream CO2 concentrations across the USA over the past decades47. Collectively, my findings highlight the need of future research and monitoring efforts to unravel the hydrological and biogeochemical controls on C export from land to water in order to elucidate the role of changing groundwater DIC for surface water C emissions and C export to oceans. My findings also urge for investigations on the extent to which rising groundwater DIC mirrors an increased terrestrial net C uptake6,14 or constitutes a net C source to surface waters and the atmosphere7.

The changes in groundwater chemistry observed here are likely representative for many aquifers globally. A total of 7–17% of global land area has been acidified due to atmospheric deposition and poor buffering capacity54. Slow recovery from acidification is a typical feature of groundwater in these regions29,55,56. Nearly half of the continental land surface contains local and relatively shallow aquifers similar as in Sweden57. Many of these have relatively high groundwater recharge and shallow water tables and are located in areas where atmospheric acid deposition has been declining such as northern Europe, northeastern North-America and southeastern Asia52,57. Even groundwater in areas where atmospheric acid deposition is still rising may show DIC changes. However, DIC may also increase independent of atmospheric deposition history and sensitivity to acidification, as reported for well-buffered carbonate-rich aquifers in the USA13,58. Together these observations corroborate my findings that bedrock mineralogy was of relatively minor importance for variation in DIC trends among aquifers and that drivers other than atmospheric acid deposition can cause DIC changes.

Investigating the mechanisms of global C cycling remains a major scientific challenge, in particular the sources, pathways and fates of C as it moves across the land-water continuum6,7. This work demonstrates the large potential of groundwater to provide unique insights in C cycle mechanisms because of its tight connection with the often independently studied atmosphere, vegetation, soils, bedrock and surface waters. Hence, groundwater can be regarded as a sentinel and integrator of environmental changes over time scales of its residence time. Groundwater chemistry is monitored in many countries worldwide. While direct DIC measurements are usually absent and should be introduced in future monitoring, alkalinity, pH and temperature is typically monitored and can be useful to approximately track past and ongoing changes in surface C uptake and subsurface transformations, but potentially also as an early warning system of future changes in receiving surface waters. To predict these changes, it is crucial to accurately quantify the time scale and degree of connectivity at which environmental change effects on the land surface propagate through groundwater and surface waters11. Closer collaboration among hydrologists, hydrogeologists, limnologists, atmospheric scientists and soil scientists will be vital for the inclusion of groundwater in C budgets, the legacies it constitutes in the C cycle, and the wider effects it has on aquatic ecosystem functioning. Such efforts will not only help to better predict future landscape and global C fluxes, but also to develop integrated watershed management tools to improve water quality, C sequestration and climate change mitigation2.

Methods

Data collection

I explored groundwater chemistry data collected within the environmental monitoring program of the Swedish Geological Survey. In total, data was available from 1738 sampling sites for the period 1962–202059. Here, I focus on the period 1980–2020 because sampling was greatly intensified in 1980 (Supplementary Fig. 2) and selected 55 sites with observations available for at least 65% of the total number of years in the period and at least two observations in the first and last four years of the period60. These sites are part of the national groundwater quality monitoring program and were specifically selected in areas free from local human impacts. Most sites had data for the full 41 year record and at least 32 years, with 60–180 observations per year distributed equally over the year (Supplementary Fig. 9). Sampling and sample analysis for these sites was done following standardized methods within the Swedish national groundwater monitoring program. Groundwater was extracted with various types of pumps or fetchers adapted to the specific sampling site. Generally, great care was taken to minimize gas exchange with the atmosphere during sampling. Samples were transported to accredited Swedish laboratories in cooling boxes and stored at 4 °C upon analysis (typically within <3 days). The laboratories were at Meteorological Institute (MISU), Stockholm University (until 1980), Geological Survey of Sweden, Uppsala (1980–1992), and Department of Aquatic Sciences and Assessment, Swedish University of Agricultural Sciences, Uppsala (since 1992). Field measurements included water temperature (T) and dissolved oxygen (O2) concentrations. Laboratory measurements included pH, alkalinity, electrical conductivity, base cations (Ca2+, Mg2+, K+, Na+), acid anions (SO42−, Cl, NO3), ammonium (NH4+), dissolved silica (SiO2), and total organic carbon concentrations (TOC, which can be assumed to be nearly identical to DOC19). Samples for pH analysis were handled during transport and analysis (potentiometric pH meter) without direct contact with surrounding air in order to minimize disruption of the gas equilibrium. Alkalinity was measured using the Gran titration method (titration to pH 5.4) and is defined as the acid buffering capacity. Further details on analytical methods are available elsewhere61 (Supplementary Table 5). Groundwater chemistry data was complemented by water level measurements available for a subset of 15 sites62. Level measurements and water sampling was not always performed on the same day and therefore matched with a tolerance of 14 days. Geographical data was available for each site and included information on latitude, longitude, depths of water intake in well, aquifer type (unconfined/confined) and bedrock type (silicate/carbonate). Bedrock type at site locations was derived from a geological map63.

Data preprocessing

For each time series, I removed outliers defined as values beyond the median ± three times the standard deviation within a running window of ±10 values. This procedure removed <3% (median, <6% max) of all values for any variable. In a few cases, values were below the minimum detection limit of the respective measurement method61. This was the case for <0.1% of pH and alkalinity observations, 9% of NO3 observations and 26% of NH4+ observations, as a median among sites. I set these values to random numbers between zero and the respective detection limits using a bootstrap approach (see section on ‘uncertainty propagation’ below). Hence, the NO3 trends need to be treated with caution. NH4+ trends were not calculated because trends would be biased by variable detection limits (0.004–0.05 mg L−1). SiO2 trend calculations were also omitted due to reported issues with method changes61. Water temperature was missing in a few cases (9%) and was gap-filled using linear regression with ‘year’ and ‘day of year’ as predictors to account for decadal and seasonal trends. The median standard error of prediction was 0.22 °C (0.07–0.44) and had negligible effects on DIC and CO2 calculations (<1%).

DIC and CO2 calculations

I calculated DIC and CO2 concentrations from measured pH, alkalinity and temperature based on well-established carbonate equilibrium equations64. I also calculated bicarbonate alkalinity (HCO3), correcting measured alkalinity for other potential sources of alkalinity (e.g. silicates), except DOC (but see sensitivity analysis below). I performed the calculations using the geochemical modeling program PHREEQC version 3.7.5 developed by the US Geological Survey and implemented as an R package (‘phreeqc’)65,66. PHREEQC is commonly used in groundwater chemistry modeling and has also been used for large-scale and long-term assessments of C cycling where direct DIC or CO2 measurements are typically not available13,16. PHREEQC simulates a variety of equilibrium reactions between solutes, solids and gases with potential additional effect on the carbonate system. Here, I account for the distribution of major geochemical species (Ca2+, Mg2+, K+, Na+, SO42−, Cl, NO3, and SiO2). The effect of these species on calculated DIC, CO2, and HCO3 was typically <1%.

Sensitivity analysis

The DIC and CO2 calculations may be biased under relatively low pH and alkalinity as well as high DOC67. For example, organic acids may bias calculations in high DOC waters because they also contribute to measured (Gran) alkalinity. Here, this contribution estimated for the period 2000–2020 following68 (Supplementary Methods 1) was 1% as median among all sites and ≤8% in 90% of all sites. With such low contributions, even relatively large trends in DOC would likely cause only little bias in observed trends in alkalinity69. Another source of error lies in potential underestimation of pH in low ionic strength waters by certain types of potentiometric pH meters70. Corrections based on ionic strength estimated using measured concentrations of base cations, acid anions and alkalinity (Supplementary Methods 1)70 suggest that pH values could be underestimated by 0.10 units as median among all sites. This, however, is a conservative maximum estimate, because the pH measurements in this study rely on electrodes that are particularly adapted to minimize diffusion voltages that would cause underestimation of pH in low ionic strength waters, following international standards (Supplementary Table 5). Alkalinity and pH corrections would reduce the calculated DIC and CO2 concentrations and therefore also their absolute trends in 2000–2020 (−6 to −9% and −16 to −22%, respectively, Supplementary Table 4, Supplementary Fig. 10). However, the trends relative to median concentrations were not biased in any considerable way (+2 to +4% and −2 to −10%) and alkalinity and pH corrections balanced each other (Supplementary Table 4). Importantly, absolute and relative DIC and CO2 trends remain highly significant among sites (p < 0.001) and the proportion of sites with significant increases or decreases was nearly unaffected (Supplementary Table 4). Furthermore, DIC and CO2 trends were similar for different subsets of sites with pH and HCO3 below and above critical thresholds that are generally associated with more or less biased estimates67 (pH ≤/> 6.5 and/or HCO3 ≤/> 1 mEq L−1, Supplementary Fig. 11). Together, these analyses stress the robustness of the main results in this paper relative to errors in carbonate equilibrium estimations. Further support is provided by the fact that the DIC estimates in this study (Supplementary Fig. 1a) were of similar magnitude as direct DIC measurements in other Swedish groundwater sampling sites12.

Linear trend analysis

I quantified decadal monotonic rates of change per unit time in the measured water quality parameters using the Theil–Sen estimator (referred to as ‘trends’ and the symbol Δ throughout the manuscript)71. This estimator is the median of the slopes resulting from all pairs of samples and is hence robust against outliers. To yield relative changes in % yr−1, I divided trends by the median concentration for a given period and multiplied by 100. I evaluated the significance in trends using the seasonal Kendall test with corrections for serial dependence72. The seasonal Kendall test calculates a trend for each season (spring = March–May, summer = June–August, autumn = September–November, winter = December–February) and combines season-specific trends to test for an overall trend. This approach has been widely used to test for trends in water quality13,20,48. I performed the trend analyses using the “rkt” function of the “rkt” package for the statistical program R 3.6.173,74. The function allows for correction of test statistics for correlation between seasons. The corrections never had any noteworthy effect on test statistics but required substantial computation time. I therefore disabled the corrections in the final analysis. In very few cases (<1% of all data), sites were sampled repeatedly within 3 days. I averaged values from such consecutive samplings, because they would otherwise considerably slow down computation times for trend analyses. I evaluated the overall trend among all sites using the two-tailed Student’s t-test with the null hypothesis of h0: mean = 0 using the “t.test” function in R. In these tests spatial autocorrelation was never an issue, as indicated by non-significant correlation coefficients Moran’s I (p > 0.05), calculated using the “calculatePvalue” function of the R package “Irescale”75.

Change point analysis

To account for the possibility of non-monotonic trends in water chemistry that can be expected during recovery from acidification27, I evaluated for each site the presence of a change point, i.e., a point in time when the local linear trend changed significantly in slope. Change points were identified using the “segmented” function of the R package “segmented”76. Change points were considered significant if a bi-linear model fitted the time series significantly better than a linear model, according to the likelihood ratio test performed using the “lr.test” function of the R package “lmtest”77. To visualize overall trends, I plotted observations from all sites against time, normalized to the respective site-specific median, accompanied by local quantile regressions (median and 90% percentiles). Local quantile regressions were calculated using 2nd order polynomial regressions (“loess” function in R package “stats”, degree of smoothing = 0.75) fitted to rolling quantiles with a window size of 20 observations (“rollapply” function in R package “zoo”78 applied to “quantile” function in R package “stats”74).

Multivariate statistics

I evaluated potential drivers of DIC and CO2 trends among sites (n = 55) using two sets of multiple linear regressions, including relevant water chemical and geographical predictor variables. In water chemical models, I regressed the trends of DIC, CO2, H+ and HCO3, respectively, against the trends of base cations, acid anions, and water temperature. In geographical models, I regressed the trends of DIC, CO2, H+ and HCO3, respectively, against latitude, depth of water intake in well (hereafter referred to as ‘well depth’), aquifer type and bedrock type as predictor variables. I set ‘well depth’ to 0 m for springs. For each set of models, I selected the most parsimonious model from a suite of candidates fitted based on all possible combinations of predictor variables and ranked using Akaike’s Information Criterion. I selected the most parsimonious model using the “dredge” function in the R package “MuMln”79. I fitted the water chemical models using robust linear regression and the MM estimator by means of the “rlm” function in R. Robust regression downweighs the influence of outliers and is recommended for models with compositional water chemical data (Supplementary Methods 2). Outliers were no issue in the geographical models which is why I fitted them using ordinary least square regression by means of the “lm” function in R. In all models, multicollinearity among predictor variables was minor because variance inflation factors calculated using the “vif” function of the R package “car”80 were always <4 and typically <2. Furthermore, spatial autocorrelation was never an issue, as suggested by comparisons of models with and without accounting for correlation structure (exponential relationship with latitude + longitude). These models were fitted using the “gls” function in R and compared using the likelihood ratio test (p > 0.05) and the “lr.test” function of the R package “lmtest”77.

Data transformation

In multivariate analysis, it is important to account for the compositional nature of water chemical data. The use of raw concentration data may result in problems such as spurious correlations and incorrect interpretation. To avoid these problems in the water chemical models, I transformed all water chemical variables to so-called Pivot log-ratio coordinates (plr) using the R package ‘robCompositions’81 (see Supplementary Methods 2 for details). To approximately conform to normality assumptions in Student’s t-tests and multivariate geographical models, I transformed variables if needed and report back-transformed statistics for t-tests. I used either log10(X + 1) or asinh(a·X)-transformation of variable X, where a was between 10 and 10000. For pH, I base all statistics on the activity of the hydrogen ion, H+ = 10−pH, and report results based on back-transformed pH values, where possible. In particular, I calculated temporal trends as \(\varDelta {{{{{\rm{pH}}}}}}=-{\log }_{10}(\tilde{{H}^{+}}+\tfrac{1}{2}\varDelta {H}^{+})--{\log }_{10}(\tilde{{H}^{+}}-\tfrac{1}{2}\varDelta {H}^{+})\), where ∆pH and ΔH+ are the Theil–Sen slopes of pH and H+, respectively, and \(\tilde{{H}^{+}}\) is the median of H+.

Uncertainty propagation

I propagated analytical uncertainties in input variables in their effect on trends using a parametric bootstrap approach82. For each sampling site, I resampled each observation 500 times from standard probability distributions defined by the mean and standard deviation of the analytical estimates as reported by the laboratory61 (Supplementary Table 5), as reported by the literature (organic matter contribution to alkalinity, Supplementary Methods 1), or as predicted by the water temperature gap filling model (see ‘Data preprocessing’). I assumed the error in water level measurements and geographical variables to be negligible. The distribution I sampled from were normal (T), log-normal (pH) or gamma (all other variables). In particular, I replaced values below the detection limit by a sample from a uniform distribution bound by zero and the detection limit. I calculated temporal trends for each of the 500 randomly created time series. I performed all statistical analyses on each of the 500 bootstrapped trends and summarized the resulting distribution of test statistics by means and 95% percentiles (which yield confidence intervals).