pelagos_py.steps.processing.mixed_layer_depth#

class pelagos_py.steps.processing.mixed_layer_depth.MixedLayerDepthStep(name, parameters=None, diagnostics=False, context=None)[source]#

Bases: pelagos_py.steps.base_step.BaseStep, pelagos_py.utils.qc_handling.QCHandlingMixin

Calculate the mixed layer depth (MLD) of each profile.

The MLD is found per profile by the threshold method of de Boyer Montégut et al. (2004) [1]: the first depth below reference_depth at which the chosen variable departs from its reference value by the threshold marks the base of the mixed layer. The reference value is the median of samples within 2.5 m of reference_depth, so a single noisy sample cannot shift it. Density must increase by the threshold; temperature may change either way. PROFILE_NUMBER and DEPTH must already be derived. Inputs are read from their _ADJUSTED version (e.g. ASAL_ADJUSTED) where one exists. See Mixed Layer Depth.

Two derived variables are written on the N_MEASUREMENTS dimension: MLD, the profile’s mixed layer depth (positive down, matching DEPTH; NaN where undefined), and MLD_BOOL, 0 above the MLD, 1 at/below it, NaN where undefined. Samples whose flags fall in calculation_flag_filter take no part in the search, so a bad value cannot place the MLD; both variables are still written for every measurement in the profile.

The density method uses potential density (sigma0, referenced to 0 dbar) derived here from ASAL and CONS_TEMP, not the dataset’s in-situ DENSITY whose pressure term alone crosses a typical threshold within a few metres of the surface. The derived sigma0 is not written to the dataset.

Parameters:
  • method (str, optional) – "density", "temp", or "auto" (default; density if its inputs are present, else temp). An explicit choice whose inputs are missing halts the pipeline.

  • reference_depth (float, optional) – Near-surface reference depth (positive down). Default 10.

  • density_threshold (float, optional) – Density departure (kg/m3) marking the MLD. Default 0.03.

  • temp_threshold (float, optional) – Temperature departure (degC) marking the MLD. Default 0.2.

Examples

steps:
  - name: Mixed Layer Depth
    parameters:
      method: density
      reference_depth: 10
      density_threshold: 0.03
      temp_threshold: 0.2
    diagnostics: true

References

[1]

de Boyer Montégut, C., Madec, G., Fischer, A. S., Lazar, A., & Iudicone, D. (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), C12003. https://doi.org/10.1029/2004JC002378