Zero the subcycle-averaged ice->ocean stress accumulators via an
explicit do concurrent device kernel (F1): fxoc/fyoc are
copyin-mapped device-resident arrays, so a host = 0.0_wp would
zero only the HOST copy and leave the device copy carrying the
prior call’s average (the accumulate below would then converge to
S/(N-1) instead of S/N). Runs on the device-present arrays; inert
no-op on host builds.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(out) | :: | fxoc(nx+1,ny) | |||
| real(kind=wp), | intent(out) | :: | fyoc(nx,ny+1) | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j |
pure subroutine evp_zero_stress_impl(fxoc, fyoc, nx, ny) !! Zero the subcycle-averaged ice->ocean stress accumulators via an !! explicit `do concurrent` device kernel (F1): `fxoc`/`fyoc` are !! copyin-mapped device-resident arrays, so a host `= 0.0_wp` would !! zero only the HOST copy and leave the device copy carrying the !! prior call's average (the accumulate below would then converge to !! S/(N-1) instead of S/N). Runs on the device-present arrays; inert !! no-op on host builds. integer, intent(in) :: nx, ny real(wp), intent(out) :: fxoc(nx + 1, ny) real(wp), intent(out) :: fyoc(nx, ny + 1) integer :: i, j do concurrent(j=1:ny, i=1:nx + 1) fxoc(i, j) = 0.0_wp end do do concurrent(j=1:ny + 1, i=1:nx) fyoc(i, j) = 0.0_wp end do end subroutine evp_zero_stress_impl