pure subroutine relax_map_tracer_impl(hTr, h_layer, ref_tracer, it, n_tr, &
idamp_h, nx, ny, nz, dt)
!! Relax one tracer's `hTr` toward `ref_tracer(:,:,:,it)*h_layer` at
!! rate `idamp_h`, no budget mirror (every tracer except S/T — see
!! `relax_map_tracer_budget_impl`). `ref_tracer` is passed WHOLE +
!! indexed by the scalar `it` inside the kernel — never sliced by the
!! caller (§6.4: a device array section of a mapped array is the
!! descriptor-walk trap the `dc-assumed-shape` hook exists to catch).
integer, intent(in) :: it, n_tr, nx, ny, nz
real(wp), intent(inout) :: hTr(nx, ny, nz)
real(wp), intent(in) :: h_layer(nx, ny, nz)
real(wp), intent(in) :: ref_tracer(nx, ny, nz, n_tr)
real(wp), intent(in) :: idamp_h(nx, ny)
real(wp), intent(in) :: dt
integer :: i, j, k
real(wp) :: decay, tgt
do concurrent(k=1:nz, j=1:ny, i=1:nx) local(decay, tgt)
if (idamp_h(i, j) > 0.0_wp) then
decay = exp(-idamp_h(i, j)*dt)
tgt = ref_tracer(i, j, k, it)*h_layer(i, j, k)
hTr(i, j, k) = relax_toward(hTr(i, j, k), tgt, decay)
end if
end do
end subroutine relax_map_tracer_impl