## Introduction

Rivers and streams contribute substantially to global natural and anthropogenic emissions of CO2, CH4, and N2O1,2,3. Estimates of CO2 emissions from rivers range between 0.7 and 2.9 PgC (1015 gC) yr−11,4,5,6 and are comparable to the land net CO2 sink of ~2 PgC yr−17. Estimates of CH4 emissions from rivers range between 7 and 27 TgCH4 (1012 gCH4) yr−12,8, which is lower than the source of CH4 from freshwater wetlands of ~150 TgCH4 yr−19. Collectively, aquatic ecosystems (freshwater wetlands, rivers, streams, lakes, ponds, reservoirs, rice paddies, aquaculture ponds, coastal vegetated habitats, estuaries, and ocean) contribute 41% of total global CH4 emissions from natural and anthropogenic sources8. Estimates of N2O emissions from rivers have been dramatically revised downwards from early estimates of 2,100 GgN2O-N (109 gN2O-N) yr−110 to 32 GgN2O-N yr−111. This large difference is attributable to N2O riverine emissions being computed from nitrogen (N) deposition and emissions factors that are uncertain12 and have been revised downwards13.

The majority of riverine GHG emissions are from the tropics, ~60–80% for CO21,4,5,6,14,15, ~70% for CH416, and ~79% for N2O11. Yet, the total stream surface area (SSA) in the tropics (24°N-24°S) corresponds to ~44% of the total SSA globally, implying that riverine areal emissions of GHGs (per m2) are higher than in other climatic zones. The higher areal GHG emission rates in the tropics compared to other climate zones is partly related to year-round high temperature that sustains high microbial activity leading to GHG production in soils and in-stream. Additionally, tropical forests with high organic carbon biomass (55% of total17) and extensive wetlands18 sustain an important supply of organic carbon to rivers that fuel in-stream microbial production of GHGs.

Yet, the estimates of GHG emissions from tropical rivers and streams remain highly uncertain for several reasons. One being the scarcity of data to characterize the variability within river basins, related for example to differences in river size and land cover on the catchment, but also among river basins, related for example to differences in climatic zones and concomitant differences in land cover. Additionally, emissions of GHGs are disproportionately higher in headwaters and low-order streams19, including mountainous reaches20. For example, in the Congo River, streams with a Strahler order 1 alone accounted for 62%, 59%, and 45% of basin-wide total CO2, CH4, and, N2O emissions, respectively21. Streams with Strahler order 1 and 2 accounted, together, for even more, 79%, 77%, and, 59% of basin-wide total CO2, CH4, and N2O emissions, respectively21. Higher CO2, CH4, and N2O emissions from low-order streams result from a higher input of GHGs from soil-water and ground-water in low-order streams, although highly variable in space and seasonally because soil-water inputs occur during short-lived high-flow events that promote shallow flowpaths22. Additionally, low-order streams, and in particular mountainous ones are characterized by high values of gas transfer velocity (k)23. The strong degassing to the atmosphere due to high k values results in concentrations of CO2 and CH4 close to equilibrium with the atmosphere in mountainous streams24 Conversely, in lowland river reaches, the presence of wetlands strongly enhances the fluvial riverine CO2 and CH4 emissions14,15,21,25,26. There is then a need to describe the spatial variations of GHG fluxes from headwaters to lowlands and understand the underlying drivers. This knowledge should allow choosing the appropriate landscape metrics (catchment slope, land vegetation cover, inundation cover, precipitation, among others) and/or stream attributes (river size, stream gradient, discharge, among others) to statistically model and upscale GHG concentrations and k and compute and integrate riverine GHG fluxes, either at local scale21 or globally4,5.

The Amazon is the largest river on the Earth in terms of freshwater discharge and watershed surface area; its basin covers a large portion of the humid Neotropics. The lowland Amazon rivers and streams (channels only at an elevation <500 m) were reported to emit CO2 at a rate ranging between 0.095 and 0.1427 PgC yr−1. Additionally, headwater Amazonian streams emit CO2 at a rate ranging between 0.0928 and 0.175 PgC yr−1. The total CO2 emission from the Amazon running waters (rivers and floodplains) range between 0.529 and 1.4 PgC yr−16. Rivers and floodplains of the Amazon River entire basin emit CH4 rate of ~22 TgCH4 yr−1, but rivers represented about ~0.6% of the total flux, although only integrated for the Solimões-Amazon mainstem30. The CH4 emissions from large rivers of the Amazon River have been evaluated to 0.5 TgCH4 yr−116, and CH4 emissions for the whole lowland Amazon basin (elevation <500 m) to 0.3 TgCH4 yr−131. The total emission of CH4 from Amazonia (including all terrestrial and aquatic compartments) converge to ~40 TgCH4 yr−1 and have been evaluated with a variety of methods32,33, either based on atmospheric observations (“top down” approach) or upscaling of flux measurements in various relevant components (“bottom up” approach).

Research on GHGs in rivers and streams has mainly focussed on the Central Amazon6,15,16,25,28,29,30,31,34,35,36,37,38,39. Most research has focussed on high-order streams and rivers, and only occasionally in headwater streams28,40,41. Here, we report data of the dissolved CO2, CH4, and N2O concentration in the Andean headwater mountainous and piedmont rivers and streams of the Napo basin in Ecuador (Fig. 1 and Supplementary Fig. 1). We describe gradients of dissolved concentrations of CO2, CH4 and N2O with elevation and their drivers in terms of catchment attributes (slope and land cover), and we model gas emissions at the scale of whole Amazon basin using in addition for lowland rivers a compilation of published data.

## Results and discussion

### Altitudinal patterns of stream GHG content

We sampled 25 stations in the mainstem Napo and Coca rivers and 19 stations in the tributaries along an elevation gradient from 3990 m to 175 m above sea level, on 8 occasions from 2018 to 2021 (Fig. 1 and Supplementary Fig. 1). In surface waters of the sampled streams, the values of the partial pressure of CO2 (pCO2) ranged between 152 and 10,873 ppm, and dissolved CH4 concentrations between 4 and 38,666 nmol L−1 (Fig. 2a, e). Values of pCO2 below atmospheric equilibrium (~404 ppm, average of in-situ measurements) were only observed in 22 cases (7% of the total number of observations), while dissolved CH4 concentration values in surface waters were always above atmospheric equilibrium (~2 nmol L−1, based on the global average CH4 mixing ratio of 1.9 ppm). The pCO2 and dissolved CH4 concentration values in streams at elevations >500 m (median 560 ppm and 17 nmol L−1, respectively) were distinctly lower than at elevations <500 m (median 1280 ppm and 370 nmol L−1, respectively). The pCO2 and dissolved CH4 concentration in streams increased exponentially from highlands to lowlands (Fig. 2a, e). The patterns of oxygen saturation level (%O2) in streams generally mirrored those of pCO2 and dissolved CH4 concentration. The %O2 values in streams at elevations >500 m (median 74.4%) were higher than at elevations <500 m (median 63.2%), and %O2 decreased exponentially from highlands to lowlands (Fig. 2m).

The pCO2 and dissolved CH4 concentration values were positively correlated (Fig. 3b), and they were negatively correlated to %O2 (Fig. 3a, c), strongly suggesting that pCO2 and dissolved CH4 concentration in streams were controlled by the same combination of input and output processes (that also involved opposite changes of O2). A likely important output process of CO2 and CH4 is the loss to the atmosphere that depends on k. The calculated k values increased with increasing elevation (Supplementary Fig. 2b). Higher k values strongly promoted the emissions of CO2 and CH4 to the atmosphere, contributing to drive pCO2 and dissolved CH4 concentrations to values close to saturation in the highland streams compared to lowland streams, and could explain in part the decreasing pattern of pCO2 and dissolved CH4 concentrations with elevation. A likely important input process of CO2 and CH4 is organic matter mineralization in-stream, in fringing wetlands, and in terra firme soils of the watershed. Altitudinal changes of organic matter mineralization might have resulted from changes in temperature, soil organic carbon content and land cover. Water temperature strongly increased from highlands to lowlands, from ~13.5 °C > 500 m elevation to ~24.3 °C < 500 m (Supplementary Fig. 2a). Rates of respiration42,43 and methanogenesis44 in soils and riverine sediments are positively related to temperature, suggesting the warmer conditions in the lowland rivers contributed to higher pCO2 and dissolved CH4 concentration values. Indeed, pCO2 and dissolved CH4 concentration values also increased exponentially with water temperature (Fig. 2d, h). Changes of water temperature could contribute to explain the decreasing pattern of pCO2 and dissolved CH4 concentration with elevation.

There were also changes of land cover with elevation with a transition from a dominance of grasslands in uplands (known as páramos) to forests in lowlands (Supplementary Fig. 3a, b)45. Additionally, the presence of fringing wetlands (indicated by inundation extent) strongly increased in the piedmont streams (Supplementary Fig. 3c). Stream pCO2 and dissolved CH4 concentration values increased exponentially with forest cover (Fig. 2c, g), and were generally higher where grassland cover was low to zero (Supplementary Fig. 4a, c). Fluvial pCO2 and dissolved CH4 concentrations values were positively related to inundation extent in the reach with different slopes for tributaries and main-stem (Supplementary Fig. 4b, d). Fringing wetlands might have a local impact on pCO2 and dissolved CH4 concentration in smaller streams (tributaries) in the piedmont region and explain in part the increasing pattern of pCO2 and dissolved CH4 concentration with decreasing elevation. Lateral inputs from fringing wetlands strongly influence the fluvial content of dissolved organic carbon (DOC)46 and CO225 in the Central Amazon River. Note that inundation extent was locally high in some of the lowland streams at reach level, but for the whole upstream catchment the inundation extent values were much lower (≤2%). Wetlands have been shown to strongly influence pCO2 and dissolved CH4 concentration values in lowland African rivers where the wetland cover was higher for the whole upstream catchment14.

The k values strongly depend on stream gradient and water flow47 that both scale with catchment slope, that itself varies with elevation. Vegetation cover (forest and riparian wetlands) and temperature also vary as function of elevation, so, also with catchment slope. Consequently catchment slope could be used as an integrative metric for processes that affect GHGs. Indeed, pCO2 and dissolved CH4 concentration values in the sampled streams were found to be negatively related to catchment slope, while %O2 was positively related to catchment slope (Fig. 2b, f, n).

The N2O saturation levels (%N2O) in streams at an altitude >500 m (median 95.4%) were lower than at elevations <500 m (median 105.0%) (Fig. 2i). The %N2O increased exponentially with decreasing elevation and increasing water temperature (Fig. 2i, l), although, in both cases, the exponential increase was less steep than for pCO2 and dissolved CH4 concentration (Fig. 2). Lower N2O in high elevation streams was consistent with reported elevation gradients of N2O soil-air fluxes in the Ecuadorian Andes, with a soil N2O sink at high elevation (2200–3010 m) and a N2O source from soils to the atmosphere at lower elevation (400–1100 m)48. The low fluvial %N2O probably resulted from inputs to river reaches of soil water with low N2O content. The removal of N2O in soils was due to complete denitrification (reduction of N2O to N2) in highlands related to low soil dissolved inorganic N (DIN) content48. Conversely, the N2O emissions from soils to the atmosphere from lowland soils to the atmosphere was related to high DIN content in soils combined to higher temperature and higher soil water content48. The DIN in streams (Supplementary Fig. 5c) was higher in highland streams than in lowland streams, so did not seem to follow the pattern of soil DIN that was higher in lowlands than highlands48. The same elevation pattern of stream DIN was reported in Andean streams in Venezuela49. High DIN levels were reported in 55 streams in montane forests in Central America and the Caribbean50,51. Large loss of inorganic nitrogen by leakage to streams from unpolluted mature tropical forests occurs ubiquitously across a range of soil types50,51. The higher DIN in highland streams could be related to higher transfer of DIN from soils to streams related to a lower retention due to differences in vegetation types (grassland versus forest52) or higher catchment slopes that promote soil-river transfer of DIN53,54. In addition, there could have been a higher DIN uptake in the water column by primary producers (phytoplankton or macrophytes) related to decrease in flow and an increase in water residence55. The combination of higher stream DIN and low %N2O in highland streams, and the opposite pattern in lowland streams led to a negative relation between %N2O and DIN (Fig. 3f). Such a negative relation is unique compared to patterns previously reported, as N2O content in rivers is in general positively related to DIN56,57,58.

Four streams showed %N2O values diverging from general patterns, the Huirima and a cluster of three streams (Guamanyacu, Inmiyana, Tiputini). The Huirima showed distinctly lower %N2O (67%) than the other lowland streams at equivalent elevations (104–119%) but also the lowest %O2 (30.9%) and highest pCO2 (7317 ppm) values (Fig. 3d, e). The Huirima stream was also characterized by much higher DOC concentrations than all the other streams, suggesting a stronger removal of N2O by denitrification in soils and/or sediments associated to streams with high DOC and low %O2, as also shown in black-water rivers and streams of the Congo basin21. The Huirima was characterized by the lowest catchment terrain slope (0.4°) among the sampled streams. Aerial view (Supplementary Fig. 6) showed a dense forest cover and suggested extensive inundation of the Huirima river that probably promoted conditions favorable for complete denitrification and N2O removal (reducing conditions associated to high DOC and low %O2).

The Guamanyacu, Inmiyana, and Tiputini streams drain (in part) oil palm plantations (Supplementary Fig. 7a–c) that could explain the higher stream %N2O levels (150–153%) compared to surrounding streams (104–119%). In the area, artificial fertilizers are not used in the oil palm plantations, and accordingly, the DIN levels in these streams were comparable to the others at same elevation (Fig. 3f). However, the conversion of natural forest to oil palm plantations itself leads to an increase of N2O production in soils due to changes in N microbial cycling due to disturbance of the soils59. Overall, oil palm plantations did not seem to lose markedly DIN to rivers but there seemed to be intense N2O production in soils that was transported to streams.

Stream size has been shown to be an important predictor of CO2 and CH4 emissions that scale with stream Strahler order in boreal60, temperate61,62 and tropical21 river basins. In highland streams (elevation >500 m), there were no clear patterns with stream size for pCO2, dissolved CH4 concentration, %N2O and %O2 (Supplementary Fig. 8e–h). In the lowland streams, there was an increasing pattern with stream size of pCO2 and dissolved CH4 concentration (mirrored by a decreasing pattern of %O2) (Supplementary Fig. 8i–l) as frequently observed in other river networks21,60,61,62. However, when streams were taken together irrespective of altitude, there was no clear relation with streams size for pCO2, dissolved CH4 concentrations, %N2O and %O2 (Supplementary Fig. 8a–d), suggesting that the effect of altitudinal gradient overwhelmed the effect of stream size on the variability of these quantities.

### Exchange of CO2, CH4 and N2O with the atmosphere from the Napo river network

The air-water diffusive flux of CO2 (FCO2) ranged between −1 and 1074 mol m−2 yr−1, and was higher in tributaries (median 128 mol m−2 yr−1) than in the main-stem (median 34 mol m−2 yr−1). The air-water diffusive flux of CH4 (FCH4) ranged between 45 and 8985 mmol m−2 yr−1, and was generally higher in tributaries (median 999 mmol m−2 yr−1) than in the main-stem (332 mmol m−2 yr−1). Both FCO2 and FCH4 were inversely correlated to elevation and upstream terrain slope (Supplementary Fig. 9a, b, e, f). The air-water diffusive flux of N2O (FN2O) ranged between −23 and 27 mmol m−2 yr−1 and did not show marked difference between tributaries and main-stem. There was a general tendency towards a sink of N2O at an elevation >1000 m with 12 sites showing negative FN2O values and only 4 showing positive FN2O values (Supplementary Fig. 9i, j). At an elevation <1,000 m the FN2O values were close to zero (−1.3 to 3 mmol m−2 yr−1), except for the Guamanyacu, Inmiyana, and Tiputini streams that showed distinctly positive FN2O values (9.7 to 21.6 mmol m−2 yr−1) and the Huirima that showed a distinctly negative FN2O value (−7.6 mmol m−2 yr−1).

In river geomorphology, the concept of sediment transport capacity has been used to determine if bedload transport is primarily constrained by sediment supply (supply-limited rivers) or river flow hydraulics (transport-limited rivers)63. This concept has been extended by some authors to fluvial CO2 and CH4 fluxes24,40,64. The underlying idea being that in highly turbulent systems (high k values) degassing brings gases close to equilibrium with the atmosphere and emissions are close to zero, consequently the gaseous emission is assumed limited by gas availability. Transport- or supply-limitation of the gaseous exchange with the atmosphere can be visualized by plots of gas concentration versus k60064 (Supplementary Fig. 10). At an elevation above 1500 m, computed k600 values were higher than 25 m d−1 while pCO2 (<746 ppm) and CH4 (<72 nmol L−1) values were low indicating supply-limitation of CO2 and CH4 emissions (Supplementary Fig. 10a, b). Conversely, in some of the lowland tributaries, particularly high pCO2 (>1500 ppm) and CH4 (>500 nmol L−1) values indicate transport-limitation of CO2 and CH4 emissions. There was an exception for both CO2 and CH4, corresponding to high concentrations values (pCO2 = 1,395 ppm and CH4 = 320 nmol L−1) in highland streams with high k600 values (74 and 88 m d−1, respectively) (indicated by asterisks in Supplementary Figs. 9 and 10). For N2O, the interpretation of concentration-k600 plot in terms of transport- or supply-limitation was not as clear as for CO2 and CH4 (Supplementary Fig. 10c). The sampled streams were more or less strongly over-saturated in both CO2 and CH4, consequently the flux was unidirectional from the water to the atmosphere (emission). In contrast, N2O oscillated between under- and over-saturation, corresponding to a sink or a source of N2O the atmosphere, respectively. In the case of a stream acting as a sink of a gas, the supply-limitation is from the atmosphere and not within the stream itself. In this situation, the use of concept of transport capacity as used for sediments63 becomes awkward. At an elevation >1500 m, N2O concentrations were close to saturation in conjunction with high k600 values (Supplementary Fig. 10c). At an elevation below 1500 m, N2O concentrations markedly above or below saturation were observed in some streams. In this case, the direction and intensity of the N2O exchange should be more strongly driven by variations of concentrations rather than by those of k600. FCO2, FCH4 and FN2O strongly correlated with pCO2, CH4, and %N2O, respectively, and did not correlate to k600 (Supplementary Fig. 9c, g, k, d, h, l), showing that for the whole data-set the variations of gaseous exchanges with the atmosphere were strongly driven by the variations of the concentrations (supply-limitation) rather than by k600 (transport-limitation). In highly turbulent systems with high k600 values, the gaseous exchanges with the atmosphere bring the concentrations close to equilibrium with the atmosphere, strongly decreasing the flux values that converge to zero.

### Comparison of stream GHG content with Central Amazon basin

The pCO2 values in the rivers and streams of the Central Amazon (median 2950 ppm) were higher than piedmont (median 1280 ppm) and highland (median 555 ppm) streams of the Napo and there was a general decreasing pattern with elevation and slope (Fig. 4a). In contrast, the CH4 concentrations in the piedmont streams (median 341 nmol L−1) were higher than in the rivers and streams of the Central Amazon (median 120 nmol L−1), that in turn were higher than in the highland streams (median 16 nmol L−1) (Fig. 4b). There was a general decreasing tendency of CH4 as function of catchment slope, but at equivalent slope values (at the low end of the range of values), CH4 concentrations were higher in piedmont streams than lowland stream and rivers. The ratio of CH4 to CO2 dissolved concentrations (CH4:CO2 in µmol:µmol) followed the same patterns as dissolved CH4 concentration as a function of elevation (Fig. 4e) and catchment slope (Fig. 4f), indicating that for a similar input of CO2 (lateral input from soils or in-stream mineralization) there was a larger input of CH4 in piedmont streams than in lowland rivers and streams. The forest cover and water temperatures in piedmont streams are equivalent to those in lowland rivers and streams. The higher dissolved CH4 concentration in piedmont rivers might result from the combination of relatively higher CH4 production in the piedmont streams and relatively higher losses of dissolved CH4 in the lowland rivers. The piedmont region is an area of deposition of suspended particles delivered from the highland streams originating from erosion, up to 30% of the total annual load in the Mamoré river65, with an annual freshwater discharge equivalent to the one of the Napo. The deposition of sediments combined by presence of forests in the piedmont region are most probably favorable to high in-stream CH4 production. In larger lowland river channels that are relatively disconnected from floodplains, the deep water column and strong currents do not promote the accumulation of dissolved CH4 in the water column, but promote the removal of dissolved CH4 either by emission of CH4 to the atmosphere or by microbial oxidation15.

The only N2O data in streams and rivers of the Amazon River network were reported by Richey et al.34. When plotted against pCO2, the %N2O values were higher in the Central Amazon streams and rivers (median 205.6%) compared to piedmont (median 105.0%) and highland (median 95.7%) streams (Supplementary Fig. 11a). We do not have a conclusive hypothesis for the higher %N2O in lowland streams and rivers, but the general tendency of higher pCO2 and N2O in lowland streams and rivers than in piedmont and highland streams (Supplementary Fig. 11b) suggests more intense mineralization in soils or in-stream leading to higher CO2 and presumably N2O levels in rivers in the former systems. The pattern of higher %N2O in Central amazon streams compared to headwater and piedmont streams was also consistent with higher N2O soil-air fluxes (79 ± 7 µgN m−2 h−1) in the central part of the basin from oxisols66 that are dominant in the Amazon forests67 than in piedmont forests (8 ± 12 µgN m−2 h−1 at 400 m elevation)48. Comparatively higher dissolved CH4 concentrations in piedmont streams than in lowland streams was also evident relative to pCO2 when compared with the data-set of Richey et al.34 (Supplementary Fig. 11a).

### Exchange of CO2, CH4, and N2O with the atmosphere from the whole Amazon basin including Andean mountainous and piedmont streams

We used catchment slope as an integrative metric to scale pCO2, CH4 and %N2O available in the Amazon River network, as detailed in the Methods section. The k values were derived from stream gradient (slope) and flow velocity47, itself computed from discharge5, for all the river segments given by RiverATLAS68. The areal FCO2, FCH4, and FN2O (per m2) were computed from k and concentrations of CO2, CH4, N2O for each river segment of the Amazon catchment given by RiverATLAS (n = 744,786) and then integrated with the corresponding SSA.

The piedmont streams accounted for 62% of the total integrated diffusive FCH4 (0.4 ± 0.1 TgCH4 yr−1), higher than the contribution from lowland rivers (28%), while highland streams accounted for only 10% (Fig. 5b). The diffusive FCH4 per m2 in highland streams (1,077 ± 240 mmol m−2 yr−1) was 4.5 times higher than in lowland rivers (237 ± 79 mmol m−2 yr−1) despite the fact that dissolved CH4 concentrations were ~2 times lower (157 ± 35 versus 307 ± 100 nmol L−1), due to much higher k values (148.8 ± 3.2 versus 14.5 ± 0.4 cm h−1, Fig. 5e). The diffusive FCH4 per m2 in piedmont streams (1,573 ± 350 mmol m−2 yr−1) was 6.6 times higher than in lowland rivers (137 ± 79 mmol m−2 yr−1) because of much higher dissolved CH4 concentrations (797 ± 174 vs. 307 ± 100 nmol L−1), while k was relatively closer (20.0 ± 0.5 versus 14.5 ± 0.4 cm h−1).

The integrated FCO2 (64 ± 5 TgC yr−1) was dominated by lowland rivers (65%) (Fig. 5a). However, FCO2 per m2 in highland and piedmont rivers (197 ± 35 and 143 ± 3 mol m−2 yr−1) were 1.7 and 1.2 times higher than lowland rivers (115 ± 8 mol m−2 yr−1), respectively (Fig. 5d), due to higher k values, since pCO2 values were lower in highland streams (1033 ± 88 ppm), although comparatively similar in piedmont streams (2599 ± 146 ppm) and lowland rivers and streams (2735 ± 148 ppm) (Fig. 5g).

The integrated FN2O (25 ± 4 GgN2O-N yr−1) was overwhelmingly dominated by lowland rivers and streams (99% of total), while piedmont streams were an extremely small source of N2O, and highland streams were a very small sink of N2O (Fig. 5c). The computation of FN2O is comparatively more uncertain than FCH4 and FCO2 since we extrapolated to all lowland river segments the median %N2O value given by Richey et al.34, unlike for the other two GHGs for which relations with slope were used to compute concentration values for individual river segments. The median %N2O value (206%) reported by Richey et al.34 for the Central Amazon rivers and streams was higher than the median value of %N2O reported in two large African rivers, the Zambezi69 and the Congo21 rivers of 116% and 131%, respectively. Another study provided a lower %N2O average value (134 ± 25%, n = 131) in the Solimões and Negro Rivers70 than the median %N2O value (206%) reported by Richey et al.34. Using the lower %N2O value of 134% for all the lowland rivers provided an integrated FN2O value for the Amazon River basin of 9 ± 4 GgN2O-N yr−1, which was close to the range of N2O emissions for the Amazon River basin of 11 to 16 GgN2O-N yr−1 modelled from N deposition and emission factors3. The wide range of %N2O values reported in literature calls for additional data of N2O in lowland rivers of the Amazon basin for a more accurate evaluation of FN2O.

The FCO2 and FCH4 estimates per m2 were consistent (within uncertainties) with those previously reported in the Amazon basin, for lowland basin-wide FCO25,27 and FCH431, FCH4 for large lowland rivers16, and the Amazon/Solimões mainstem FCH430 (Supplementary Table 1). Our lowland basin-wide diffusive FCH4 per m2 is higher than the one reported by Barbosa et al.31 because our estimate includes the piedmont rivers with high diffusive FCH4 values (Fig. 5e) while the estimate of Barbosa et al.31 is based on data from large lowland rivers (Xingu, Tapajós, Madeira, Purus, Juruá, Japurá, Solimões, Negro).

### Uncertainties in scaling the exchange of greenhouse gases with the atmosphere

The integrated FCO2, FCH4, and FN2O estimates have three sources of uncertainty from each of the terms of the flux computation: the respective modelled dissolved gas concentrations, the k values, and the SSA.

Previous studies that modelled fluvial pCO2 at continental or global scales either used averaged values per stream order61 or multi-parametric approaches4,5,71 using several catchment proprieties and climate data as predictors. At the continental scale of the USA, Lauerwald et al.71 modelled pCO2 in streams and rivers with multiple linear regressions (MLR) using catchment slope, mean air temperature, and mean precipitation as predictors. At global scale, Lauerwald et al.4 modelled pCO2 in streams and rivers with MLR using catchment slope, mean air-temperature, land net primary production, and population density as predictors. Also at global scale, Liu et al.5 modelled pCO2 in streams and rivers with a random forest model that used as primary inputs 15 watershed properties including catchment slope, elevation, soil pH, temperature, soil respiration, watershed area, land gross primary production, base saturation, population density, gravel, soil organic carbon, sand, precipitation, land net primary production, and wetland cover (ranked in order of decreasing importance). Note that some of these 15 watershed properties are intimately linked such as land net primary production, gross primary production and soil respiration72, or geomorphological variables such as slope and catchment area73, so there could be redundancy in part of the variables used in this random forest model.

There is no standardized procedure to upscale GHG emissions from inland waters which is challenging given the large inherent variability and the comparatively low data coverage. Some studies have used multi-parametric approaches, while we use a simple relation to a single predictor. Complex mathematical approaches do not necessarily provide more reliable results, and, in fact, potentially produce more uncertain estimates74. Admittedly, it is unrealistic to model fluvial pCO2 using a single predictor at continental or global scales. Indeed, at very large spatial scales, it is required to account for strong latitudinal variations as in climate (temperature, precipitation, ice cover) and in soil organic carbon75 (among others) that are expected to strongly affect fluvial pCO2, in addition to local topographic effects that might have a more ubiquitous and uniform effect per latitude (such as the effect of stream slope on k). Yet at the scale of a single river basin, it should be possible to reduce the number of variables to model fluvial pCO2. A simpler model has the advantage to reduce unrealistic results computed outside the bounds of determination of available data, especially from strongly non-linear relationships. We did not find a relation between pCO2 and dissolved CH4 concentration and stream order (Supplementary Fig. 8), as used to scale FCO2 or FCH4 in some studies at basin or continental scales21,60,61, and we modelled fluvial pCO2 and dissolved CH4 concentration based on catchment slope. In the above mentioned three models of fluvial pCO2 at continental or global scales, catchment slope explained the largest fraction of variance in the MRL4,71 or random forest model5, and as such was the most important predictor. This high predictive power shows that catchment slope strongly controls fluvial CO2 content directly or indirectly at multiple levels.

It is well established that topography of a catchment strongly influences hydrological, geomorphological, and biological processes active in the landscape76. Catchment slope determines to a large extent broad patterns in the variation of soil organic carbon content77,78,79, groundwater discharge80, stream water residence time81, and wetland abundance82,83, that, combined, have a major impact on fluvial carbon cycling, including CO2 and CH4 dynamics. These processes also determine the inputs to streams and the fluvial content of DOC. Highland steep streams with poorly developed soils and substantial exposed bedrock are characterized by lower fluvial DOC than lowland low-relief streams, and fluvial DOC content correlates to catchment slope79,84,85,86. Since catchment slope strongly determines fluvial DOC79,84,85,86 and wetland coverage82,83, it is also expected to strongly influence fluvial pCO2 that has been shown to strongly correlate with DOC14,69,87,88 and wetland coverage14,15,25 at river basin and continental scales. Wetland coverage can also explain in part the spatial variations of fluvial dissolved CH4 concentration14,21. Additionally, the k values strongly increase with increasing stream slope20,47 that scales with catchment slope89 and catchment area73. High k values in steeper terrains will promote degassing and equilibration with the atmosphere, while lower k values will allow an accumulation of gases in the water. An additional reason to use catchment slope as a predictor is that this variable can be determined with very high confidence based on detailed and precise digital elevation models. Other variables such as land vegetation cover90,91 or terrestrial productivity92,93 have a relatively large uncertainty especially at finer resolution. We tested if the addition to upstream slope of other variables improved the prediction of pCO2 (Supplementary Table 2). The MRL including elevation or forest cover in addition of upstream slope did not substantially improve the prediction of pCO2 compared to the linear regression using upstream slope alone (Supplementary Table 2).

The k cannot be measured directly but can be calculated from simultaneous measurements of the air-water gradient of gas concentration and the gas flux. The gas flux in streams can be measured with eddy-covariance, mass balance of deliberate tracers, or floating chambers. Eddy-covariance is the most challenging technically, has been very seldom applied in rivers, and only in large systems94,95. Eddy-covariance measurements require long deployments (weeks-months) due to large data rejection, and are not adapted for “grab-sampling” during spatial surveys of short-duration, as in the present study. The mass balance of deliberate tracers such as argon, propane, SF6, krypton-85 and tritium allow to derive k values at short time intervals and small scales in a non-intrusive way23,47. Floating chamber flux measurements are easy to set-up and inexpensive, however, they might not be adapted for fast flowing small streams as those sampled in the present study. In fast flowing streams, it is required to anchor the floating chamber, leading to an over-estimations of flux estimates, due to enhanced turbulence under the chamber96,97. Changes in pressure and temperature inside the chamber additionally affect the flux measurements and k estimates98. Chamber measurements can advantageously be used to measure gas ebullition which is important for CH4 but not CO2 and N2O, in addition to gas diffusive flux. The k parametrization of Raymond et al.47 we used in the present study is based on 576 measurements of deliberate gas tracer injections, and has been used in global estimates of CO2 emission from streams and rivers1,4,5. The k values computed with this parameterization have been shown to satisfactorily compare to those derived from chamber measurements by several independent studies in contrasted rivers and streams40,60,87,88,99,100.

To scale FCO2 and FCH4, we used the spatial data, including SSA, from RiverATLAS68 that provides a standardized compilation of descriptive hydro-environmental information for all river basins of the world at high spatial resolution. The total SSA given by RiverATLAS68 globally is 363,000 km2, which is lower than the value of 624,000 km2 given by Raymond et al.1 and of 773,000 km2 given by the Global River Widths from Landsat (GRWL) data-set101. At the scale of the Amazon basin, the SSA given by RiverATLAS68 is also lower than other independent estimates, although the wide range of values reflects their uncertainty (Supplementary Table 3). The SSA of the lowland Amazon basin (<500 m altitude) given by RiverATLAS68 (37,972 km2) is between 1.6 and 2.2 times lower than the one reported by Melack27 (60,500–83,000 km2), but 1.4 times lower than the one reported by Liu et al.5 (52,640 km2) based on the GRWL data-set101 (Supplementary Table 3). We acknowledge that the integrated fluvial emissions of CO2, CH4, and N2O we computed for the Amazon basin should be considered as conservative, given the lower SSA given by RiverATLAS68 compared to other estimates (Supplementary Table 3). Yet, the general spatial patterns should be correct and the under-estimation of SSA given by RiverATLAS68 should not invalidate our major finding regarding the relative importance of the contribution of mountainous and piedmont regions to CO2 and CH4 emissions from the Amazon River basin (Fig. 5).

## Conclusions

We provide to the best of our knowledge the first large-scale survey across and altitudinal gradient of CO2, CH4, and N2O exchange between Andean mountainous streams of the Amazon River basin and the atmosphere. We showed that these mountainous headwater and piedmont streams were hotspots of CO2 and CH4 emissions from the whole Amazon River basin, accounting for a very significant fraction of total emissions (35 and 72% for CO2 and CH4 respectively). The present study also provides a baseline evaluation of CO2, CH4, and N2O emissions from headwater mountainous and piedmont streams that could change in response to human alterations and activities on the catchments. In these areas, there are high rates of deforestation and conversion to croplands45. There have been concerns about the N2O emissions from soils to the atmosphere related to oil palm plantations59, and here we suggest that part of the N2O emissions related to oil palm plantations indirectly occur through streams. The oil palm plantations seemed to lead to a strong over-saturation of N2O (~150%) in streams downstream compared to streams are similar elevations that were characterized by N2O levels closer to saturation (~110%). Additionally, there has been a boom in hydropower development in the headwaters of the Amazon with potential consequences on aquatic biodiversity102. Hydropower development could also change sediment transport by rivers to and deposition in piedmont rivers, possibly affecting future CH4 emissions that were shown here to be particularly high.

## Methods

### Site description

The Napo River catchment ranges from 100 to 6300 m above sea level, and has a total area of 100,500 km2, distributed among Ecuador (59%), Peru (40%), and Colombia (1%)103. The Ecuadorian part of the Andean Cordillera is the narrowest within the Central Andes and is characterized by an important volcanic and seismic activity. Below an elevation of 500 m is located a fairly flat and homogeneous forest, part of the Amazonian plains, that covers 82% of the total surface of the Napo basin. The rest of the basin (18%) is constituted by the Andean Cordillera with a vegetation cover composed by grasslands (puna and páramo). The drainage basin receives on average 3200 mm of rainfall per year. At high elevations, rainfall is bimodal and is maximal in April and October and minimal in July–August and in January. In the upper basins, two discharge maxima occur during the two rainfall maxima. In the lowlands, seasonal variability of rainfall and discharge is very weak. The annual discharge of the Napo is 6300 m3 s−1 corresponding to 4% of the Amazon River total discharge at Obidos. The Napo is a ‘white water’ river type characterized by high levels of total suspended matter, and the sediment transport of the Napo River corresponds to 6% of the sediment flow of the Amazon River at Obidos103.

### Sampling and chemical analysis

Sampling was carried out on eight occasions (October 2018 and 2019, January 2019 and 2020, April 2019 and 2021, July 2019 and 2020) (Supplementary Fig. 1). Stations A1 to A21 were sampled travelling by car, and the others travelling by boat. Sampling was carried out during day-time only (early morning to late afternoon). In some streams, during day-time, oxygen concentrations can strongly increase104, and, conversely, CO2 concentrations can decrease105, in response to aquatic photosynthesis. Fluvial CO2 emissions can, thus, be under-estimated105 if data are only acquired during day-time, because night-time CO2 concentrations and fluxes can be higher than during day-time. Note that a day-time decrease of stream CO2 and increase of O2 are not necessarily systematic patterns that depend on the level of in-stream productivity. In lowland streams, rich in DOC, such as in the Congo River network, day-night differences of pCO2 were low21 due to low planktonic primary production106 and much smaller than the differences among streams (spatial gradients).

Water temperature, specific conductivity, pH, and %O2 were measured in-situ with a YSI multi-parameter probe (ProPlus). Water for CH4 and N2O samples was collected with a sampling devise consisting of a 2 L polyethylene bottle with the bottom cut and fitted with a silicone tubing at the stopper107. Two borosilicate serum bottles (Weathon) with a volume of 40 ml were filled with the silicone tubing, poisoned with 100 µl of a saturated solution of HgCl2 and sealed with a butyl stopper and crimped with an aluminium cap. Measurements were made, after over-night equilibration, on an headspace108 (created by injecting 15 ml of high-purity N2 into the 40 ml sample bottles), with a gas chromatograph (SRI 8610 C) with a flame ionisation detector for CH4 and electron capture detector for N2O calibrated with CH4:N2O:N2 gas mixtures (Air Liquide Belgium) with mixing ratios of 1, 10 and 30 ppm for CH4, and 0.2, 2.0 and 6.0 ppm for N2O. The precision of measurement based on duplicate samples was ±10.9% for CH4 and ±5.8% for N2O based on 309 replicates.

pCO2 was measured in the field with a Li-Cor Li-820 infra-red gas analyser based on the headspace technique with 4 polypropylene syringes that were filled directly with river water. The pCO2 in the atmosphere was measured by injecting ambient air sampled with an additional polypropylene syringe. The Li-Cor Li-820 was calibrated with pure N2 and CO2:N2 gas mixtures (Air Liquide Belgium) of 388, 804, 3707, and 8146 ppm. The final pCO2 value was computed taking into account the partitioning of CO2 between water and the headspace, as well as equilibrium with HCO3-109 using water temperature measured in-stream and after equilibration, and total alkalinity (data not shown). Samples for total alkalinity were conditioned, stored, and analysed as reported elsewhere21. The precision of pCO2 measurement was ±5.2%.

The CO2 concentration is expressed as partial pressure in parts per million (ppm) and as dissolved concentration for CH4 (nmol L−1), in accordance with convention in existing topical literature. Variations of N2O were modest and concentrations fluctuated around atmospheric equilibrium, so data are presented as percent of saturation level (%N2O, where atmospheric equilibrium corresponds to 100%), computed from the global mean N2O air mixing ratios given by the Global Monitoring Division (GMD) of the Earth System Research Laboratory (ESRL) of the National Oceanic and Atmospheric Administration (NOAA) (https://www.esrl.noaa.gov/gmd/hats/combined/N2O.html), using the Henry’s constant110.

Water was collected in the stream surface with a 2 L polyethylene bottle. The water filtered through GF/F Whatman glass fibber filters was collected and further filtered through polyethersulfone syringe encapsulated filters (0.2 µm porosity) for nitrate (NO3-), nitrite (NO2-) and ammonium (NH4+). Samples were stored frozen (−20 °C) in 50 ml polypropylene vials. NO3- and NO2- were determined with the sulfanilamide colorimetric with the vanadium reduction method111, and NH4+ with the dichloroisocyanurate-salicylate-nitroprussiate colorimetric method112. Detection limits were 0.3, 0.01, and 0.15 µmol L−1 for NH4+, NO2, and NO3, respectively. Precisions were ±0.02 µmol L−1, ±0.02 µmol L−1, and ±0.1 µmol L−1 for NH4+, NO2 and NO3, respectively.

### Computation and upscaling of FCO2, FCH4, FN2O

The dissolved concentrations of CO2, CH4, and N2O were derived from statistical relations as function of catchment slope for each of the river segments in RiverATLAS68 (n = 744,786). The statistical relations we derived from our own data in the Napo and data available from literature in the lowland rivers and streams of the Central Amazon (Fig. 4).

The pCO2 (in ppm) was computed according to:

$$\log ({{{{{{\rm{pCO}}}}}}}_{2})=3.57(\pm 0.02)-0.0043(\pm 0.0002)\times {{{{{\rm{CS}}}}}} \\ ({{r}^{2}}=0.59, p \, < \, 0.0001, n=473)$$
(1)

where CS is the catchment slope (×10°).

The CH4 (in nmol L−1) was computed for an elevation > 180 m according to:

$$\log ({{{{{{\rm{CH}}}}}}}_{4})=3.18(\pm 0.08)-0.0081(\pm 0.0005) \times {{{{{\rm{CS}}}}}} \\ ({{r}^{2}}=0.42, p \, < \, 0.0001, n=305)$$
(2)

and for an elevation < 180 m according to:

$$\log ({{{{{{\rm{CH}}}}}}}_{4})=2.60(\pm 0.08)-0.0178(\pm 0.003) \times {{{{{\rm{CS}}}}}} \\ ({{r}^{2}}=0.21, p \, < \, 0.0001, n=174)$$
(3)

The %N2O (in%) was computed for an elevation > 200 m according to:

$${ \% {{{{{\rm{N}}}}}}}_{2}{{{{{\rm{O}}}}}}=106.9(\pm 2.3)-0.048(\pm 0.014) \times {{{{{\rm{CS}}}}}} \\ ({{r}^{2}}=0.04, p = 0.0011, n=277)$$
(4)

and for an elevation of < 200 m the median of values reported by Richey et al.27 (205.6%) was applied uniformly.

To avoid the computation of unrealistic values outside the determination bounds of the regressions, for CS > 200 (×10°), a constant value (based on the median of observations within that range of slope values) was applied: 542 ppm for pCO2 and 96.3% for %N2O. For CH4, for an elevation > 180 m, a constant value of 18.5 nmol L−1 was applied for a CS > 200 (×10°); for an elevation of < 180 m, a constant value of 60.0 nmol L−1 was applied for a CS > 50 (×10°).

The water temperature (WT in °C) was computed from the air temperature (AT in ×10 °C) from RiverATLAS68, according to:

$${{{{{\rm{WT}}}}}}=0.00054 \times {{{{{{\rm{AT}}}}}}}^{2}-0.0964 \times {{{{{\rm{AT}}}}}}+15.2 \\ (r^{2}=0.93,n=371)$$
(5)

FCO2, FCH4, FN2O between surface waters and the atmosphere was computed according to:

$$F=k \times \varDelta G$$
(6)

where k is the gas transfer velocity (m d−1) and ΔG is the air-water gradient of a given gas.

The k normalized to a Schmidt number (Sc) of 600 (k600 in m d−1) was derived from the parameterisation as a function slope and stream water velocity47:

$${k}_{600}=2.02(\pm 0.21)+2841(\pm 107)\, \times V \times S$$
(7)

where V is stream velocity (m s−1) and S is stream slope (unitless).

k600 was converted to k for the Sc at in-situ temperature47 according to:

$$k={k}_{600} \times {(Sc/600)}^{-0.5}$$
(8)

The values of S are given by RiverATLAS68 and V was computed from discharge (Q in m3 s−1) also given by RiverATLAS68 according to5:

$${{{{\mathrm{ln}}}}}({{{{{\rm{V}}}}}})=0.12\,\times\,{{{{\mathrm{ln}}}}}({{{{{\rm{Q}}}}}})-1.06$$
(9)

A Monte-Carlo error analysis was made by propagating errors (10,000 iterations) on the slope and constant of the equations to compute k600 and the gas concentrations (refer to above equations), and an error of ±1 °C for water temperature.