Appearance
adam_ripple_fnl_kernels
RIPPLE, the FNL (OpenACC) device kernels.
The device twins of the CPU loops. Device arrays are transposed, (b, i, j, k, v): the block index is stride-1, so it is the innermost loop of every nest. Host scalars are firstprivate, device arrays DEVICEVAR (FUNDAL's deviceptr), private work arrays have constant bounds.
Source: src/app/ripple/fnl/adam_ripple_fnl_kernels.F90
Dependencies
Contents
Subroutines
compute_face_fluxes_dev
Face fluxes along the axis of unit step (di, dj, dk), device twin of the CPU face_fluxes: the split fluxes a+ u (cells m = 1-S ... S-1) and a- u (cells m+1) of the stencil of face i+1/2, reconstructed by WENO and summed.
fortran
subroutine compute_face_fluxes_dev(di, dj, dk, ni, nj, nk, ngc, blocks_number, S, a, weno_a_gpu, weno_p_gpu, weno_d_gpu, weno_zeps, q_gpu, fl_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
di | integer(kind=I4P) | in | Unit step. | |
dj | integer(kind=I4P) | in | Unit step. | |
dk | integer(kind=I4P) | in | Unit step. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ngc | integer(kind=I4P) | in | Grid dimensions. | |
blocks_number | integer(kind=I4P) | in | Blocks in use. | |
S | integer(kind=I4P) | in | WENO half stencil. | |
a | real(kind=R8P) | in | Velocity component. | |
weno_a_gpu | real(kind=R8P) | in | WENO optimal weights. | |
weno_p_gpu | real(kind=R8P) | in | WENO polynomials coefficients. | |
weno_d_gpu | real(kind=R8P) | in | WENO smoothness indicators coefficients. | |
weno_zeps | real(kind=R8P) | in | WENO parameter avoiding division by zero. | |
q_gpu | real(kind=R8P) | in | State. | |
fl_gpu | real(kind=R8P) | inout | Face fluxes. |
Call graph
compute_flux_difference_dev
Residuals dq = -sum_d w_d (F_{i+1/2} - F_{i-1/2}) / dx_d, w_d 1 on an active axis, 0 on a null one.
fortran
subroutine compute_flux_difference_dev(ni, nj, nk, ngc, blocks_number, w, dxyz_gpu, flx_gpu, fly_gpu, flz_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ngc | integer(kind=I4P) | in | Grid dimensions. | |
blocks_number | integer(kind=I4P) | in | Blocks in use. | |
w | real(kind=R8P) | in | Axis weights. | |
dxyz_gpu | real(kind=R8P) | in | Block spacings [nb, 3]. | |
flx_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_gpu | real(kind=R8P) | in | Z-face fluxes. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
pack_face_skin_dev
Pack the face fluxes of face fec of block b into skin_gpu(1, c), c running over the two tangential axes, inner fastest (x faces: j, k; y faces: i, k; z faces: i, j): the flux register's order.
fortran
subroutine pack_face_skin_dev(fec, b, ni, nj, nk, flx_gpu, fly_gpu, flz_gpu, skin_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Face (1..6: -x, +x, -y, +y, -z, +z), block. | |
b | integer(kind=I4P) | in | Face (1..6: -x, +x, -y, +y, -z, +z), block. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
flx_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_gpu | real(kind=R8P) | in | Z-face fluxes. | |
skin_gpu | real(kind=R8P) | inout | Skin (1, cells). |
Call graph
apply_reflux_face_dev
Add scale delta(1, c) to the coarse skin cells of block b on the face of normal axis and side sgn.
fortran
subroutine apply_reflux_face_dev(axis, sgn, b, ni, nj, nk, ngc, nface_cells, scale, delta_gpu, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
axis | integer(kind=I4P) | in | Face normal axis (1..3) and side (+-1). | |
sgn | integer(kind=I4P) | in | Face normal axis (1..3) and side (+-1). | |
b | integer(kind=I4P) | in | Coarse block. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
ngc | integer(kind=I4P) | in | Grid dimensions. | |
nface_cells | integer(kind=I4P) | in | Skin cells. | |
scale | real(kind=R8P) | in | sgn dt / dx_coarse. | |
delta_gpu | real(kind=R8P) | in | Flux mismatch F_coarse - F_fine (1, cells). | |
q_gpu | real(kind=R8P) | inout | State. |
Call graph