subroutine tides_update_eta_eq_impl(nx, ny, nconst, species_c, amp_cos, &
amp_sin, cos_struct, sin_struct, eta_eq)
!! Flat-impl device fill (explicit-shape dummies — no descriptor
!! walk). eta_eq(i,j) = sum_c amp_cos(c)*cos_struct(i,j,m)
!! + amp_sin(c)*sin_struct(i,j,m),
!! m = species_c(c). Contiguous index (i) innermost.
integer, intent(in) :: nx, ny, nconst
integer, intent(in) :: species_c(nconst)
real(wp), intent(in) :: amp_cos(nconst), amp_sin(nconst)
real(wp), intent(in) :: cos_struct(nx, ny, 3), sin_struct(nx, ny, 3)
real(wp), intent(out) :: eta_eq(nx, ny)
integer :: i, j, c, m
real(wp) :: acc
do concurrent(j=1:ny, i=1:nx) local(acc, c, m)
acc = 0.0_wp
do c = 1, nconst
m = species_c(c)
acc = acc + amp_cos(c)*cos_struct(i, j, m) + amp_sin(c)*sin_struct(i, j, m)
end do
eta_eq(i, j) = acc
end do
end subroutine tides_update_eta_eq_impl