DOI: 10.6084/m9.figshare.15015396.v1
title: Matlab code for algorithm of detection of CO2 emissions produced by ventilation

description: Matlab code with the novel algorithm designed to automatically detect VE-driven CO<sub>2</sub> emissions among the FLUXNET2015 (https://fluxnet.fluxdata.org), AmeriFlux (http://ameriflux.lbl.gov), OzFlux (http://www.ozflux.org.au) and AsiaFlux (http://www.asiaflux.net) databases. <br> Our algorithm aims at detecting VE over periods when subterranean ventilation may prevail over other processes. The algorithm was designed based on previous research reflected in the following assumptions: (1) atmospheric turbulence must be sufficient to pump CO<sub>2</sub>-rich air from the vadose zone to the atmosphere; (2) no nocturnal VE happens due to soil re-humidification; (3) the required variability in air temperature and soil moisture must be insufficient to explain variations of net CO<sub>2</sub> emissions (i.e. incompatible with an ecophysiological interpretation of fluxes, such as the Birch effect at the end of the dry season). <br> A temporal window is needed to statistically discriminate subterranean CO<sub>2</sub> release due to changes in air temperature (e.g. with the passage of high and low pressure systems and fronts) or soil moisture. Although VE is an abrupt process, considering previous research, a period of five days with sustained high-turbulence, similar mean air temperature and dry conditions was considered as unequivocal to detect VE. Thus, we applied the algorithm to five-day intervals over one-year for each selected site. <br> In accordance with the above assumptions, we filtered these data according to the following criteria: (1) only daytime [shortwave radiation incoming (SW_IN) or photosynthetic photon flux density incoming (PPFD_IN) &gt; 50 W m<sup>-2</sup>], (2) positive fluxes [net ecosystem exchange (NEE) or net carbon dioxide flux (F<sub>c</sub>) &gt; 0 µmolCO<sub>2</sub> m<sup>-2</sup> s<sup>-1</sup>], (3) maximum mean air temperature (TA) absolute difference between days 1 and 5 of 3 °C, (4) maximum mean soil water content (SWC) absolute difference between days 1 and 5 of 1 %, (5) null precipitation [P &gt; 0.00001] and (6) high-turbulence conditions [u<sub>*</sub> &gt; 0.2 m s-1] data were used. Furthermore, to reduce the potential effect of data availability on the number of VE detected our algorithm, only five-day intervals with a minimum number of data [N&gt;40] and CO<sub>2</sub> maximum quality [flag qc = 0] were used. Finally, we are gathered an indicator of data availability for each site and year analyzed (see Table S1). We computed Partial Spearman correlation coefficients over each five-day period filtered to eliminate spurious correlation effects between F<sub>c</sub> (µmolCO<sub>2</sub> m<sup>-2</sup> s<sup>-1</sup>) and ancillary data. Ancillary variables considered in partial correlation were: air temperature, vapor pressure deficit, soil temperature, atmospheric pressure, soil water content, photosynthetic photon flux density incoming, incoming shortwave radiation and friction velocity. Only five-day intervals with a partial Spearman correlation coefficients between F<sub>c </sub>and u<sub>*</sub> above 0.2 and <em>p </em>&lt; 0.05 (support the evidence of the alternative hypothesis, i.e. non-zero partial correlation, being significantly different from the null hypothesis, i.e. zero partial correlation) were considered as VE events. The software Matlab was used for statistical analyses (Matlab R2017a). <br> In order to balance the different dataset duration among analyzed sites as well as to simplify our analysis, results shown in this study correspond to one year of data per site. We have considered the assumption that experimental sites where VE were not detected after analyzing four years of data are not VE predisposed sites (in accordance with our algorithm design). Thus, the algorithm was performed to the available datasets under the next conditions: (1) for site-specific databases lasting from one to four years, the algorithm was applied to the whole database; (2) for site-specific databases lasting from five to six years, the algorithm was applied to the first four consecutive years; (3) for site-specific databases lasting more than six years, the algorithm was applied to the first four non-consecutive years. In those sites where VE-driven CO<sub>2</sub> emissions were detected over several years, the year finally selected corresponded to the one with more VE detected. The list of FLUXNET and regional EC networks sites used in this study with respective basic information appears in the supporting information (tables S1, S2 and S3).<br> <br> The list of FLUXNET and regional EC networks sites used in the study with respective basic information appears in the supporting information (tables S1, S2 and S3) of "ECOSYSTEM CO2 RELEASE DRIVEN BY WIND OCCUR IN DRYLANDS AT GLOBAL SCALE" DOI: 10.1111/gcb.16277 <br> <br> <br>