Technical note: CO2 is not like CH4 – limits of and corrections to the headspace method to analyse pCO2 in fresh water

Headspace analysis of CO2 frequently has been used to quantify the concentration of CO2 in fresh water. According to basic chemical theory, not considering chemical equilibration of the carbonate system in the sample vials will result in a systematic error. By analysing the potential error for different types of water and experimental conditions, we show that the error incurred by headspace analysis of CO2 is less than 5 % for typical samples from boreal systems which have low alkalinity (< 900 μmol L−1), with pH < 7.5, and high pCO2 (> 1000 μatm). However, the simple headspace calculation can lead to high error (up to −300 %) or even impossibly negative values in highly undersaturated samples equilibrated with ambient air, unless the shift in carbonate equilibrium is explicitly considered. The precision of the method can be improved by lowering the headspace ratio and/or the equilibration temperature. We provide a convenient and direct method implemented in an R script or a JMP add-in to correct CO2 headspace results using separately measured alkalinity.


Introduction
The analysis of dissolved CO 2 in water is an important basis for the assessment of the role of surface waters in the global carbon cycle (Raymond et al., 2013). Indirect methods like calculating CO 2 from other parameters like alkalinity and pH (Lewis and Wallace, 1998;Robbins et al., 2010) are affected by considerable random and systematic errors (Golub et al., 2017) caused for example by dissolved organic carbon, which may result in significant overestimation of the CO 2 partial pressure (pCO 2 ) (Abril et al., 2015), or by pH measurement errors (Liu et al., 2020). Thus, direct measurement of CO 2 is highly recommended, particularly in soft waters.
Headspace analysis is a standard method to analyse the concentration of dissolved gases in liquids (Kampbell et al., 1989). In principle, a liquid sample is equilibrated with a gaseous headspace in a closed vessel under defined temperature. The partial pressure of the gas in the headspace is analysed, in most cases either by gas chromatography or infrared spectroscopy. The concentration of the dissolved gas in solution is then calculated by applying Henry's law after correction for the amount of gas transferred from the solution to the headspace.
In freshwater research this is the widely applied standard method to analyse the concentration of greenhouse gases such as CH 4 and N 2 O (UNESCO/IHA, 2010). The method is handy, does not depend on sophisticated equipment in the field, and provides reliable results. Papers and protocols using this method have also been published to analyse dissolved CO 2 concentrations in fresh waters (UNESCO/IHA, 2010;Cawley, 2018;Lambert and Fréchette, 2005). However, CO 2 cannot be treated like CH 4 because CO 2 is in dynamic chemical equilibrium with other carbonate species in water while CH 4 is not (Stumm and Morgan, 1981;Sander, 1999). Depending on the CO 2 concentration and pH, reactions of the carbonate equilibrium will either produce or consume some CO 2 in the sample vessel (Cole and Prairie, 2009). Although this is textbook knowledge and has been considered in some recent papers (Golub et al., 2017;Gelbrecht et al., 1998;Rantakari et al., 2015;Aberg and Wallin, 2014;Horn et al., 2017), and is standard practice in marine research (Dickson et al., 2007), a practical evaluation of the systematic error when applying simple headspace analysis to CO 2 in typical fresh waters is missing, presumably because it is widely assumed that "the effect is likely small" (Hope et al., 1995). In this paper, we aim to quantify the error associated with the simple application of Henry's law on headspace CO 2 data, present practical guidelines describing conditions under which the simple headspace analysis of CO 2 can give acceptable results, and offer a convenient tool for the exact CO 2 calculation that accounts for the carbonate equilibrium shifts in the sample equilibration vessel. The approach can also be used for correcting previous results obtained by simple headspace analysis of CO 2 using additional information regarding the carbonate system (i.e. alkalinity or DIC), a procedure we tested on a set of field measurements where pCO 2 was determined with independent methods (with and without headspace equilibration). Lastly, we evaluated how likely it is for this correction to be required when using a large dataset from 337 diverse Canadian lakes.

Theoretical considerations
If a water sample is equilibrated with a headspace initially containing a known pCO 2 (zero in case N 2 or another CO 2free gas is used), some CO 2 is exchanged between water and headspace, resulting in an altered dissolved inorganic carbon (DIC) concentration in the water of the sample, thereby altering the equilibrium of the carbonate system in the water. Depending on partial pressure of CO 2 in the water relative to the headspace gas prior to equilibration, some CO 2 will either be produced from HCO − 3 or converted to HCO − 3 . The exact amount will depend on temperature, pH, total alkalinity (TA), and the original pCO 2 of the water sample. If a CO 2free headspace gas was applied, the vessel will finally contain more CO 2 than before equilibration, and consequently simply applying Henry's law results in too high a pCO 2 value. If an ambient-air headspace is applied, the error becomes negative in undersaturated samples and the calculated pCO 2 an underestimate.
To calculate this error we implemented an R script that simulates the above-mentioned physical and chemical equilibration for a wide range of hypothetical pCO 2 , alkalinity, temperature, and headspace ratio (HR = V gas /V liquid ) values. As output, we then compared the corrected (for the chemical equilibrium shift) and non-corrected pCO 2 values. All simulations were performed at 1 atm total pressure and results expressed as µatm.

Field data
As a further validation of our simulations, we used various datasets for which the pCO 2 was determined in multiple ways. We collated 266 observations from four reservoirs and three streams in Germany, 10 Canadian lakes, and a Malaysian reservoir exhibiting a wide range of TA between 0.03 and 1.9 mmol L −1 and pH between 5.2 and 9.8. Two independent techniques were used to measure water pCO 2 in each sampling site: the in situ non-dispersive infrared (NDIR) technique and the headspace equilibration technique. The same NDIR technique was used for all sites, while the headspace technique differed slightly between sites. First, for the in situ NDIR technique, the water was pumped through the lumen side of a membrane contactor (MiniModule, Membrana, USA) (Cole and Prairie, 2009), and the gas side was connected to a NDIR analyser (EGM4, PP Systems, USA; or LGR ultra-portable gas analyser) in a counterflow recirculating loop. Readings were taken when the CO 2 mole fraction (mCO 2 , ppm) values of the NDIR analyser became stable (fluctuating ±3 ppm around the mean), at which point the gas loop was in direct equilibrium with the sampled water. Finally, pCO 2 of the water was calculated by multiplying the mCO 2 by the ambient atmospheric pressure. Second, for the headspace technique, the methodology differed slightly among locations. In the German reservoirs, about 40 mL of water sample were taken in 60 mL syringes, and eventually occurring bubbles were pushed out by adjusting the sample volume to 30 mL. Samples were stored at 4 • C and analysed within 1 d. In the laboratory, 30 mL of pure N 2 gas was added to the syringes after the samples had reached laboratory temperature, and the syringes were shaken for 1 h at laboratory temperature. After headspace equilibration, the water was discarded from the syringes and the headspace was manually injected into a gas chromatograph equipped with a flame ionization detector (FID) and a methanizer (GC 6810C, SRI Instruments, USA). In the Canadian lakes, 20 mL samples were taken in 60 mL syringes and equilibrated with a 40 mL volume of atmospheric air by vigorously shaking the syringes for 2 min. In the Malaysian reservoir, 600 mL of water samples was taken in 1.2 L of glass bottles and equilibrated with 611.5 mL of atmospheric air in 2016. In consecutive years, diverse volumes of water samples were taken in 60 or 100 mL syringes and equilibrated with diverse volumes of calibrated air brought from the laboratory. The equilibrated air was immediately transferred to and stored in 12 mL pre-evacuated exetainer vials (Labco Ltd, UK) and returned to the laboratory where it was injected into a gas chromatograph (GC-2014, Shimadzu, Kyoto, Japan) equipped with a FID. The original water pCO 2 was then calculated according to the headspace ratio, temperature, and the measured headspace mCO 2 as follows: where mCO 2 Before eq and mCO 2 After eq are the CO 2 mole fractions in the headspace before and after equilibrium (ppm) respectively, K h Eq and K h Sample are the gas solubility at the equilibration temperature and at the sampling temperature (Henry coefficient, Sander, 2015) (mol L −1 atm −1 ), P is pressure (atm), V gas is the headspace volume, V liquid is the sampled-water volume, and V m is the molar volume (L mol −1 ) (UNESCO/IHA, 2010). Results from Eq.
(1) are reported as pCO 2 at 1 atm of barometric pressure and are corrected for ambient pressure at the time of sampling by multiplying with the in situ atmospheric pressure. The difference between the headspace and NDIR method was divided by the pCO 2 measured by the in situ NDIR analysis and expressed as percent (%) error. In addition, temperature and pH of the water were measured in situ by a CTD probe (Sea and Sun, Germany) or a portable pH meter (pH meter 913, Metrohm Ltd, Canada). In samples from Canada and Germany, TA was analysed by titration with 0.11 N HCl. In some systems, a single TA measurement was available for multiple dates and therefore assumes little temporal variability in the alkalinity of these systems. In the Malaysian samples, TA was derived from dissolved inorganic carbon (DIC) measurements and pH. Analysis of certified calibration gases showed that the analytical error of both the NDIR instrument and GC was < 0.37 % at 1000 ppm. Analysis of seven replicate samples by our GC-headspace method gave a standard deviation of 6 %. This includes all random errors due to sampling, sample handling, and analysis.
To demonstrate the effect of our correction procedure, we used data from 377 lakes for which we had complete ancillary data and precise headspace measurements of CO 2 (< 5 % error between duplicates) obtained from the pan-Canadian Lake Pulse sampling programme ( Fig. B1a; see Huot et al., 2019 for details).

Simulations from chemical equilibrium
Applying a CO 2 -free gas as headspace always results in a positive error (overestimation of the real pCO 2 , Fig. 1a). If ambient air is applied as headspace, the error becomes negative in case of undersaturated samples (Fig. 1b). In general, the error tends to be lower if ambient air is used for headspace equilibration (Fig. 1b) compared to equilibration with CO 2 -free gas (Fig. 1a), except in undersaturated conditions. This is because less CO 2 is exchanged between water and headspace during the equilibration procedure. The error will be below 5 % in supersaturated and low-alkalinity . Error (%) when applying simple headspace calculations of pCO 2 on hypothetical water samples of different alkalinity and pCO 2 in the headspace after equilibration for (a) CO 2 -free gas headspace and (b) ambient-air headspace assuming a pressure of 1 atm. The resulting pH and pCO 2 of the samples are depicted as full and dashed lines, respectively. The headspace ratio is 1 : 1, and the equilibration and field temperature is 20 • C. Note the log scale in all axes. In panel (b) results for pCO 2 in headspace after equilibration lower than 215 µatm are masked, because they would imply negative pCO 2 in the sample.
(< 900 µmol L −1 ) samples, which are typical for boreal regions. However, the error can be higher than 100 % if the samples are undersaturated. The magnitude of the error is predictable from pH. Because of the carbonate equilibrium reactions, high pH is necessarily accompanied by low pCO 2 for a given alkalinity. Consequently, the error is large at high pH, while it is below 10 % at pH < 8 (headspace gas-liquid ratio of 1 : 1).
Our field dataset is consistent with the theoretical predictions. While the fit between the simple headspace calculation and NDIR values over the whole range of values can be considered adequate overall (Fig. 2a, R 2 = 0.92), it is clear that the deviations can become very large (up to about 300 %), particularly at water pCO 2 values < 600 µatm (Fig. 2b). As expected from the simulations, the error in undersaturated samples was positive when using CO 2 -free gas as headspace and negative (sometimes impossible negative results) when Figure 2. (a) Field data from 11 lakes, five reservoirs, and three streams in Germany, Canada, and Malaysia comparing pCO 2 derived from simple headspace analysis with direct pCO 2 measurements by NDIR analysis (pH colour coded). Note the cube-root scale in both axes. (b) Difference between the pCO 2 derived from the simple headspace analysis and the direct pCO 2 measurements by NDIR analysis expressed as error (%) as a function of the directly measured pCO 2 by NDIR analysis. Note the cube-root scale in the x axis. Opencircle symbols: ambient-air headspace; closed-circle symbols: CO 2 -free gas headspace; and closed-square symbols: pre-measured-CO 2 gas (between 150 to 250 ppm) headspace applied.
using ambient air (Fig. 2b). The error became negligible at pCO 2 above 1000 µatm (Fig. 2b). Data scatter was considerable as was observed previously (Johnson et al., 2010), most probably because the analytical error of the applied methods was often in the same range as the absolute difference between both methods.

Error magnitude depends on the experimental procedure
The maximum error depends on how much CO 2 is exchanged between water and headspace. The more gas is exchanged between water and headspace the higher the error is. Thus, the error increases with decreasing solubility coefficient or HR. In high-alkalinity samples, the error can be significantly reduced by using a smaller headspace-to-water ratio (Fig. 3). By lowering the headspace ratio from 1 to 0.2 at 20 • C, the error can be reduced from about 50 % to about 10 %. Since solubility of CO 2 depends on temperature, the equilibration temperature also affects headspace equilibration. Due to lower solubility at higher temperature, more gas evades into the headspace, and thus the error increases with increasing temperature (Fig. 3a, b). At a HR of 1, the error increases from 97 % at 20 • C to 111 % at 25 • C in a high (1 mmol L −1 ) alkalinity sample. Thus, the error can be significantly reduced by lowering the equilibration temperature. A possible way to take advantage of this is to perform headspace equilibration at in situ temperature in the field, as has been done in several studies. If in situ water temperature is lower than typical laboratory temperature, the error is thereby reduced. However, care must be taken to make sure that the exact equilibration temperature is known. For example, an error of 1 • C in the equilibration temperature results in a 2 % different pCO 2 value (TA = 1 mmol L −1 , pCO 2 = 1000 µatm, HR = 1) (Fig. A1a). Both ambient air and N 2 can be used as headspace gas. Using N 2 , however, eliminates the error associated with the exact quantification of pCO 2 Before . Using the same example, an unlikely error of 100 ppm in the headspace gas (mCO 2 Before eq ) results in a 6.4 % different pCO 2 result (Fig. A1b).

What about kinetics?
CO 2 reactivity with water would not cause a problem for headspace analysis if the reaction kinetics were slow compared to physical headspace equilibration. The slowest reaction of the carbonate system is the hydration of CO 2 , which has a first-order rate constant of 0.037 s −1 (Soli and Byrne, 2002), so that chemical equilibration of CO 2 in water is in the range of seconds (Zeebe and Wolf-Gladrow, 2001;Schulz et al., 2006). This means that chemical equilibrium reactions are faster than physical headspace equilibration, and the chemical system can be assumed to always be in equilibrium. Thus, the reactions of the carbonate system have to be fully considered in headspace analysis of CO 2 .

Correction of CO 2 headspace data
If other information regarding the carbonate system of the sample is known (alkalinity or DIC), one can correct for the bias induced by simple headspace calculations. A procedure to correct headspace CO 2 data using pH and alkalinity is already available in the standard operating procedure (SOP) no. 4 in Dickson et al. (2007) for marine samples and could be adapted to freshwater samples as well. For convenience, we provide here a modified procedure when the alkalinity of the sample is known by introducing an analytical solution to the equilibrium problem (iterative in SOP no. 4) and by using dissociation constants that may be more appropriate to fresh waters. The procedure essentially involves estimating the exact pH of the equilibrium solution before and after equilibration. If the alkalinity of the sample is known, the pH (−log 10 [H + ]) of the aqueous solution after equilibration can be obtained by finding the roots of the third-order polynomial: where [CO 2 ] = pCO 2 · K h Eq and from which one can obtain the ionization fraction for CO 2 (α CO 2 ) as where K 1 and K 2 are the temperature-dependent equilibrium constants for the dissociation reactions for bicarbonates and carbonates, respectively (Millero, 1979), and for estuarine conditions (Millero, 2010), as amended in Orr et al. (2015).
K w is the dissociation constant of water into H + and OH − (Dickson and Riley, 1979). The total DIC contained in the original sample (DIC orig ) can then be calculated as DIC orig = CO 2 α CO 2 + (CO 2 HS after − CO 2 HS before ) , where CO 2 is the amount of CO 2 in the equilibrated water (mol), and CO 2 HS after and CO 2 HS before are the amount of CO 2 in the headspace after and before equilibration (mol). Given the DIC concentration of the original solution from Eq. (4) ([DIC] = DIC orig /V liquid ), the pH of this solution prior to equilibration can be obtained by finding the roots of the fourth-order polynomial, to then estimate the corresponding ionization fraction α CO 2 as in Eq. (3) above and calculate the original pCO 2 of the sample as Figure 4. Comparison of uncorrected and corrected data with direct pCO 2 measurements by NDIR analysis. Note the cube-root scale in both axes. Open-circle symbols: ambient-air headspace; closedcircle symbols: CO 2 -free gas headspace; and closed-square symbols: pre-measured-CO 2 gas (between 150 to 250 ppm) headspace applied.
where K h Sample is determined for the water temperature during field sample collection (for simplicity, the equations above assume 1 atm pressure). We applied the above correction procedure to our samples, where pCO 2 was measured in several samples using both headspace and in situ NDIR methods together with measured alkalinity data. Figure 4 shows that the corrected values matched the in situ NDIR values nearly perfectly (r 2 = 0.98), whereas the simple headspace calculations resulted, as expected, in significant underestimation for undersaturated conditions, particularly for samples equilibrated with ambient air.
We examined the sensitivity of the correction procedure to the precision of the alkalinity measurements and found that the error associated with alkalinity determination does not severely impact the final pCO 2 estimate when using N 2 as a headspace gas. For example, the error in the corrected pCO 2 values is always below 20 % even when the alkalinity is known only to within 50 % error (Fig. 3c). However, more precise alkalinity values are required when using ambient air as a headspace gas in undersaturated conditions (Fig. 3d).
Lastly, our simulations (Figs. 2 and 4) provide a complete analysis of the effects of the environmental and methodological conditions on the error incurred when using the simple headspace technique for estimating pCO 2 . However, they do not assess how often such problematic conditions occur in inland water systems. To address this question, we applied our correction procedure to a dataset from 377 Canadian lakes (Huot et al., 2019). These results show a significant deviation between corrected and uncorrected values, particularly in lakes with high alkalinity (> 900 µmol L −1 , Fig. B1b), and ignoring the correction would have resulted in errors > 20 % in about 47 % of the data. Furthermore, our analysis illustrates how a larger headspace ratio significantly exacerbates the magnitude of the error (Fig. B1b).
The correction calculations have been implemented in an R script and, for a user-friendly interface, as a JMP addin (or JSL script) (https://github.com/icra/headspace, last access: 3 March 2021). Roots of the polynomials (Eqs. 2 and 5) can be solved using either standard analytical formulas or by iterative algorithms. For the analytical solution, our script uses a combined form of the computational steps described in Zwillinger (2018) for both the cubic and quartic polynomials to find their first real roots. Analytical solutions are faster than iterative algorithms but can suffer small numerical instabilities (SD ≈ 1 ppm) in extreme situations (alkalinity > 4000 µmol L −1 and pCO 2 < 100 ppm) due to limitations inherent to double-precision numerical calculations. The provided scripts consider the barometric pressure and thus allow calculation of pCO 2 as well as CO 2 concentration (µmol L −1 ) for in situ conditions.

Conclusions
The headspace method has been used in several studies about CO 2 fluxes from surface waters. Our error analysis shows that the usual headspace method can be used (error < 5 %) if the pH is below 7.5 or pCO 2 is above 1000 µatm (TA < 900 µmol L −1 , air headspace), a typical situation in most boreal systems. However, the standard headspace method introduces large errors and cannot be used reliably for undersaturated samples, which are typical of eutrophic or low-DOC systems. In all other cases, not accounting for the chemical equilibrium shift leads to a systematic overestimation. The magnitude of the error can be reduced by increasing the water-headspace ratio or lowering the equilibration temperature. The magnitude of that error can be roughly estimated from Fig. 1. If alkalinity is known, pCO 2 obtained from headspace equilibration can be corrected by the provided scripts. We therefore recommend to always measure alkalinity if the headspace method is to be used for pCO 2 determinations. The procedure can also be used to correct historical pCO 2 data. Our field data showed that the correction works well even in highly undersaturated conditions and is not very sensitive to the precise determination of alkalinity if N 2 is used as a headspace gas. The precision of the corrected pCO 2 is similar to that obtained from direct pCO 2 measurement using a field NDIR analyser coupled to an online equilibrator (Cole and Prairie, 2009;Yoon et al., 2016).
Appendix A: Sensitivity analysis equilibration temperature and CO 2 Beforeeq Figure A1. Error for a hypothetical sample with CO 2 Before eq = 400 ppm, CO 2 after eq = 1000 ppm, equilibration temperature of 20 • C, and HR = 1 (a) depending on error in equilibration temperature and (b) depending on error in initial headspace gas composition.
Appendix B: Application of our correction to a large Canadian dataset Figure B1. Field data from 377 lakes across Canada (a) for comparing pCO 2 derived from simple headspace calculation with that from the corrected headspace calculation according to this paper (Log 10 [TA (µmol L −1 )] colour coded). (b) Difference between the uncorrected and corrected pCO 2 expressed as error (%) as a function of TA (µmol L −1 ) (the headspace ratio colour coded). Note that CO 2 -free gas was used for headspace, and TA values were derived from DIC measurement and pH. More information about the dataset can be found in Huot et al. (2019).
Data availability. All data can be found in the Supplement.
Author contributions. All authors conceived the story, performed calculations, and wrote the manuscript. JK, YTP, and RM wrote codes. MK and JK contributed field data.
Competing interests. The authors declare that they have no conflict of interest.
Acknowledgements. We thank Philipp Keller, Peifang Leng, Lelaina Teichert, and Cynthia Soued for sharing additional field data as well as Alo Laas for logistic support. We thank Miitta Rantakari, Marcus Wallin, and Pascal Bodmer for stimulating discussions as well as Bertram Boehrer for commenting on the manuscript. We also thank Matt T. Trentman, Joanna R. Blaszczak and Robert O. Hall Jr. for an independent check of our calculations during the public discussion of the manuscript. Rafael Marcé participated through the project C-HYDROCHANGE, funded by the Spanish Agencia Estatal de Investigación (AEI) and Fondo Europeo de Desarrollo Regional (FEDER) under the contract FEDER-MCIU-AEI/CGL2017-86788-C3-2-P. Rafael Marcé acknowledges the support from the Economy and Knowledge Department of the Catalan Government through the Consolidated Research Group (ICRA-ENV 2017 SGR 1124), as well as from the CERCA programme. Jihyeon Kim and Yves T. Prairie were funded by the Natural Sciences and Engineering Research Council of Canada. This is a contribution to the UNESCO Chair in Global Environmental Change.
Financial support. This research has been supported by the Spanish Agencia Estatal de Investigación (AEI) and Fondo Europeo de Desarrollo Regional (FEDER) (grant no. FEDER-MCIU-AEI/CGL2017-86788-C3-2-P) and the Economy and Knowledge Department of the Catalan Government (grant no. ICRA-ENV 2017 SGR 1124).
The article processing charges for this open-access publication were covered by a Research Centre of the Helmholtz Association.
Review statement. This paper was edited by Peter Landschützer and reviewed by Matt Trentman and two anonymous referees.