Field operation kernels for the OpenMP target backend, following cuda/kernels/fieldops.f90 and the sum/reorder kernels of cuda/kernels/reorder.f90.
Arrays are explicit-shape or assumed-size dummies named in
OMP_DEVICE_ADDR (see m_omptgt_common). Pointwise kernels see a field as
a flat array of n points, as the CUDA ones sweep the whole block.
Kernels on the pencil layout index a DIR_X/Y/Z field as (SZ, n, groups) in
the layout of m_ordering, which is not the one the CUDA kernels use: a
DIR_X group index is b = y_block + (z - 1)*n_yb_pad, y-blocks fastest
with n_yb_pad = ny_padded/SZ of them per z station.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | y(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
Scalar product of two DIR_C fields, whose storage is the padded Cartesian box n_c with the physical points in 1:dims.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | x(*) | |||
| real(kind=dp), | intent(in) | :: | y(*) | |||
| integer, | intent(in) | :: | n_c(3) | |||
| integer, | intent(in) | :: | dims(3) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | a(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | b(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | c(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n | |||
| real(kind=dp), | intent(inout) | :: | dst(n) | |||
| real(kind=dp), | intent(in) | :: | src(n) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n | |||
| real(kind=dp), | intent(in) | :: | alpha | |||
| real(kind=dp), | intent(in) | :: | x(n) | |||
| real(kind=dp), | intent(in) | :: | beta | |||
| real(kind=dp), | intent(inout) | :: | y(n) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | y(n) | |||
| real(kind=dp), | intent(in) | :: | x(n) | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(n) | |||
| real(kind=dp), | intent(in) | :: | alpha | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(n) | |||
| real(kind=dp), | intent(in) | :: | const | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | vort(n) | |||
| real(kind=dp), | intent(in) | :: | dudy(n) | |||
| real(kind=dp), | intent(in) | :: | dudz(n) | |||
| real(kind=dp), | intent(in) | :: | dvdx(n) | |||
| real(kind=dp), | intent(in) | :: | dvdz(n) | |||
| real(kind=dp), | intent(in) | :: | dwdx(n) | |||
| real(kind=dp), | intent(in) | :: | dwdy(n) | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | qcrit(n) | |||
| real(kind=dp), | intent(in) | :: | dudx(n) | |||
| real(kind=dp), | intent(in) | :: | dudy(n) | |||
| real(kind=dp), | intent(in) | :: | dudz(n) | |||
| real(kind=dp), | intent(in) | :: | dvdx(n) | |||
| real(kind=dp), | intent(in) | :: | dvdy(n) | |||
| real(kind=dp), | intent(in) | :: | dvdz(n) | |||
| real(kind=dp), | intent(in) | :: | dwdx(n) | |||
| real(kind=dp), | intent(in) | :: | dwdy(n) | |||
| real(kind=dp), | intent(in) | :: | dwdz(n) | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | nut(n) | |||
| real(kind=dp), | intent(in) | :: | mixing_length_sq(n) | |||
| real(kind=dp), | intent(in) | :: | dudx(n) | |||
| real(kind=dp), | intent(in) | :: | dudy(n) | |||
| real(kind=dp), | intent(in) | :: | dudz(n) | |||
| real(kind=dp), | intent(in) | :: | dvdx(n) | |||
| real(kind=dp), | intent(in) | :: | dvdy(n) | |||
| real(kind=dp), | intent(in) | :: | dvdz(n) | |||
| real(kind=dp), | intent(in) | :: | dwdx(n) | |||
| real(kind=dp), | intent(in) | :: | dwdy(n) | |||
| real(kind=dp), | intent(in) | :: | dwdz(n) | |||
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | stress(n) | |||
| real(kind=dp), | intent(in) | :: | nut(n) | |||
| real(kind=dp), | intent(in) | :: | gradient_a(n) | |||
| real(kind=dp), | intent(in) | :: | gradient_b(n) | |||
| real(kind=dp), | intent(in) | :: | scale_a | |||
| real(kind=dp), | intent(in) | :: | scale_b | |||
| integer, | intent(in) | :: | n |
Copies the first and last four points of every line into the start
and end send buffers. n is the line length, n_u the padded extent.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u_send_s(SZ,4,n_groups) | |||
| real(kind=dp), | intent(inout) | :: | u_send_e(SZ,4,n_groups) | |||
| real(kind=dp), | intent(in) | :: | u(SZ,n_u,n_groups) | |||
| integer, | intent(in) | :: | n_u | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_groups |
s(1:3, l) += sums of ga, gb and g*c over the points labelled l, as cuda/kernels/fieldops.f90: each thread accumulates runs of equal labels along its pencil and flushes a run when the label changes, so the atomics scale with the label changes rather than the points. Atomics instead of reduction(+:s), which flang cannot do on the GPU for an array whose shape is only known at run time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | s(3,n_label) | |||
| real(kind=dp), | intent(in) | :: | g(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | label(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | a(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | b(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | c(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_label | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
a, b, c += coeffs(1:3, l)*g at the points labelled l.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | coeffs(3,n_label) | |||
| real(kind=dp), | intent(in) | :: | g(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | label(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(inout) | :: | a(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(inout) | :: | b(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(inout) | :: | c(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_label | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
Maximum and sum of |f|.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | max_f | |||
| real(kind=dp), | intent(out) | :: | sum_f | |||
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
Signed maximum and sum of the slice f(:, i_slice, :).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | max_f | |||
| real(kind=dp), | intent(out) | :: | sum_f | |||
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_groups_pad*n_i) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | i_slice | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
Sum of the slice f(:, i_slice, :) with the weight w(j) on the points of stacked index j.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | sum_f | |||
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_groups_pad*n_i) | |||
| real(kind=dp), | intent(in) | :: | w(n_j) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | i_slice | |||
| integer, | intent(in) | :: | n_i | |||
| integer, | intent(in) | :: | n_groups_pad | |||
| integer, | intent(in) | :: | n_j |
Sets the x faces: a Dirichlet value c_start at the inlet (pencil index 1) and the convective outflow du/dt + Uc*du/dx = 0, Uc = c_end, at the outlet (pencil index nx). BC_NEUMANN (1) leaves a face untouched.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | c_start | |||
| real(kind=dp), | intent(in) | :: | c_end | |||
| integer, | intent(in) | :: | bc_start | |||
| integer, | intent(in) | :: | bc_end | |||
| real(kind=dp), | intent(in) | :: | flow_rate_diff | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
As field_set_x_face, with the inlet taken from the inlet plane of f_start rather than a constant.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | f_start(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | c_end | |||
| integer, | intent(in) | :: | bc_start | |||
| integer, | intent(in) | :: | bc_end | |||
| real(kind=dp), | intent(in) | :: | flow_rate_diff | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Add the constant c to every point of the x plane i_plane of f.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | c | |||
| integer, | intent(in) | :: | i_plane | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Writes two (ny, nz) planes into the x = 1 and x = nx planes of f. p_end is read only when apply_end is true.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | p_start(ny,nz) | |||
| real(kind=dp), | intent(in) | :: | p_end(ny,nz) | |||
| logical, | intent(in) | :: | apply_end | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
f += g on the x faces flagged by set_start/set_end.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | g(SZ,n_f,n_yb_pad*nz) | |||
| logical, | intent(in) | :: | set_start | |||
| logical, | intent(in) | :: | set_end | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Sets the bottom (y = 1) and top (y = ny) faces where flagged, so the two y faces can differ (ABL: no-slip floor, free-slip lid).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | c_start | |||
| real(kind=dp), | intent(in) | :: | c_end | |||
| logical, | intent(in) | :: | set_start | |||
| logical, | intent(in) | :: | set_end | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Copies the bottom and top y planes of f_start onto those of f.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | f_start(SZ,n_f,n_yb_pad*nz) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Writes two (nx, nz) planes into the y = 1 and y = ny planes of f. p_end is read only when apply_end is true.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | p_start(nx,nz) | |||
| real(kind=dp), | intent(in) | :: | p_end(nx,nz) | |||
| logical, | intent(in) | :: | apply_end | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
f += g on the y faces flagged by set_start/set_end.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | g(SZ,n_f,n_yb_pad*nz) | |||
| logical, | intent(in) | :: | set_start | |||
| logical, | intent(in) | :: | set_end | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Sets the y plane plane to c.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | c | |||
| integer, | intent(in) | :: | plane | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Drag law tau = drag_coeffu_c|u_h| from each column's own sampled velocity, written into one stress plane (component 1: x, 3: z). The velocity is interpolated between sample_plane and upper_plane.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | stress(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | u(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | w(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | drag_coeff | |||
| real(kind=dp), | intent(in) | :: | upper_weight | |||
| integer, | intent(in) | :: | sample_plane | |||
| integer, | intent(in) | :: | upper_plane | |||
| integer, | intent(in) | :: | stress_plane | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad | |||
| integer, | intent(in) | :: | component |
band(i, j, k) = f(i_start + i - 1, j, k) for a DIR_X vertex field
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | band(nband,ny,nz) | |||
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| integer, | intent(in) | :: | i_start | |||
| integer, | intent(in) | :: | nband | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n_yb_pad |
f(i_start + i - 1, j, k) = lambda(i)band(i, j, k) + (1 - lambda(i))f(i_start + i - 1, j, k) for a DIR_X vertex field
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| real(kind=dp), | intent(in) | :: | band(nband,ny,nz) | |||
| real(kind=dp), | intent(in) | :: | lambda(nband) | |||
| integer, | intent(in) | :: | i_start | |||
| integer, | intent(in) | :: | nband | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n_yb_pad |
First pass of field_plane_sums: partial(j, z) is the sum over x of y index j at z, summed in a fixed order.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | partial(ny,nz) | |||
| real(kind=dp), | intent(in) | :: | f(SZ,n_f,n_yb_pad*nz) | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | n_yb_pad |
Second pass of field_plane_sums: sums(j) is the sum over z of partial(j, z), in a fixed order.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | sums(ny) | |||
| real(kind=dp), | intent(in) | :: | partial(ny,nz) | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz |
Reorders u_i in layout dir_from into u_o in layout dir_to.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u_o(*) | |||
| real(kind=dp), | intent(in) | :: | u_i(*) | |||
| integer, | intent(in) | :: | dir_from | |||
| integer, | intent(in) | :: | dir_to | |||
| integer, | intent(in) | :: | cart_padded(3) |
u += u_d, where u is DIR_X and u_d the same field in layout dir_from.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(inout) | :: | u(*) | |||
| real(kind=dp), | intent(in) | :: | u_d(*) | |||
| integer, | intent(in) | :: | dir_from | |||
| integer, | intent(in) | :: | cart_padded(3) |
vals(1:3, p) = this rank's part of the trilinear interpolation of the DIR_X VERT fields a, b and c at points(:, p), one thread per point; see field_sample_points. 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 of the DIR_X layout.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(out) | :: | vals(3,n_points) | |||
| real(kind=dp), | intent(in) | :: | points(3,n_points) | |||
| real(kind=dp), | intent(in) | :: | a(SZ,n_f,n_k) | |||
| real(kind=dp), | intent(in) | :: | b(SZ,n_f,n_k) | |||
| real(kind=dp), | intent(in) | :: | c(SZ,n_f,n_k) | |||
| integer, | intent(in) | :: | n_points | |||
| integer, | intent(in) | :: | n_f | |||
| integer, | intent(in) | :: | n_k | |||
| real(kind=dp), | intent(in) | :: | d(3) | |||
| integer, | intent(in) | :: | grid(13) |
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.
| Type | Intent | Optional | 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) |