HYDROLOGIC MODELING OF ALASKAN BOGS: A SYNTHESIS OF A SOIL RESPIRATION STUDY IN A COASTAL TEMPERATE RAINFOREST MASTER OF ENGINEERING REPORT Presented to the Department Of Biological and Environmental Engineering At Cornell University By Rosemary R. Yardley, B.S. Ithaca, NY Faculty Advisor: Dr. Todd Walter May 2014 ABSTRACT This report examines some preliminary results of a study done in the North American Pacific coastal temperate rainforest (NCTR) and outlines a hydrologic model created to address some critical data gaps. The NCTR runs from northern California to south-central Alaska and is characterized by a cool and perennially humid climate. Recent studies have found that the NCTR contains a globally significant stock of soil organic carbon that is sensitive to soil moisture and temperature changes. While work has been done to investigate the impacts on CO2 export from soils, little has been done to examine other greenhouse gases. This study aims to fill these information gaps and examine methane and nitrous oxide soil emissions, in conjunction with additional carbon dioxide fluxes. We measured the response of the greenhouse gas fluxes to soil moisture and temperature across three systems along a hydrologic gradient: fen, forested wetland, and upland. We found negligible nitrous oxide levels and comparable carbon dioxide levels to previous studies. However, we found large spikes of methane (up to about 2.0 μmoles m-2 s-1) from one fen in particular. This same fen exhibited a much higher water table than we anticipated, causing our soil water measuring devices to reach their maximum value early in data collection. This resulted in major data gaps for soil water table values, which have been shown to be the major driver of methane emissions in waterlogged systems. Therefore, I created a hydrologic model of the system so as to simulate the hydrology and fill in the data gaps that are critical to our analysis of the NCTR greenhouse gas study. iii TABLE OF CONTENTS Title page………………………………………………………………………………………………………………………i Abstract………………………………………………………………………………………………………………….…….ii Table of Contents…………………………………………………………………………………………………………iii Introduction…………………………………………………………………………………………………………….……1 Carbon Dioxide………………………………………………………………………………………….…………………..1 Nitrous Oxide………………………………………………………………………………………....……………………..2 Methane………………………………………………………………………………………………………………………..2 Greenhouse Gas Study………………………………………………………………………………………...…………3 GHG Study: Preliminary Results……………………………………………………………………………………..4 Hydrologic Model…………………………………………………………………………………………………………..5 Model: Results and Discussion………………………………………………………………………………………..6 Appendix A: Figures………………………………………………………………………………………………..……..7 Appendix B: Data Processing R Code……………………………………………………………………………..11 Appendix C: Hydrologic Model R Code…………………………………………………………………………..22 References…………………………………………………………………………………………………………………...25 1 Introduction Greenhouse gases have become increasingly studied as climate change progresses. Although a significant portion of greenhouse gas does come from human activities such as fossil fuel burning and industrial processes, there are also natural sources of emissions. Soil respiration is the production and consumption of gases, including greenhouse gases such as carbon dioxide, methane, and nitrous oxide. Soil physical factors, biological processes, and the interaction of both influence soil respiration. Microbial processes drive the gas fluxes, but the size of the flux heavily depends upon physical factors of the soil. Soil temperature and soil moisture (or water content) are particularly important factors that directly impact soil respiration rates (Smith et al. 2003). These physical factors influence microorganisms in the soil, along with root activity, thereby impacting gas fluxes. Gas diffusivity further controls the movement of gases to and from the atmosphere. Airfilled porosity determines gas diffusivity, and is inversely related to water content (Smith et al. 2003). This is another way in which soil water content impacts soil respiration. Furthermore, gas diffusivity affects soil aeration itself, thus indirectly controlling the capacity of the soil to respire gases. Carbon Dioxide Soils and vegetation are the main source of carbon dioxide emissions: levels are 10 to 15 times those emitted by fossil fuel burning (Raich and Schlesinger 1992). Previous studies have shown that the release of CO2 by aerobic respiration is a non-linear function of temperature over a wide range of soil water contents. However, it becomes a function of water content as soils dry out (Smith et al. 2003). In some ecosystems, the release of CO2 increases in response to a decrease in water table in organic soils. Based on field data, temperate and boreal forests tend to be sinks for CO2 (Goulden et al., 1996). Increases in temperature have resulted in exponential increases of CO2 flux rates from soil organic matter by heterotrophic respiration and by autotrophic root respiration (Smith et al. 2003). Studies have shown that the temperature response of CO2 emissions varies with depth. This could be related to diurnal variations in temperature or in depthdependent rates of microbial activity (increased rates of microbial activity in uppermost soil layers) (Smith et al. 2003). Soil water content has also been shown to have a significant impact on CO2 fluxes in soils (Xu & Qi, 2001). Water-filled pore space (WFPS) is particularly important. There is a wide range of soil water content at which respiration rate is largely steady, however as the soil dries out it reaches a point at which microbial activity is inhibited and respiration rate decreases. This has been shown in a Mediterranean study that found temperature to be the controlling factor for respiration in the winter and part of spring and fall, whereas in the 2 drier conditions of summer, they found water limitation to be the controlling factor (Rey et al. 2002). Though not as limiting as dry conditions, very wet conditions can also have a negative impact on respiration due to the limited aeration resulting from a high proportion of WFPS. Of particular importance to this study, the depth to the water table is also a major factor for soil respiration rates. This is particularly true in high latitudes in soils with thick organic layers. Thus, in areas like the NCTR, where the organic layer is at least one meter thick in most regions, the depth to the water table is the major control on CO2 emissions. This is likely due to the effect that the water table has on the oxygen supply to decomposer microflora (Moore & Dalva (1993), Oechel et al. (1998), and Davidson et al. (1998)). Nitrous Oxide Roughly two-thirds of nitrous oxide emissions to the atmosphere come from soils (Prather et al., 1995). Nitrous oxide (N2O) is produced in soils by two main microbial processes: nitrification of ammonium to nitrate and then to nitrate, and denitrification of nitrate to N2O (and ultimately to atmospheric nitrogen, N2). Nitrification is an aerobic process, however nitrate can be used as an electron acceptor in conditions of limited oxygen. In this case, nitrite is reduced to nitric oxide (NO) and nitrous N2O. Denitrification is an anaerobic process that requires microsites within the soil profile to avoid exposure to oxygen. These anaerobic microsites form when plant roots and microorganisms in the soil consume oxygen faster than atmospheric diffusion can replace it. The rate of nitrification, and thus N2O production, increases with WFPS (Smith et al. 2003). However, in flooded conditions N2O is typically not detectable. This is likely because any N2O that was produced via denitrification was completely reduced to atmospheric N (N2) (Smith et al. 2003). Similar to the trend seen with CO2, N2O emission rates have been reported to increase exponentially with increasing temperature (Smith et al. 2003). Presumably, this is because the anaerobic microsites in the soils increase with temperature due to the higher respiration rates that create larger oxygen gradients. In this way, increased temperature translates to an increase in denitrification rates, and thus an increase in N2O emissions from soils. Methane About 40% of total methane (CH4) emissions to the atmosphere come from soils (Prather et al., 1995). There are three main processes through which CH4 is emitted from soils: diffusion, ebullition, and aerenchyma. Diffusion is the process through which methane in solution diffuses toward the soil surface. With this pathway, a signification proportion of the methane is oxidized. Ebullition occurs when gas bubbles form in a water layer in the soil and rise to the surface. This process occurs at a more rapid speed than diffusion, and 3 thus prohibits any significant levels of oxidation. Finally, aerenchyma describes the continuous air spaces of vascular plants that live in flooded environments. The methane travels from the soil to the atmosphere via these air spaces in the plants. Diffusion, ebullition, and aerenchyma are processes by which methane is transported from the soil to the atmosphere. However, the production of methane prior to this transport occurs via microorganisms in the soil. Microbes break down organic compounds, and release methane as a by-product of decomposition. The conditions required for this decomposition include a very low redox potential as well as anaerobic space. These requirements (particularly the low redox potential), translate to the need for a waterlogged system. Therefore, methane production is commonly found in natural wetlands and flooded rice fields. While species of vegetation represented in an area does impact the rate of methane production and emission, the depth to the water table has been shown to be the greatest factor (Smith et al., 2003). This is particularly true for natural northern wetlands, where there is an increase in methane emissions with a decrease in the depth to the water table. For example, Liblik et al. (1997) looked at six peatland sites in boreal regions of America and found a logarithmic increase in methane emissions with a decrease in water table depth. Other studies have shown similar trends, such as MacDonald et al., 1998. Greenhouse Gas Study We conducted a study to investigate the response of soil greenhouse gas (GHG) fluxes to soil moisture and temperature in the North American Pacific coastal temperate rainforest (NCTR). The NCTR is characterized by a high amount of rainfall annually and moderate temperatures in both the summer and winter months. Previous studies have shown the NCTR to contain a globally significant stock of soil organic carbon, which has accumulated in response to the cool, perennially humid climate. These soil organic carbon stocks are sensitive to changes in soil moisture and temperature. Relatively recent work has been done to investigate these stocks and quantify the soil respiration of carbon dioxide (D’Amore 2011). However, there has been no investigation into other greenhouse gas fluxes from these soils. Given the high water content and large top layer of organic matter, the potential for high fluxes, particularly of methane, is high. Thus we wish to fill in important information gaps so as to better understand the response of greenhouse gases to climate change induced alterations in soil physical properties. Our sites were concentrated in southeast Alaska, and consisted of three watersheds: Eaglecrest, McGinnis, and Peterson Creek (Fig. 1). Within each watershed we had three subsites: a fen, forested wetland, and upland. A fen is usually fed by mineral-rich surface water or groundwater and is characterized by a neutral or alkaline pH. Grasses and sedges typically dominate the vegetation of a fen, and this site is of the lowest altitude on the hydrologic gradient. A forested wetland is similar to a swamp, but differs in its lack of continuously standing water. However, flooding is common. An upland is a forested area at 4 a higher elevation (highest on the hydrologic gradient). Most of the gas study focused on the fen and forested wetland, as these have conditions more conducive to high gas fluxes. We measured the greenhouse gas fluxes using two methods (Fig. 3). For the carbon dioxide measurements, we used an infrared gas analyzer (IRGA). This handheld cylindrical machine measures carbon dioxide by shining an infrared light through a gas sample into a detector. The CO2 in the sample absorbs energy, so the reduction in the level of energy that reaches the detector indicates the CO2 concentration. There were ten soil collars in a circular formation at each site for CO2 sampling. We measure nitrous oxide and methane gas fluxes via a “chamber method” as adapted from the Bioenergy group in the Soil and Water Lab at Cornell University. This method involved placing a bucket over a collar in the soil so as to seal off a “chamber” in which the gas could accumulate. We then extracted gas samples with a needle and injected them into glass vials at various time intervals. These were then analyzed via ion chromatography (IC) to obtain the concentration at each time interval, from which we could calculate the flux. In addition to the gas fluxes, we used microstations to measure soil moisture and temperature. We also collected precipitation data with rain gauges and soil water levels with wells and loggers. We monitored flumes in nearby streams at each site to obtain stream flow. GHG Study: Preliminary Results We are still in progress of analyzing the data, however some preliminary trends have emerged. Of particular importance to this report, are the methane results, as these are the starting point for the hydrologic model. However, I will note briefly what we have found with the other gases. We found comparable CO2 fluxes to previous studies. For the most part, the forested wetlands appear to be sources for CO2, while the fens are at different points sinks or sources. The general range of CO2 fluxes appear to be within -2.0 to 2.7 μmoles m-2 s-1. However, some spikes from the forested wetlands appear between 2.7 and 6.0 μmoles m-2 s-1. As expected, the nitrous oxide fluxes for all sites are negligible. Most of the fluxes range from -0.001 to 0.001 μmoles m-2 s-1, indicating virtually non-detectable levels of N2O. These results are not surprising, given the high water content in the systems. Finally, the methane fluxes proved to be quite interesting. While most fluxes centered around 0 μmoles m-2 s-1 for both the fen and the forested wetland, one fen in particular showed massive CH4 spikes at various points. At Peterson Creek fen, the methane fluxes range from 0.01 to almost 2.0 μmoles m-2 s-1. The likely cause of this is the decrease in depth to the water table, or in other words, an increase in water content at the fen. Our missing data issue further supports this hypothesis. The loggers placed in wells to measure 5 soil water content, both reached their maximum measuring capacity early in data collection. Given that the likely explanation for the methane spikes is the depth to the water table, these data points are critical to our analysis. Therefore, I created a hydrologic model so as to simulate the hydrology of the Peterson Creek fen and fill in the missing data. Hydrologic Model I based my model on the Thornthwaite-Mather (TM) model to capture the hydrology of the Peterson Creek fen (Fig. 2). The TM model is a way of determining a water budget for a watershed. It incorporates the difference between precipitation (P) and potential evapotranspiration (PET) into the soil water (SW) reservoir. Once the soil is saturated, the excess runs into the watershed storage (S). This includes lakes, groundwater, and other natural detention storage features, as indicated in the figure. A portion of the water from storage (determined by the reservoir coefficient, f) runs into the streamflow (Q) (Thornthwaite et al., 1955 and Walter, 2014). I created my model in R and maintained the same assumptions associated with the TM model: streamflow is fully driven by baseflow and is linearly related to groundwater storage, evapotranspiration is driven by soil water status and not affected by vegetation, snow melt is negligible, and soil water is equal to available water capacity on the first day of modeled flow. Further details of assumptions and parameters can be found in Appendix B. The goal of my hydrologic model is to adjust the parameters so as to simulate the observed streamflow values as accurately as possible. The TM-based model also provides a soil water output, which I will use to obtain the soil water values for the missing data points at Peterson Creek. My assumption is that by capturing the streamflow of the system, I will also capture the associated soil water values. I used the field collected rain gauge data for the precipitation values (mm/day). I obtained the potential evapotranspiration (mm/day) for each site by inputting temperature data (°C) from the Juneau Airport into an Ecohydrology Package model that determines PET from temperature. The model also incorporates the streamflow on the first day of data collection, which I had from field data as well. The parameters that I adjusted to simulate streamflow are: available water capacity (AWC) and the reservoir coefficient (f). Mathematically, AWC is the field capacity minus the wilting point, all divided by soil depth. However, I do not have the wilting point or the field capacity so I adjusted it based on a combination of knowledge about the system and the streamflow output I wish to simulate. Similarly, I adjusted the reservoir coefficient based on knowledge of the sites, and thus a reasonable range of values, and by observing the streamflow output. 6 Model: Results and Discussion I used my model to simulate the streamflow at all the fens (Eaglecrest, McGinnis, and Peterson Creek). I wanted to see how the parameters changed between sites, so as to better understand the differences and their impacts on the streamflow and to make the best decisions for the parameters at Peterson Creek. At Eaglecrest fen, I found the streamflow output most closely matched the data with an AWC of 300 and a reservoir coefficient of 0.6. This site showed the best results, as the modeled streamflow very closely matched the observed streamflow (Fig. 4). One potential explanation for this is that Eaglecrest is the site closest in proximity to the Juneau Airport, which is the temperature data I used to determine potential evapotranspiration. At McGinnis fen, I found the optimal AWC value to be 300 and the reservoir coefficient to be 0.5. This site showed a slightly less matched modeled streamflow to observed, but the peaks are still captured relatively well (Fig. 5). Finally, at Peterson Creek, I used an AWC of 50 and a reservoir coefficient of 0.9. The results are arguably the worst of all the sites, which could be explained by the fact that Peterson is the farthest site from the Juneau Airport. However, the peaks are still captured which are the most important aspect of the model, so the results can still be used to obtain the soil water table (Fig. 6). For all the sites, I found a better fit by dividing the modeled streamflow by three. This makes sense because the TM model is designed for an entire watershed, and I was applying it to a much smaller area. Furthermore, we do not have a good grasp on the area of each site, so I needed to account for the smaller scale by dividing by a constant. I obtained three as the optimal value by observing the streamflow output compared to the data. The next steps that could be taken from this project would be to use the streamflow and soil water output from the hydrologic model to calculate the simulated water table depths at Peterson Creek fen. This would fill in the data gaps necessary for a complete analysis of the soil greenhouse gas study, particularly regarding the methane spikes in Peterson Creek fen. Further work could be done to model the soil gas fluxes observed at the sites. The hydrologic model I have shown in this report could be used in conjunction with physical soil properties to create a simulation of the greenhouse gas fluxes we measured in the NCTR. This potential model would have implications for climate change forecasting. Synthesizing this hydrologic model with the soil greenhouse gas study allows for a better understanding of the ecosystem processes and climate change responses. As climate change progresses, combining field studies with models will become increasingly beneficial to understanding ecosystem responses and forecasting likely outcomes of our changing environment. 7 APPENDIX A: FIGURES Figure 1. Image created with ArcGIS from D’Amore, 2011 of the watersheds: Peterson, McGinnis, and Eaglecrest (Fish). 8 Figure 2. The Thornthwaite-Mather model schematic, taken from BEE 6740: Ecohydrology Course Handout (Professor Todd Walter). Figure 3. Gas Sampling Shematic: Three larger outer circles are collars for “chamber method” and ten smaller inner circles are collars for IRGA. 9 3 mm /day Figure 4. Eaglecrest Fen: Streamflow Model vs Data. 3 mm /day Figure 5. McGinnis Fen: Streamflow Model vs Data. 10 3 mm /day Figure 6. Peterson Creek Fen: Streamflow Model vs Data. 11 APPENDIX B: DATA PROCESSING R CODE ## GHG Project Data Processing and Cleanup: setwd("/Users/rry5/Documents/Ecohydrology") library(EcoHydRology) library(ggplot2) library(plyr) library(lubridate) require(data.table) add.names <- function(df) { #### ## function to add watershed names and types to a df to allow faceting df$watershed <- NA df$watershed[grepl(glob2rx("E*"), df$site)] <- "Eaglecrest" df$watershed[grepl(glob2rx("P*"), df$site)] <- "Peterson" df$watershed[grepl(glob2rx("M*"), df$site)] <- "McGinnis" df$type <- NA df$type[grepl(glob2rx("*BT"), df$site)] <- "Bog" df$type[grepl(glob2rx("*FW"), df$site)] <- "Forested Wetland" df$type[grepl(glob2rx("*UT"), df$site)] <- "Upland" if (any(is.na(df$watershed) | is.na(df$type))) { print("Some site didn't get names!!") } df$watershed <- factor(df$watershed) df$type <- factor(df$type) } return(df) # get the NCDC global hourly dataset # retrieve processed met data & clean up met <- read.csv("met_processed.csv", as.is=T) met <- subset(met, select=-X) met$datetime <- as.POSIXct(met$datetime, tz="UTC") met$site <- "Airport" # get the methane rain gauge data rg <- read.csv("rg_alldata.csv") # convert datetime from factor to date/time class (POSIXct) rg$datetime <- as.POSIXct(rg$datetime, tz="Etc/GMT+8") 12 # round datetime up to nearest hour for aggregating rg$hour <- lubridate::ceiling_date(rg$datetime, "hour") # convert all event logs from sequential numbers to 1 rg$event[!is.na(rg$event)] <- 1 # sum events by hours and site, being sure to drop NAs from the calculation rain.hourly <- ddply(rg, .(site, logger, hour), summarize, total = sum(event, na.rm = T)) # drop records where total rainfall = 0 rain.hourly <- rain.hourly[rain.hourly$total != 0,] # average by site and hour. This will handle multiple functioning gauges at each site rain.hourly <- ddply(rain.hourly, .(site, hour), summarize, total=mean(total)) rain.hourly$date <- as.Date(rain.hourly$hour) rain.daily <- ddply(rain.hourly, .(site, date), summarize, daily.tot = sum(total)) # convert bucket tips to mm. Each bucket tip is 0.2mm rain.hourly$total <- rain.hourly$total * 0.2 rain.daily$daily.tot <- rain.daily$daily.tot * 0.2 # merge with NCDC global hourly to get airport rain # first change the timezone of the met data attr(met$datetime, "tzone") <- "Etc/GMT+8" # cut out overlapping time period from NCDC data met.temp <- met[which(met$datetime == min(rain.hourly$hour)) : which(met$datetime == max(rain.hourly$hour)),] # rename datetime field and pcp.mm names(met.temp)[names(met.temp) == "datetime"] <- "hour" names(met.temp)[names(met.temp) == "pcp.mm"] <- "total" # pull out the records needed for PET met.temp$date <- as.Date(met.temp$hour) pet.daily <- ddply(met.temp, .(date), summarize, t.max = max(temp, na.rm = T), t.min = min(temp, na.rm = T)) # drop 0 measurements met.temp <- met.temp[met.temp$total != 0,] # stick airport data onto the end of rain rain.hourly <- rbind(rain.hourly, met.temp[,c("hour", "site", "total")]) # do the cumulative sum for rainfall events rain.totals <- ddply(rain.hourly, .(site), summarize, sum = cumsum(total), hour=hour) 13 # add names rain <- add.names(rain.hourly) rain.totals <- add.names(rain.totals) # rename fields names(rain)[names(rain) == "total"] <- "pcp.mm" # Daily PET pet.daily$petd.mm <- PET_fromTemp(Jday=(1+as.POSIXlt(pet.daily$date)$yday), Tmax_C=pet.daily$t.max, Tmin_C=pet.daily$t.min, lat_radians=58.3*pi/180) * 1000 # save files save(rain, file="rain_hourly.RData") save(pet.daily, file="pet_daily.RData") #cleanup rm(list=c("met", "met.temp", "rg")) # Wells # Get data wells.2013 <- read.csv('allwelldata.csv') welldata <- read.csv('well_metadata.csv') wells.2013 <- add.names(wells.2013) # change name names(wells.2013)[names(wells.2013) == "position"] <- "position.cm" # convert datetime to POSIXct wells.2013$datetime <- as.POSIXct(wells.2013$datetime, tz="Etc/GMT+8") wells.2013$serial <- factor(wells.2013$serial) # adjustments based on field readings ebt1 <- 2.7 ebt2 <- 2.0 mbt1 <- 4 # based on a single point mbt2 <- 3.7 pbt1 <- 0 # no readings available - maxed all the time pbt2 <- 0 # no readings available - maxed all the time efw1 <- -12.8 efw2 <- 6.9 mfw1 <- 7.2 14 mfw2 <- 2.3 pfw1 <- -2.4 pfw2 <- 0 # no readings, well was always dry eut1 <- 17 # no field readings, based on bottoming out eut2 <- 15.5 # no field readings available mut1 <- 0 # this one gets dropped anyway, always dry mut2 <- 0 # this one looks pretty good! put1 <- 10 # no field readings, based on bottoming out put2 <- 5.5 # no field readings, based on bottoming out # EBT temp <- which(wells.2013$site == "EBT" & wells.2013$serial == 72099) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + ebt1 temp <- which(wells.2013$site == "EBT" & wells.2013$serial == 49701) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + ebt2 # MBT temp <- which(wells.2013$site == "MBT" & wells.2013$serial == 70995) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + mbt1 temp <- which(wells.2013$site == "MBT" & wells.2013$serial == 72045) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + mbt2 # PBT temp <- which(wells.2013$site == "PBT" & wells.2013$serial == 53849) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + pbt1 temp <- which(wells.2013$site == "PBT" & wells.2013$serial == 71523) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + pbt2 # EFW temp <- which(wells.2013$site == "EFW" & wells.2013$serial == 72190) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + efw1 temp <- which(wells.2013$site == "EFW" & wells.2013$serial == 72225) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + efw2 # MFW temp <- which(wells.2013$site == "MFW" & wells.2013$serial == 72078) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + mfw1 temp <- which(wells.2013$site == "MFW" & wells.2013$serial == 54262) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + mfw2 # PFW temp <- which(wells.2013$site == "PFW" & wells.2013$serial == 53835) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + pfw1 temp <- which(wells.2013$site == "PFW" & wells.2013$serial == 70035) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + pfw2 15 # EUT temp <- which(wells.2013$site == "EUT" & wells.2013$serial == 54266) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + eut1 temp <- which(wells.2013$site == "EUT" & wells.2013$serial == 72268) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + eut2 # MUT temp <- wells.2013$site == "MUT" & wells.2013$serial == 42396 wells.2013 <- wells.2013[!temp,] # PUT temp <- which(wells.2013$site == "PUT" & wells.2013$serial == 72272) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + put1 temp <- which(wells.2013$site == "PUT" & wells.2013$serial == 49727) wells.2013$position.cm[temp] <- wells.2013$position.cm[temp] + put2 rm(temp) # Well Censoring wells.2013$wells.censored <- as.numeric(NA) wells.2013 <- merge(wells.2013, welldata[,c("serial", "depth")], by="serial") wells.2013$depth <- -wells.2013$depth # set censored flag for dry wells.2013 wells.2013$wells.censored <- apply(wells.2013[,c("position.cm", "depth")], 1, function (x) ifelse(x["position.cm"] < x["depth"] + 1, 1, 0)) # set position for dry wells.2013 wells.2013$position.cm <- apply(wells.2013[,c("position.cm", "depth", "wells.censored")], 1, function (x) ifelse(x["wells.censored"] == 1, x["position.cm"] <- x["depth"], x["position.cm"] <- x["position.cm"])) # high censored wells.2013$wells.censored[wells.2013$level == 150] <- 2 wells.2013$position.cm[wells.2013$wells.censored == 2] <- NA # aggregate by hour # add hour field, rounding up so that the average values will match # the met data, which gives totals for the preceesing hour wells.2013$hour <- lubridate::ceiling_date(wells.2013$datetime, "hour") # create temp dataframe for censoring calcs temp <- wells.2013 # convert low censored values to NA so that they won't be included in the average temp$position.cm[which(temp$wells.censored == 1)] <- NA # convert high censored flag to 10 16 temp$wells.censored[which(temp$wells.censored == 2)] <- 10 # this is to get an average position by hour and site ids <- id(temp[c("site", "hour")], drop=T) data1 <- as.matrix(temp["wells.censored"]) data2 <- as.matrix(temp["position.cm"]) indices <- plyr:::split_indices(ids, n = attr(ids, "n")) fun1 <- function(rows) { mean(na.omit(data1[rows,])) } fun2 <- function(rows) { mean(na.omit(data2[rows,])) } values1 <- vapply(indices, fun1, numeric(1)) values2 <- vapply(indices, fun2, numeric(1)) labels <- temp[match(seq_len(attr(ids, "n")), ids), c("site", "hour")] hourly <- cbind(labels, values1, values2) names(hourly) <- c("site", "hour", "wells.censored", "position.cm") hourly$position.cm[is.nan(hourly$position.cm)] <- NA # replace NaN with NA rm(list=c("temp", "ids", "data1", "data2", "indices", "values1", "values2", "labels", "fun1", "fun2")) # deal with censoring hourly values # get avg well depth welldepth <- ddply(welldata, .(site), summarize, depth = mean(depth)) # adjust, as I dropped one of the MUT wells welldepth$depth[welldepth$site == "MUT"] <- 93 hourly <- merge(hourly, welldepth[,c("site", "depth")], by="site") hourly$depth <- -hourly$depth # set low censored to bottom of the well low <- which(hourly$wells.censored == 1) hourly$position.cm[low] <- hourly$depth[low] rm(low) # set censored flag to 0 for censored > 1 high <- which(hourly$wells.censored > 1 & hourly$wells.censored <= 2.5) hourly$wells.censored[high] <- 0 rm(high) # set position.cm to NA for censored > 2.5 17 high <- which(hourly$wells.censored > 2.5) hourly$position.cm[high] <- NA hourly$wells.censored[high] <- 2 rm(high) # add names hourly <- add.names(hourly) # add fake logger serial to help out with graphing hourly$serial <- 11111 hourly$serial <- as.factor(hourly$serial) # Flow Data # Get the 2013 flume data flow <- read.csv('allflumedata.csv') flow$datetime <- as.POSIXct(flow$datetime, tz="Etc/GMT+8") # get the flume metadata load("flumedata.RData") flumedata <- flumedata[flumedata$flume %in% c("EBT", "EFW", "EUT3", "MBT2", "MFW", "MUT2", "PBT", "PFW", "PUT"),] flow <- merge(flow, flumedata[,c("site", "a", "e", "min.qhr.mm", "max.qhr.mm", "area_ha")], by = "site", all.x = T, all.y = F) # high frequency noise editing freq <- data.frame(site = c("EBT", "EFW", "EUT", "MBT", "MFW", "MUT", "PBT", "PFW", "PUT"), filter = c(-1.5, -1.5, -1.5, -1.5, -2.5, -1, 0, 0, 1)) flow <- merge(flow, freq, by="site", all.x=T, all.y=F) temp <- which(flow$level_corr <= flow$filter) flow$level_corr[temp] <- flow$filter[temp] rm(list=c("temp", "freq")) # calculate discharge flow$qhr.mm <- with(flow, { qhr.mm <- (a * (level_corr / 30.48) ^ e) * 0.028316847 * (1/area_ha) * (1/10000) * 3600 * 1000 }) flow$qhr.mm[!is.na(flow$qhr.mm)] <- signif(flow$qhr.mm[!is.na(flow$qhr.mm)],3) # handle NaNs flow$qhr.mm[is.nan(flow$qhr.mm)] <- NA # set NA values to 0 flow$qhr.mm[is.na(flow$qhr.mm)] <- 0 18 # Censored fifteen minute flow$flow.censored <- as.numeric(0) # low censored flag flow$flow.censored[flow$qhr.mm < flow$min.qhr.mm] <- 1 #flow$qhr.mm[flow$flow.censored == 1] <- NA # high censored flag flow$flow.censored[flow$qhr.mm > flow$max.qhr.mm] <- 10 #flow$qhr.mm[flow$censored == 10] <- NA # aggregate by hour # add hour field, rounding up so that the average values will match # the met data, which gives totals for the preceesing hour flow$hour <- lubridate::ceiling_date(flow$datetime, "hour") # this is to get an average q by hour and site ids <- id(flow[c("site", "hour")], drop=T) data1 <- as.matrix(flow["flow.censored"]) data2 <- as.matrix(flow["qhr.mm"]) indices <- plyr:::split_indices(ids, n = attr(ids, "n")) fun1 <- function(rows) { mean(na.omit(data1[rows,])) } fun2 <- function(rows) { mean(na.omit(data2[rows,])) } values1 <- vapply(indices, fun1, numeric(1)) values2 <- vapply(indices, fun2, numeric(1)) labels <- flow[match(seq_len(attr(ids, "n")), ids), c("site", "hour")] hourly.flow <- cbind(labels, values1, values2) names(hourly.flow) <- c("site", "hour", "flow.censored", "qhr.mm") hourly.flow$qhr.mm[is.nan(hourly.flow$qhr.mm)] <- NA # replace NaN with NA rm(list=c("ids", "data1", "data2", "indices", "values1", "values2", "labels", "fun1", "fun2")) # Censoring hourly.flow # merge with flumedata for censoring hourly.flow <- merge(hourly.flow, flumedata[,c("site", "max.qhr.mm", "min.qhr.mm")], by="site", all.x = T, all.y = F) # convert high flow.censored to max q high <- hourly.flow$flow.censored > 1 #hourly.flow$qhr.mm[high] <- hourly.flow$max.qhr.mm[high] 19 hourly.flow$flow.censored[high] <- 2 # convert low censored values to 1/2 min q low <- which(hourly.flow$flow.censored <= 1 & hourly.flow$flow.censored > 0) hourly.flow$qhr.mm[low] <- hourly.flow$min.qhr.mm[low] / 2 rm(list=c("low", "high")) # combine with hourly hourly <- merge(hourly, hourly.flow[,c("site", "hour", "qhr.mm", "max.qhr.mm", "min.qhr.mm", "flow.censored")], by=c("site", "hour"), all.x=T, all.y=T) # get year hourly$year <- as.factor(year(hourly$hour)) # deal with NAs created hourly$flow.censored[which(is.na(hourly$flow.censored))] <- 0 hourly$wells.censored[which(is.na(hourly$wells.censored))] <- 0 hourly <- subset(hourly, select = -c(watershed, type)) hourly <- add.names(hourly) # set up combined censored column, this is mostly for graphing hourly$censored <- hourly$flow.censored !=0 | hourly$wells.censored !=0 # get rain gauge data load('rain_hourly.RData') # set up hydro dataframe hydro <- merge(hourly, rain[,c("watershed", "hour", "pcp.mm")], by=c("watershed", "hour"), all.x=T, all.y=T) hydro <- hydro[!is.na(hydro$type),] #----------------------------------------------------------------------------------------------------------------------------------------# FLOW FROM DATA # Eaglecrest EBT_hydro <- hydro[hydro$site %in% c("EBT"),] EBT_flow_hr <- EBT_hydro$qhr.mm.x ## Daily EBT_hydro$DATE <- as.Date(EBT_hydro$hour, format="%Y-%m-%d %H:%M:%S") EBT_flow_daily <- ddply(EBT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW EFW_hydro <- hydro[hydro$site %in% c("EFW"),] EFW_flow_hr <- EFW_hydro$qhr.mm.x ## Daily EFW_hydro$DATE <- as.Date(EFW_hydro$hour, format="%Y-%m-%d %H:%M:%S") EFW_flow_daily <- ddply(EFW_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW 20 EUT_hydro <- hydro[hydro$site %in% c("EUT"),] EUT_flow_hr <- EUT_hydro$qhr.mm.x ## Daily EUT_hydro$DATE <- as.Date(EUT_hydro$hour, format="%Y-%m-%d %H:%M:%S") EUT_flow_daily <- ddply(EUT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW # McGinnis MBT_hydro <- hydro[hydro$site %in% c("MBT"),] MBT_flow_hr <- MBT_hydro$qhr.mm.x ## Daily MBT_hydro$DATE <- as.Date(MBT_hydro$hour, format="%Y-%m-%d %H:%M:%S") MBT_flow_daily <- ddply(MBT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW MFW_hydro <- hydro[hydro$site %in% c("MFW"),] MFW_flow_hr <- MFW_hydro$qhr.mm.x ## Daily MFW_hydro$DATE <- as.Date(MFW_hydro$hour, format="%Y-%m-%d %H:%M:%S") MFW_flow_daily <- ddply(MFW_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW MUT_hydro <- hydro[hydro$site %in% c("MUT"),] MUT_flow_hr <- MUT_hydro$qhr.mm.x ## Daily MUT_hydro$DATE <- as.Date(MUT_hydro$hour, format="%Y-%m-%d %H:%M:%S") MUT_flow_daily <- ddply(MUT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW # Peterson PBT_hydro <- hydro[hydro$site %in% c("PBT"),] PBT_flow_hr <- PBT_hydro$qhr.mm.x ## Daily PBT_hydro$DATE <- as.Date(PBT_hydro$hour, format="%Y-%m-%d %H:%M:%S") PBT_flow_daily <- ddply(PBT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW PFW_hydro <- hydro[hydro$site %in% c("PFW"),] PFW_flow_hr <- PFW_hydro$qhr.mm.x ## Daily PFW_hydro$DATE <- as.Date(PFW_hydro$hour, format="%Y-%m-%d %H:%M:%S") PFW_flow_daily <- ddply(PFW_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # DAILY FLOW PUT_hydro <- hydro[hydro$site %in% c("PUT"),] 21 PUT_flow_hr <- PUT_hydro$qhr.mm.x # Daily PUT_hydro$DATE <- as.Date(PUT_hydro$hour, format="%Y-%m-%d %H:%M:%S") PUT_flow_daily <- ddply(PUT_hydro, .(site, DATE), summarize, daily.flow = sum(qhr.mm)) # Extract input parameters for TM model # Extrapolate precip by site EB_P <- rain.daily$daily.tot[1:87] MB_P <- rain.daily$daily.tot[88:179] PB_P <- rain.daily$daily.tot[180:271] # Daily PET from airport data pet.daily$petd.mm <- PET_fromTemp(Jday=(1+as.POSIXlt(pet.daily$date)$yday), Tmax_C=pet.daily$t.max, Tmin_C=pet.daily$t.min, lat_radians=58.3*pi/180) * 1000 # Daily PET for EB EB_pet.daily <- pet.daily$petd.mm[c(4:9,11:13,15,19:20,24:26,31:33,40:45,49,52:57,58:60,63:64,67:72,80,84:86,91,98,101:10 3,113,118,124,135,143:148)] # Daily PET for MB MB_pet.daily <- pet.daily$petd.mm[c(1:7,9,11:13,15,19:20,26,31:33,41:45,49,54:60,63:64,67:72,80,84:86,91,97:98,101:103,11 2:113,116,118,140,146,148)] # Daily PET for PB PB_pet.daily <- pet.daily$petd.mm[c(1,4:9,11:13,15,19:20,26,31:33,40:45,49,52:60,63:64,67:71,80,84:86,91,97:98,101:102,11 6,124:125,135,140,145:146)] 22 APPENDIX C: HYDROLOGIC MODEL R CODE ## Hydrologic Model for GHG Study ## Rosemary Yardley setwd("/Users/rry5/Documents/Ecohydrology") library(EcoHydRology) library(ggplot2) library(plyr) library(lubridate) require(data.table) # Grab data source("GHGProcessedData.R") # Use Thornthwaite Mather Function to simulate stream flow ## Thornthwaite Mather Function # Assumptions with this application: # 1. Streamflow is fully driven by baseflow, and is linearly related GW storage. # 2. ET is driven by Soil Water status and not affected by vegetation. # 3. Snow melt is not important here. # 4. SW is equal to AWC on the first day of modeled flow. # Arguments: # P [mm/d] precipitation # PET [mm/d] Potential Evapotranspiration (to estimate, see below) # AWC [mm] depth of the available water capacity in the watershed soils # Res_coef [-] Reservoir coefficient # F1 [mm/d] Streamflow on the first day of the model - allows us to calculate S[1] ThornthwaiteMather <- function (P, PET, AWC, Res_coef, F1 = 0.1){ deltaP <- P-PET # Define deltaP for all days SW <- rep(AWC,length(P)) # By default, SW is AWC Excess <- rep(0,length(P)) # By default, Excess is 0 S <- vector(length=length(P)) S[1] <- F1/Res_coef # Initialize S based on observed flow (F1) if known # This loop will change our default values initialized above. for(i in 2:length(P)){ if(deltaP[i]<0){ # drying SW[i] <- SW[i-1]*exp(deltaP[i]/AWC) } else if (SW[i-1]+deltaP[i]<=AWC){ # wetting soil SW[i] <- SW[i-1]+deltaP[i] } else { # wetting above Field Capacity Excess[i] <- SW[i-1]+deltaP[i]-AWC # SW is already equal to AWC by default 23 } S[i] <- (1-Res_coef) * S[i-1] + Excess[i] # Subtract yesterday's flow, add today's excess } } Q <- S*Res_coef return( data.frame( Q, SW, S )) # Return a vector of Modeled Streamflow # Stream flow model for EB EB_TM_Q <- ThornthwaiteMather(P=EB_P, PET=EB_pet.daily, AWC=300, Res_coef=0.6, F1 = EBT_flow_daily$daily.flow[2]) # Stream flow model for MB MB_TM_Q <- ThornthwaiteMather(P=MB_P, PET=MB_pet.daily, AWC=300, Res_coef=0.5, F1 = MBT_flow_daily$daily.flow[2]) # Stream flow model for PB PB_TM_Q <- ThornthwaiteMather(P=PB_P, PET=PB_pet.daily, AWC=50, Res_coef=0.9, F1 = PBT_flow_daily$daily.flow[2]) # Plot stream flow ## EB plot(rain.daily$date[1:87],EB_TM_Q$Q,type='l', xlab='Month', ylab=' ', tck=0.02, family="Century Gothic") # TM Model plot(EBT_flow_daily$DATE[2:142],EBT_flow_daily$daily.flow[2:142],type='l', ylab=' ',xlab='Month', tck=0.02, family="Century Gothic") # Data ## MB plot(rain.daily$date[88:179],MB_TM_Q$Q,type='l', xlab='Month', ylab=' ',tck=0.02,family="Century Gothic") # TM Model plot(MBT_flow_daily$DATE[2:144],MBT_flow_daily$daily.flow[2:144],type='l', xlab='Month', ylab=' ',tck=0.02,family="Century Gothic") # Data ## PB plot(rain.daily$date[180:271],PB_TM_Q$Q,type='l',xlab='Month',ylab=' ',tck=0.02,family="Century Gothic") # TM Model plot(PBT_flow_daily$DATE[2:147],PBT_flow_daily$daily.flow[2:147],type='l',xlab='Month', ylab=' ',tck=0.02,family="Century Gothic") # Data # Plot modeled vs data ## EB plot(rain.daily$date[1:87],EB_TM_Q$Q,type='l', xlab='Month', ylab=' ', tck=0.02, family="Century Gothic") # TM Model lines(EBT_flow_daily$DATE[2:142],EBT_flow_daily$daily.flow[2:142],lty=2,col='red') legend("topleft", c("Modeled Q", "Observed Q"), lty = c(1,2), col=c("black", "red")) ## MB plot(rain.daily$date[88:179],MB_TM_Q$Q/3,type='l', xlab='Month', ylab=' ', tck=0.02, family="Century Gothic") # TM Model lines(MBT_flow_daily$DATE[2:144],MBT_flow_daily$daily.flow[2:144],lty=2,col='red') 24 legend("topleft", c("Modeled Q", "Observed Q"), lty = c(1,2), col=c("black", "red")) ## PB plot(rain.daily$date[180:271],PB_TM_Q$Q/3,type='l', xlab='Month', ylab=' ', tck=0.02, family="Century Gothic") # TM Model lines(PBT_flow_daily$DATE[2:147],PBT_flow_daily$daily.flow[2:147],lty=2,col='red') legend("topleft", c("Modeled Q", "Observed Q"), lty = c(1,2), col=c("black", "red")) 25 REFERENCES D’Amore, D.V. 2011. Hydrologic controls of carbon fluxes in Alaskan coastal temperate rainforest soils. Ph.D. dissertation, University of Alaska, Fairbanks, Natural Resources and Sustainability, August 2011, 150p. Davidson, E.A., Belk E. & Boone, R.D. 1998. Soil water content and temperature as independent or confounded factors controlling soil respiration in a temperate mixed hardwood forest. Global Change Biology, 4, 217-227. Goulden, M.L., Munger, J.W., Fan, S.-M., Daube, B.C. & Wofsy, S.C. 1996. Measurements of carbon sequestration by long-tern eddy covariance: methods and a critical evaluation of accuracy. Global Change Biology, 2, 169-182. Liblik, L.K., Moore, T.R., Bubier, J.L. & Robinson, S.D. 1997. Methane emissions from wetlands in the zone of discontinuous permafrost: Fort Simpson, Northwest Territories, Canada. Global Biogeochemical Cycles, 11, 485-494. MacDonald, J.A., Fowler, D., Hargreaves, K.J., Skiba, U., Leith, I.D. & Murray, M.B. 1998. Methane emission rates from a northern wetland: response to temperature, water table and transport. Atmospheric Environment, 32, 3219-3227. Moore, T.R. & Dalva, M. 1993. The influence of temperature and water-table position on carbon dioxide and methane emissions from laboratory columns of peatland soils. Journal of Soil Science, 44, 651-664. Oechel, W.C., Vourlitis, G.L., Hastings, S.J., Ault, R.P. & Bryant, P. 1998. The effects of water table manipulation and elevated temperature on the net CO2 flux of wet sedge tundra ecosystems. Global Change Biology, 4, 77-90. Prather, M., Derwent, R., Ehhalt, D., Fraser, P., Sanhueza, E. & Zhou, X. 1995. Other trace gases and atmospheric chemistry. In: Climate Change 1994: Radiative Forcing of Climate Change and an Evaluation of the IPCC IS92 Emission Scenarios (eds J.T. Houghton, L.G. Meira Filho, J. Bruce, H. Lee, B.A. Callender, E. Haites et al.), pp. 73-126. Cambridge University Press, Cambridge. Raich, J.W. & Schlesinger, W.H. 1992. The global carbon dioxide flux in soil respiration and its relationship to vegetation and climate. Tellus, 44B, 81-89. Rey, A., Pegoraro, E., Tedeschi, V., De Parri, I., Jarvis, P.G. & Valentini, R. 2002. Annual variation in soil respiration and its components in a coppice oak forest in Central Italy. Global Change Biology, 8, 851-866. Smith, K. A., et al. "Exchange of greenhouse gases between soil and atmosphere: interactions of soil physical factors and biological processes." European Journal of Soil Science 54.4 (2003): 779-791. 26 Thornthwaite, C.W. and J.R. Mather, 1955. The water balance. Laboratory of Climatology, No. 8, Centerton NJ. Walter, Todd. “Ecohydrology: Thornthwaite-Mather for Monthly Watershed Yield.” BEE 6740 Ecohydrology Handout. Cornell University. Spring 2014. Xu, M. & Qi, Y. 2001. Soil surface CO2 efflux and temporal variations in a young ponderosa pine plantation in northern California. Global Change Biology, 7, 667-677.