pure subroutine vmix_assemble_clip_impl(nx, ny, nzp1, kv, kt, ks, &
kv_bg, kt_bg, ks_bg, kv_max, kd_max)
!! Floor + ceiling on interior interfaces k = 2..nzp1-1. Explicit-
!! shape args so the do concurrent stays descriptor-walk free.
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) :: kv_bg, kt_bg, ks_bg, 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), kv_bg), kv_max)
kt(i, j, k) = min(max(kt(i, j, k), kt_bg), kd_max)
ks(i, j, k) = min(max(ks(i, j, k), ks_bg), kd_max)
end do
end subroutine vmix_assemble_clip_impl