mld: Detect the depth of the mixed layer

Description Usage Arguments Details Value References See Also Examples

View source: R/mld.R

Description

Detect the depth of the mixed layer

Usage

1
2
mld(x, depth, ref.depths = 5:10, criteria = c(0.03, 0.01),
  default.depth = NA, n.smooth = 0, k = 2)

Arguments

x

vector of the variable of interest, usually potential or in situ density.

depth

vector of depths at which x is measured.

ref.depths

depth(s) of reference, near the surface; when ref.depths is a vector, the value of x is averaged between those depths.

criteria

value(s) considered as thresholds for the computation of the depth of the mixed layer. The thresholds are tried successively.

default.depth

when no threshold is crossed, return this value instead; a usual value is the full depth of the water column (or max(depth)).

n.smooth

integer, number of times to smooth the data before applying the mixed layer criteria.

k

order of the moving average used for smoothing; the window size is 2k+1. NB: when data is smoothed, it should have been recorded at approximately regular intervals for the moving average to make sense.

Details

The mixed layer depth (MLD) is detected following de Boyer Montegut et al (2004): a reference value for density is taken near the surface and the water column is considered to be mixed until the depth at which density deviates from this reference by more than 0.03 kg/m^3. Optionally, when no depth satisfies this criterion, a second criterion of 0.01 kg/m^3 can be considered (as is by default).

In addition, here, when a range of depths is provided as reference, the reference density is the average of the densities recorded in this depth range.

Value

If no criterion is met, return default.depth. If a criterion is met, return the last depth at which it was not.

References

de Boyer Montegut et al (2004). Mixed layer depth over the global ocean: An examination of profile data and a profileā€based climatology. Journal of Geophysical Research: Oceans, 109(C12). https://doi.org/10.1029/2004JC002378

See Also

smooth() for smoothing.

Other functions computing remarkable depths: clined, maxd, ze_from_chla, ze_from_par, ze_from_surface_chla

Examples

1
2
3
4
5
6
7
plot(-depth ~ sigma, data=d, type="l")
# Compute mixed layer depth
MLD <- mld(d$sigma, d$depth)
abline(h=-MLD, col="red")
# Compare with the depth of the pycnocline
pycnocline <- clined(d$sigma, d$depth)
abline(h=-pycnocline, col="blue")

jiho/castr documentation built on April 5, 2020, 2:12 p.m.