Device-side out = accum * scale_factor. Used for MEAN
finalise where scale_factor = 1/dt_accum.
Local var named scale_factor (not scale) to dodge the
NVHPC 26.3 intrinsic-shadow bug
(feedback_nvhpc_local_intrinsic_shadow.md).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(inout) | :: | out(:,:,:) | |||
| real(kind=wp), | intent(in) | :: | accum(:,:,:) | |||
| real(kind=wp), | intent(in) | :: | scale_factor |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | i | ||||
| integer, | private | :: | j | ||||
| integer, | private | :: | k | ||||
| integer, | private | :: | nx | ||||
| integer, | private | :: | ny | ||||
| integer, | private | :: | nz |
pure subroutine finalise_scale_impl(out, accum, scale_factor) !! Device-side `out = accum * scale_factor`. Used for MEAN !! finalise where `scale_factor = 1/dt_accum`. !! !! Local var named `scale_factor` (not `scale`) to dodge the !! NVHPC 26.3 intrinsic-shadow bug !! (`feedback_nvhpc_local_intrinsic_shadow.md`). ! assumed-shape-ok: diag finalise — fires once per output frame (cadence-bounded). real(wp), intent(inout) :: out(:, :, :) real(wp), intent(in) :: accum(:, :, :) ! assumed-shape-ok: diag finalise — cadence-bounded real(wp), intent(in) :: scale_factor integer :: i, j, k, nx, ny, nz nx = size(out, 1) ny = size(out, 2) nz = size(out, 3) do concurrent(k=1:nz, j=1:ny, i=1:nx) out(i, j, k) = accum(i, j, k)*scale_factor end do end subroutine finalise_scale_impl