add_gaussian_sources Subroutine

public subroutine add_gaussian_sources(a, b, c, src, box, n_src, n_box_y, n_box_z, inv_eps2, r_cut, n_f, n_k, d, grid)

a, b, c += src(4:6, s)*exp(-dist^2/eps^2) within r_cut of the point src(1:3, s), over the global index box box(1:3, s)..box(4:6, s); see source_index_boxes. Box indices are wrapped across periodic boundaries and skipped where this rank does not own them. One thread per (source, z, y) of the box, each sweeping x; sources overlap, so the adds are atomic. grid holds the local VERT dims, global VERT dims, rank offsets and periodic flags (1/0), three entries each, then the padded y-block count.

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(inout) :: a(SZ,n_f,n_k)
real(kind=dp), intent(inout) :: b(SZ,n_f,n_k)
real(kind=dp), intent(inout) :: c(SZ,n_f,n_k)
real(kind=dp), intent(in) :: src(6,n_src)
integer, intent(in) :: box(6,n_src)
integer, intent(in) :: n_src
integer, intent(in) :: n_box_y
integer, intent(in) :: n_box_z
real(kind=dp), intent(in) :: inv_eps2
real(kind=dp), intent(in) :: r_cut
integer, intent(in) :: n_f
integer, intent(in) :: n_k
real(kind=dp), intent(in) :: d(3)
integer, intent(in) :: grid(13)