pure subroutine fill_transport_y_impl(h_layer, v_face, buf)
! assumed-shape-ok: diag fill — fires once per output frame (cadence-bounded).
real(wp), intent(in) :: h_layer(:, :, :), v_face(:, :, :)
real(wp), intent(inout) :: buf(:, :, :) ! assumed-shape-ok: diag fill — cadence-bounded
integer :: i, j, k, nx, ny, nz
real(wp) :: v_c, col
nx = min(size(buf, 1), size(v_face, 1))
ny = min(size(buf, 2), size(v_face, 2) - 1)
nz = min(size(v_face, 3), size(h_layer, 3))
do concurrent(j=1:ny, i=1:nx) &
local(v_c, col, k)
col = 0.0_wp
do k = 1, nz
v_c = 0.5_wp*(v_face(i, j, k) + v_face(i, j + 1, k))
col = col + h_layer(i, j, k)*v_c
end do
buf(i, j, 1) = col
end do
end subroutine fill_transport_y_impl