Shared vanish-tolerance for Phase-2/3 kernels: the layer is
considered vanished when its thickness is at or below this value.
Defined as max(angstrom_h, H_VANISHED) so both the physical
floor (Phase 1) and the skip/merge marker are covered by a
single threshold. Providing this as a pure helper ensures
Phase 2 (reset_vanished_layer_velocities) and Phase 3
(apply_velocity_truncation gate + compute_max_cfl gate)
cannot drift in their vanish definition.
pd_floor — the floor/tolerance collision fix (pdc 2c7ad0a1).
Positive-definite continuity holds every floored layer at
h >= h_lim = angstrom_h, so a floored (dynamically dead) layer
sits AT or just-above the plain max(angstrom_h, H_VANISHED) =
angstrom_h tolerance — and the h <= tol guards then classify it
LIVE, leaving phantom maxvel velocities that the CFL clip can’t
reach and that pin the panic MaxCFL (600² spoon, day-16 2.4696).
When pd_floor = .true. (PD active, angstrom_h > H_VANISHED)
the tolerance is lifted to angstrom_h + H_VANISHED — strictly
ABOVE the floor it now rests on — so the at-floor band
[h_lim, h_lim + H_VANISHED] reads as vanished. pd_floor
absent / .false. ⇒ unchanged ⇒ bit-identical.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | angstrom_h |
Phase-1 floor (m); 0.0 when Phase 1 is off. |
||
| logical, | intent(in), | optional | :: | pd_floor |
When .true. AND |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | private | :: | pd |
pure function isopycnal_vanish_tol(angstrom_h, pd_floor) result(tol) !! Shared vanish-tolerance for Phase-2/3 kernels: the layer is !! considered vanished when its thickness is at or below this value. !! Defined as max(angstrom_h, H_VANISHED) so both the physical !! floor (Phase 1) and the skip/merge marker are covered by a !! single threshold. Providing this as a `pure` helper ensures !! Phase 2 (`reset_vanished_layer_velocities`) and Phase 3 !! (`apply_velocity_truncation` gate + `compute_max_cfl` gate) !! cannot drift in their vanish definition. !! !! **`pd_floor` — the floor/tolerance collision fix (pdc 2c7ad0a1).** !! Positive-definite continuity holds every floored layer at !! `h >= h_lim = angstrom_h`, so a floored (dynamically dead) layer !! sits AT or just-above the plain `max(angstrom_h, H_VANISHED) = !! angstrom_h` tolerance — and the `h <= tol` guards then classify it !! LIVE, leaving phantom maxvel velocities that the CFL clip can't !! reach and that pin the panic MaxCFL (600² spoon, day-16 2.4696). !! When `pd_floor = .true.` (PD active, `angstrom_h > H_VANISHED`) !! the tolerance is lifted to `angstrom_h + H_VANISHED` — strictly !! ABOVE the floor it now rests on — so the at-floor band !! `[h_lim, h_lim + H_VANISHED]` reads as vanished. `pd_floor` !! absent / .false. ⇒ unchanged ⇒ bit-identical. real(wp), intent(in) :: angstrom_h !! Phase-1 floor (m); 0.0 when Phase 1 is off. logical, intent(in), optional :: pd_floor !! When .true. AND `angstrom_h > H_VANISHED`: lift the tolerance !! to `angstrom_h + H_VANISHED` (above the PD floor). real(wp) :: tol logical :: pd pd = .false. if (present(pd_floor)) pd = pd_floor if (pd .and. angstrom_h > H_VANISHED) then tol = angstrom_h + H_VANISHED else tol = max(angstrom_h, H_VANISHED) end if end function isopycnal_vanish_tol