mldtempcutoff: Calculate the mixed depth using temperature differences

Description Usage Arguments Value Author(s) Examples

Description

Here you get to define your own reference depth and temperature difference to determine where the mixed layer ends. This function will return the the bottom depth that does fit the condition; it does not return most shallow depth which no longer fits the mixed layer condition. This function doesn't care about units, so you are responsible for your own. This function will return a mixed layer depth even if the profile is inverted (surface temperature cooler than depth), although it will print a warning for you if that is true.

If you data is in excel, be sure to download the file into a dataframe, then open that dataframe to figure out the names of the columns you are interested in or rename columns. This will be easiest with a worksheet that only contains columns of data. Ex:

library(gdata)

mydata = read.xls("mydata.xls") #Reads from the first sheet only

Usage

1
mldtempcutoff(df, depthname, tempname, tempdiff, rd)

Arguments

df

Data frame which has one column for depth and another column for temperatures. Can contain additional columns.

depthname

The name of the df column that contains depth data, input as a string (i.e., 'depth' not depth.)

tempname

The name of the df column that contains temperature data, input as a string (i.e., 'temp' not temp.)

tempdiff

The maximum allowed difference in temperature to still be a part of the mixed layer. Common values include 0.2C, 0.5C, and 1C.

rd

The reference depth from which tempdiff is compared. Common values include 5m and 10m.

Value

Returns a sungle numeric value that is the minimum of the depths you provided that still is part of the mixed layer.

Author(s)

Kate Evans, University of Montana/Flathead Lake Biological Station

Examples

1
2
3
4
5
6
7
8
#6 temperature points at 6 different depths. Interested in
#where the temperature changes by more than 0.5C from the
#reference depth at 2.
depth <- c(0, 1, 2, 3, 4, 5)
temps <- c(10, 10, 10, 5, 0, 0)
df <- data.frame(depth, temps)
names(df) <- c('depths', 'temps')
mldtempcutoff(df, 'depths', 'temps', 0.5, 2)

kevans27/aqeco documentation built on May 16, 2019, 4:08 a.m.