xoa.thermdyn.mixed_layer_depth

xoa.thermdyn.mixed_layer_depth#

xoa.thermdyn.mixed_layer_depth(da, method=None, zref=0.0, deltatemp=0.2, deltadens=0.03, kzmax=0.0005, zdim=None, dask='parallelized', **kwargs)[source]#

Compute the mixed layer depth with different methods

Parameters:
  • da (xarray.DataArray) – A data array that contains either the potential temperature, the potential density or the vertical tracer diffusivity. This array must contain a depth coordinate, which should have a positive attribute.

  • method ({'deltatemp', 'deltadens', 'kzmax'}) –

    Method for computing the mixed layer depth

    • 'deltatemp': depth at which the potential temperature is deltatemp lower than the surface temperature

    • 'deltadens': depth at which the potential density is deltadens higher than the surface density

    • 'kzmax': depth at which the vertical diffusivity value reaches the kzmax value

  • zref (float) – Reference depth (in meters) from which the method criterion is applied. Defaults to the surface (0).

  • deltatemp (float) – Temperature threshold for the "deltatemp" method (in K or degC).

  • deltadens (float) – Density threshold for the "deltadens" method (in kg/m3).

  • kzmax (float) – Diffusivity threshold for the "kzmax" method (in m2/s).

  • zdim (str, None) – Name of the vertical dimension. Inferred by default.

  • dask (str) – See xarray.apply_ufunc().

  • kwargs (dict) – Extra keywords are passed to xoa.interp.isoslice().

Raises:

XoaThermdynError – When method is None and cannot be inferred from da.

Returns:

xarray.DataArray – Mixed layer depth as a positive value.

Example

Compute the MLD from a temperature profile:

mld = mixed_layer_depth(temp, method="deltatemp")

See also

xoa.interp.isoslice, is_temp, is_dens