Part of #98.
Why. Rasmus, 2026-09-16: "You take … you have a reference point. And when density has increased by this much, I forgot exactly how much, but I can look it up, then that is the depth of the mixed layer."
First stab (no input needed to start). A density-threshold MLD per cast, with the criterion as arguments so Rasmus's number is a one-line change:
- default: reference depth 10 m, Δσθ = 0.03 kg m⁻³ (de Boyer Montégut et al. 2004, JGR 109, C12003). This is the modern global standard, and the 10 m reference avoids the diurnal warm layer.
- alternatives implemented and reported beside it:
- Δσθ = 0.125 kg m⁻³ (Levitus 1982; Monterey & Levitus 1997), the classic CalCOFI-era choice;
- ΔT = 0.2 °C (de Boyer Montégut 2004 temperature criterion), which is the only one available on CTD-only preliminary casts, since it needs no salinity.
- The MLD is the linear interpolation to the first depth below the reference where the threshold is crossed. Flagged values are dropped first. It is NA when the profile never crosses the threshold (the cast is mixed to its bottom, reported as such) or when the reference depth is missing.
Done when. calcofi4db::ctd_mld() is tested on synthetic profiles (step, linear, never-crossing, gap at the reference). It runs over the full 1 m casts, is written per cast to sample_measurement (mld_sigma_003_m, mld_sigma_0125_m, mld_temp_02_m), and Rasmus has confirmed (or replaced) the default.
Ask Rasmus. Which Δσθ (0.03 or 0.125), and is 10 m the reference?
Part of #98.
Why. Rasmus, 2026-09-16: "You take … you have a reference point. And when density has increased by this much, I forgot exactly how much, but I can look it up, then that is the depth of the mixed layer."
First stab (no input needed to start). A density-threshold MLD per cast, with the criterion as arguments so Rasmus's number is a one-line change:
Done when.
calcofi4db::ctd_mld()is tested on synthetic profiles (step, linear, never-crossing, gap at the reference). It runs over the full 1 m casts, is written per cast tosample_measurement(mld_sigma_003_m,mld_sigma_0125_m,mld_temp_02_m), and Rasmus has confirmed (or replaced) the default.Ask Rasmus. Which Δσθ (0.03 or 0.125), and is 10 m the reference?