pure subroutine vmix_assemble_clip_profile_impl(nx, ny, nzp1, kv, kt, ks, &
kd_bg, prandtl, kv_max, kd_max)
!! C7 floor + ceiling: same as `vmix_assemble_clip_impl` but the
!! tracer floor is the per-interface Bryan-Lewis `kd_bg` field and the
!! momentum floor is `prandtl·kd_bg` (MOM6 background Prandtl tie).
!! Interior interfaces k = 2..nzp1-1.
integer, intent(in) :: nx, ny, nzp1
real(wp), intent(inout) :: kv(nx, ny, nzp1)
real(wp), intent(inout) :: kt(nx, ny, nzp1)
real(wp), intent(inout) :: ks(nx, ny, nzp1)
real(wp), intent(in) :: kd_bg(nx, ny, nzp1)
real(wp), intent(in) :: prandtl, kv_max, kd_max
integer :: i, j, k
do concurrent(k=2:nzp1 - 1, j=1:ny, i=1:nx)
kv(i, j, k) = min(max(kv(i, j, k), prandtl*kd_bg(i, j, k)), kv_max)
kt(i, j, k) = min(max(kt(i, j, k), kd_bg(i, j, k)), kd_max)
ks(i, j, k) = min(max(ks(i, j, k), kd_bg(i, j, k)), kd_max)
end do
end subroutine vmix_assemble_clip_profile_impl