# Kalhori2023_Rewetted Peatland_GHG Analysis *** ## Description The repository contains the codes produced for the article "Long-term flux measurements suggest dynamic emission factors are needed for rewetted peatlands" by Aram Kalhori, Christian Wille, Pia Gottschalk, Zhan Li, Josh Hashemi, Karl Kemper, and Torsten Sachs. The codes are provided for quality control & footprint analysis (MATLAB codes); gap-filling methods/performances including validation processes; flux partitioning; regression analysis; and trend/slope estimates (R codes) for Eddy Covariance flux data. The MATLAB code for footprint analysis includes the half-hourly data for land surface classes that are combined with half-hourly 2D footprint matrices calculated using the analytical footprint model of Kormann and Meixner (2001). The R codes in this repository contain a suite of external packages listed below that are required for data analysis in this manuscript. In the article, the authors present the cumulative emissions of carbon dioxide (CO2) and methane (CH4) in a rewetted peatland in Germany using longterm year-round flux measurements. The accompanying data are published as: Kalhori, A.; Wille, C.; Gottschalk, P.; Li, Z.; Hashemi, J.; Kemper, K.; Sachs, T. (2023): Long-term CO2 and CH4 flux measurements and associated environmental variables from a rewetted peatland. GFZ Data Services. https://doi.org/10.5880/GFZ.1.4.2023.004 Keywords: trace gases, carbon dioxide, methane, peatlands, rewetting, emission factors, eddy covariance, climate mitigation ## Affiliated scientific institutions Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Telegrafenberg, 14473 Potsdam, Germany ## Corresponding authors In case you have any questions about the codes and/or analyses presented in this repository, please contact Aram Kalhori (Ed.) (aram.kalhori@gfz-potsdam.de) OR Torsten Sachs (torsten.sachs@gfz-potsdam.de) and Christian Wille (christian.wille@gfz-potsdam.de). ## Installation This software is written in R and MATLAB. Running the codes (R files and .m files (Code)) and loading the data files (CSV files, Kalhori et al., 2023, https://doi.org/10.5880/GFZ.1.4.2023.004) requires the pre-installation of [R and RStudio] (https://posit.co/downloads/) and ([MATLAB](/https://de.mathworks.com/products/matlab.html). The RStudio 2022.07.2 Build 576 version has been used for the R scripts. The land cover classification work was performed in QGIS, v.3.16.11-Hannover. Data were analyzed in both MATLAB and R; and plots created with R (R Core Development Team 2020) in RStudio®. Data are provided as .shp, .m, CSV or text files. The MATLAB scripts for footprint calculation and the R scripts used for gap-filling (missForest) and flux partitioning (REddyProc) are also included. The full description of the data and methods is provided in the manuscript. ## Code Usage To obtain the results as presented in the publication, the operator has to first download the whole repository, and afterwards run the scripts in the codes provided for both MATLAB and R. In case the operator wishes to use a command line based approach, the code can be run in MATLAB or R by first navigating to the predesigned directory, for example (please replace the address with the location where your files are stored): ``` cd C:/Users/Documents/Kalhori2023/Codes ``` ## Data Usage The data provided here is an exemplary dataset from one year (2018). The complete dataset that is needed to run the codes for all the years can be obtained from the European Flxues Database Cluster under site ID DE-Zrk or provided upon request. This repository is intended to provide the necessary MATLAB and R code to reproduce the results by Kalhori et al. (2023). The code can be freely used and adapted to own needs. cd C:/Users/Documents/Kalhori2023/Data ## License The codes and data are licensed as follows: Files: *md & Data
Data/Kalhori2023_Rewetted Peatland_2018 dataset Copyright: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences License: CC-BY-4.0 Files: Codes/Kalhori2023_code for Rewetted Peatland_GHG analysis Copyright: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences 2023 Aram Kalhori 2023 Christian Wille License: GPL-3.0-only The following external packages are required to be incorporated into the codes in order to run the provided codes: "zyp" package; "missForest" package;"REddyProc" package Files: Codes/Kalhori2023_SenSlopes_fig2.r "zyp" package, Maintainer David Bronaugh Depends R (>= 2.4.0), Kendall License: LGPL-2.1 https://CRAN.R-project.org/package=zyp Files: Codes/Kalhori2023_gapfillingMF_validation_figSI1.r "missForest" package, Maintainer Daniel J. Stekhoven Depends randomForest,foreach,itertools License: GPL (>= 2) https://www.r-project.org, https://github.com/stekhoven/missForest Files: Codes/Kalhori2023_NEEpartitioning.r "REddyProc" package, Maintainer Thomas Wutzler Depends R (>= 3.0.0), methods Imports Rcpp, dplyr, purrr, rlang, readr, tibble, magrittr, solartime, bigleaf (>= 0.7) License: GPL (>= 2) https://www.bgc-jena.mpg.de/bgi/index.php/Services/REddyProcWeb ## Citation Please cite the following publication if you have used this repository for your own work: Kalhori, Aram; Wille, Christian; Gottschalk, Pia; Li, Zhan; Hashemi, Josh; Kemper, Karl; Sachs, Torsten (2023): Rewetted Peatland_GHG Analysis Code/Kalhori2023. GFZ Data Services. https://doi.org/10.5880/GFZ.1.4.2023.001 ## Authors and acknowledgment The script to analyze the data has been developed by Aram Kalhori and Christian Wille. Please make sure you are complying with all licenses before using the material published in this repository. ###### (Data repository) This dataset repository contains the GHG and meteorological data (for one year as an exemplar year) as well as classified image (one year as an exemplar year) used in the article "Long-term flux measurements suggest dynamic emission factors are needed for rewetted peatlands" by Aram Kalhori, Christian Wille, Pia Gottschalk, Zhan Li, Josh Hashemi, Karl Kemper, and Torsten Sachs.
"The authors estimate the cumulative emissions of carbon dioxide (CO2) and methane (CH4) in a rewetted peatland in Germany using the long-term ecosystem flux measurements, revealing the temporal patterns of annual CO2 and CH4 fluxes."
"In this article, the authors observe a source-to-sink transition of annual CO2 fluxes and a decrease in annual CH4 emissions over the entire study period and outline that the currently-used emission factors (EFs) are temporally static and lack datasets representing broader range of site characteristics within post-rewetting phases. Hence, the results here call for temporally dynamic EFs in rewetted peatlands. This dataset contains one-year eddy covariance observations of land surface-atmosphere net ecosystem exchange of CO2 & CH4 fluxes and ancillary meteorological measurements at a rewetted fen site (DE-Zrk) in Northeast Germany. A full range of classified images (.shp files) that cover the entire study period are also present (upon request from the corresponding authors) here to combine with half-hourly footprint information in determining the fraction of signal originating from different land surface classes. According to the terms of the relevant license agreements, the complete dataset that is needed to run the codes for all the years can be requested through Aram Kalhori (aram.kalhori@gfz-potsdam.de), Torsten Sachs and Christian Wille (torsten.sachs@gfz-potsdam.de & christian.wille@gfz-potsdam.de), otherwise, the half-hourly, daily, monthly codes should be still running with one year of data."