Skip to content

Commit 8da2aa3

Browse files
committed
D is output as areal if instant is true for ecometab
1 parent cd2bfd0 commit 8da2aa3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

R/ecometab.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#'
3939
#' The plot method returns a \code{\link[ggplot2]{ggplot}} object which can be further modified.
4040
#'
41-
#' If \code{instant = TRUE} the instantaneous data (e.g., 30 minutes observations) used to estimate the daily metabolic rates are returned at the midpoint time steps from the raw time series. The instantaneous data will also return metabolism estimates as flux per day, including the DO flux (dDO, mmol d-1), volumetric air-sea exchange rate (D, mmol m-3 d-1), the volumetric reaeration coefficient (Ka, hr-1), the gas transfer coefficient (KL, m d-1), gross production (Pg, mmol O2 m-2 d-1), respiration (Rt, mmol O2 m-2 d-1), net ecosystem metabolism (mmol O2 m-2 d-1), volumetric gross production (Pg_vol, mmol O2 m-3 d-1), and volumetric respiration (Rt_vol, mmol O2 m-3 d-1). If \code{metab_units = "grams"}, the same variables are returned as grams of O2. To convert the daily instantaneous values to hourly estimates, just divide by 24 (except gross production, divide by \code{day_hrs}).
41+
#' If \code{instant = TRUE} the instantaneous data (e.g., 30 minutes observations) used to estimate the daily metabolic rates are returned at the midpoint time steps from the raw time series. The instantaneous data will also return metabolism estimates as flux per day, including the DO flux (dDO, mmol d-1), air-sea exchange rate (D, mmol m-2 d-1), the volumetric reaeration coefficient (Ka, hr-1), the gas transfer coefficient (KL, m d-1), gross production (Pg, mmol O2 m-2 d-1), respiration (Rt, mmol O2 m-2 d-1), net ecosystem metabolism (mmol O2 m-2 d-1), volumetric gross production (Pg_vol, mmol O2 m-3 d-1), and volumetric respiration (Rt_vol, mmol O2 m-3 d-1). If \code{metab_units = "grams"}, the same variables are returned as grams of O2. To convert the daily instantaneous values to hourly estimates, just divide by 24 (except gross production, divide by \code{day_hrs}).
4242
#'
4343
#' @references
4444
#' Caffrey JM, Murrell MC, Amacker KS, Harper J, Phipps S, Woodrey M. 2013. Seasonal and inter-annual patterns in primary production, respiration and net ecosystem metabolism in 3 estuaries in the northeast Gulf of Mexico. Estuaries and Coasts. 37(1):222-241.
@@ -232,7 +232,7 @@ ecometab.default <- function(dat_in, tz, DO_var = 'DO_mgl', depth_val = 'Tide',
232232

233233
#get exchange at air water interface
234234
# DO/DOsat - DO reduces to Cs - C in mmol/m3 (DOsat is actually a ratio between DO and DO at saturation
235-
# D in units of mmol/m3/hr
235+
# D in units of mmol/m3/hr, output below as mmol/m2/d
236236
D=Ka*(DO/DOsat-DO)
237237

238238
#combine all data for processing
@@ -258,7 +258,7 @@ ecometab.default <- function(dat_in, tz, DO_var = 'DO_mgl', depth_val = 'Tide',
258258
else{
259259
#day
260260
x$DOF_d<-ifelse(x$solar_period == 'sunrise', x$dDO*x$H, NA) # mmol o2 / m2 / hr
261-
x$D_d<-ifelse(x$solar_period == 'sunrise', x$D* x$H, NA) # mmol o2 / m2 / hr
261+
x$D_d<-ifelse(x$solar_period == 'sunrise', x$D*x$H, NA) # mmol o2 / m2 / hr
262262

263263
#night, still assumed constant and only calculated with night time period
264264
x$DOF_n<-mean(with(x[x$solar_period=='sunset',],dDO*H), na.rm = T) # mmol o2 / m2 / hr
@@ -283,7 +283,7 @@ ecometab.default <- function(dat_in, tz, DO_var = 'DO_mgl', depth_val = 'Tide',
283283
x$NEM<-x$Pg+x$Rt # mmol o2 / m2 / d
284284
x$Pg_vol<-x$Pg/mean(x$H,na.rm=TRUE)
285285
x$Rt_vol<-x$Rt/mean(x$H,na.rm=TRUE)
286-
x$D <- x$D * 24 # mmol o2 / m2 / d
286+
x$D <- x$D * 24 * mean(x$H, na.rm = T) # mmol o2 / m3/ hr to mmol o2 / m2 / d
287287
x$dDO <- x$dDO * 24 # do flux per day
288288

289289
# remove flux

man/ecometab.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)