Appearance
adam_flume_fnl_kernels
ADAM, FLUME FNL device kernels.
Model-independent kernels; the per-model ones (face fluxes, auxiliary variables, signal speed) live in adam_flume_fnl_<model>_kernels (issue #41, section 4).
Module-level kernels (issue #35, D-11/D-12): private work arrays have constant bounds, no array section is ever an actual argument inside a loop body, host scalars are firstprivate, device arrays are DEVICEVAR/DEVICEPTR, and every offload !$acc directive is immediately followed by its !$omp twin. Device arrays are transposed, (b, i, j, k, v): the block index is stride-1, so it is the innermost loop of every collapse(4) nest.
Source: src/app/flume/fnl/adam_flume_fnl_kernels.F90
Dependencies
Contents
- apply_reflux_face_dev
- copy_state_dev
- compute_dflux_norms_dev
- compute_flux_difference_dev
- add_gravity_sources_dev
- add_potential_sources_dev
- subtract_equilibrium_residual_dev
- compute_gravity_correction_faces_dev
- add_gravity_limited_correction_dev
- compute_flux_difference_ib_dev
- poison_ghosts_dev
- compute_rk_ssp_residual_dev
- fill_seam_copy_dev
- pack_seam_skins_dev
- pack_density_dev
- unpack_potential_dev
- gather_seam_cells_dev
- gather_seam_stencils_dev
- gather_seam_faces_dev
- scatter_seam_faces_dev
- scatter_seam_cells_dev
- set_boundary_conditions_dev
Subroutines
apply_reflux_face_dev
Add the Berger-Colella correction scale delta(:, c) of one register face to the coarse skin cells of block b. With limit (the positivity limiter, issue #88) each cell receives the largest admissible fraction of its correction (reflux_positivity_theta), exactly the full one whenever admissible; nclip counts the others.
fortran
subroutine apply_reflux_face_dev(axis, sgn, b, ni, nj, nk, ngc, nv, nface_cells, scale, limit, mag_w, psi_w, delta_gpu, q_gpu, nclip)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. | |
nv | integer(kind=I4P) | in | Variables number. | |
nface_cells | integer(kind=I4P) | in | Skin cells number. | |
scale | real(kind=R8P) | in | Correction scale, sgn dt / dx_coarse. | |
limit | logical | in | Keep the corrected cells admissible. | |
mag_w | real(kind=R8P) | in | Magnetic and psi energy weights of the model. | |
psi_w | real(kind=R8P) | in | Magnetic and psi energy weights of the model. | |
delta_gpu | real(kind=R8P) | in | Flux mismatch F_coarse - F_fine_sum (nv, cells). | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
nclip | integer(kind=I4P) | out | Cells whose correction was limited. |
Call graph
copy_state_dev
Copy blocks 1:blocks_number of a device field, ghost cells included, into another (e.g. an idle RK stage buffer: the D_flux diagnostic evaluates the residual on a copy of the committed state, issue #68 A2).
fortran
subroutine copy_state_dev(ni, nj, nk, ngc, nv, blocks_number, src_gpu, dst_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. | |
nv | integer(kind=I4P) | in | Variables number. | |
blocks_number | integer(kind=I4P) | in | Blocks to copy. | |
src_gpu | real(kind=R8P) | in | Source field. | |
dst_gpu | real(kind=R8P) | inout | Destination field. |
Call graph
compute_dflux_norms_dev
Compute the D_flux norms (issue #68 A2), the device twin of the CPU compute_dflux_norms loop: D_flux of a cell is the divergence of the psi face fluxes minus the reflux correction corr of the coarse seam skin cells, over the psi flux per unit B_n (scale, c_h^2 or c_h); the norms are its maximum, its integral, its seam-local maximum (as compute_divb_norms_dev), the maximum of h |D_flux| (h the smallest active spacing of the block) and max|B|.
fortran
subroutine compute_dflux_norms_dev(ni, nj, nk, ngc, blocks_number, band, ipsi, ibx, scale, dxyz_gpu, is_null, seam_gpu, flx_gpu, fly_gpu, flz_gpu, corr_gpu, q_gpu, dflux_max, dflux_l1, dflux_seam_max, h_dflux_max, b_max)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 | Actual blocks number. | |
band | integer(kind=I4P) | in | Seam-local band width, in cells. | |
ipsi | integer(kind=I4P) | in | Indexes of psi and of B_x (B_y, B_z follow). | |
ibx | integer(kind=I4P) | in | Indexes of psi and of B_x (B_y, B_z follow). | |
scale | real(kind=R8P) | in | psi flux per unit B_n. | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
is_null | logical | in | Null directions. | |
seam_gpu | integer(kind=I4P) | in | Seam faces flags [nb, 6] (0: not a seam face). | |
flx_gpu | real(kind=R8P) | in | X-face fluxes [nb, 0:ni, 1:nj, 1:nk, nv]. | |
fly_gpu | real(kind=R8P) | in | Y-face fluxes [nb, 1:ni, 0:nj, 1:nk, nv]. | |
flz_gpu | real(kind=R8P) | in | Z-face fluxes [nb, 1:ni, 1:nj, 0:nk, nv]. | |
corr_gpu | real(kind=R8P) | in | Reflux correction [blocks_number, ni, nj, nk]. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
dflux_max | real(kind=R8P) | out | Maximum of |D_flux|. | |
dflux_l1 | real(kind=R8P) | out | Sum of |D_flux| dV. | |
dflux_seam_max | real(kind=R8P) | out | Maximum of |D_flux| over the seam-local cells. | |
h_dflux_max | real(kind=R8P) | out | Maximum of h |D_flux|. | |
b_max | real(kind=R8P) | out | Maximum of |B|. |
Call graph
compute_flux_difference_dev
Compute the residuals from the face fluxes, dq = -sum_d (F_{d,i+1/2} - F_{d,i-1/2}) / dx_d.
A null direction weighs zero, and the residual of the variable it freezes, freeze(d) (0: none), is zero: the normal momentum for Euler (CHASE semantics, issue #35, section 3.4), none for MHD (issue #41, M2-P3).
fortran
subroutine compute_flux_difference_dev(nv, ni, nj, nk, ngc, blocks_number, is_null, freeze, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Conservative variables number. | |
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 | Actual blocks number. | |
is_null | logical | in | Null directions. | |
freeze | integer(kind=I4P) | in | Variable frozen by each null direction (0: none). | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
add_gravity_sources_dev
Add the external gravity sources (issue #73, M7-G1; device twin of the CPU add_gravity_sources): rho g to the momentum, 1/2 sum_d g_d (F^rho_{d,i+1/2} + F^rho_{d,i-1/2}) plus its fourth-order correction (M7-G2a) to the energy.
fortran
subroutine add_gravity_sources_dev(ni, nj, nk, ngc, blocks_number, g, q_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, gc_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 | Actual blocks number. | |
g | real(kind=R8P) | in | Gravity. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
gc_gpu | real(kind=R8P) | in | Fourth-order correction of the energy source. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
add_potential_sources_dev
Add the gravity of the cell potential (issue #81, M8-P1; device twin of the CPU add_potential_sources): face gravity -(Phi_{i+1} - Phi_i) / dx_d, cell gravity the mean of the two faces; rho times the cell gravity to the momentum, 1/2 sum_d (g_{d,i+1/2} F^rho_{d,i+1/2} + g_{d,i-1/2} F^rho_{d,i-1/2}) to the energy.
fortran
subroutine add_potential_sources_dev(ni, nj, nk, ngc, blocks_number, is_null, dxyz_gpu, phi_gpu, q_gpu, flx_f_gpu, fly_f_gpu, flz_f_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 | Actual blocks number. | |
is_null | logical | in | Null directions. | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
phi_gpu | real(kind=R8P) | in | Gravitational potential, ghosts filled. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
subtract_equilibrium_residual_dev
Subtract the residual of the hydrostatic equilibrium from the residual of the stage (issue #73, M7-G2b; device twin of the CPU subtract_equilibrium_residual).
fortran
subroutine subtract_equilibrium_residual_dev(nv, ni, nj, nk, ngc, blocks_number, dq_e_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Variables number. | |
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 | Actual blocks number. | |
dq_e_gpu | real(kind=R8P) | in | Equilibrium residual. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
compute_gravity_correction_faces_dev
Set the fourth-order correction of the gravity energy source from the faces the block holds (issue #73, M7-G2a; device twin of the CPU compute_gravity_correction_faces): sum_d g_d (-F_{i-3/2} + F_{i-1/2} + F_{i+1/2} - F_{i+3/2}) / 24, the faces beyond the block left to add_gravity_edge_correction_dev.
fortran
subroutine compute_gravity_correction_faces_dev(ni, nj, nk, ngc, blocks_number, g, flx_f_gpu, fly_f_gpu, flz_f_gpu, gc_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 | Actual blocks number. | |
g | real(kind=R8P) | in | Gravity. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
gc_gpu | real(kind=R8P) | inout | Gravity energy correction [..., 1]. |
Call graph
add_gravity_limited_correction_dev
Remove (1 - Lambda) L from the gravity energy source (issue #73, M7-G1, option B; device twin of the CPU add_gravity_limited_correction).
fortran
subroutine add_gravity_limited_correction_dev(ni, nj, nk, ngc, blocks_number, lam_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 | Actual blocks number. | |
lam_gpu | real(kind=R8P) | in | Cell factors (1) and gravity excess (2). | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
compute_flux_difference_ib_dev
Compute the residuals from the face fluxes with immersed solids: the spacing of a fluid cell is cut by the solid surface (ib_cut_spacing, CHASE semantics, issue #35 D-9); device twin of the CPU flux difference with phi.
fortran
subroutine compute_flux_difference_ib_dev(nv, ni, nj, nk, ngc, blocks_number, is_null, freeze, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, phi_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nv | integer(kind=I4P) | in | Conservative variables number. | |
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 | Actual blocks number. | |
is_null | logical | in | Null directions. | |
freeze | integer(kind=I4P) | in | Variable frozen by each null direction (0: none). | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
phi_gpu | real(kind=R8P) | in | Distance function [nb, i, j, k, solids+1]. | |
dq_gpu | real(kind=R8P) | inout | Residuals. |
Call graph
poison_ghosts_dev
Set every ghost cell to a quiet NaN (verification instrument, [diagnostics] ghost_poison, issue #65).
fortran
subroutine poison_ghosts_dev(ni, nj, nk, ngc, nv, blocks_number, q_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. | |
nv | integer(kind=I4P) | in | Variables number. | |
blocks_number | integer(kind=I4P) | in | Actual blocks number. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
compute_rk_ssp_residual_dev
Compute the residual of a strong stability preserving step, dq = sum_s beta_s dq_s, from the stored stages.
Device twin of the residual that the host rk_object%update_q returns: the residuals history of the two backends then reports the same quantity (the effective step residual, not the last stage one).
fortran
subroutine compute_rk_ssp_residual_dev(ni, nj, nk, ngc, nv, blocks_number, nrk, beta_gpu, q_rk_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. | |
nv | integer(kind=I4P) | in | Variables number. | |
blocks_number | integer(kind=I4P) | in | Actual blocks number. | |
nrk | integer(kind=I4P) | in | Runge-Kutta stages number. | |
beta_gpu | real(kind=R8P) | in | Runge-Kutta beta coefficients. | |
q_rk_gpu | real(kind=R8P) | in | Stored stage residuals. | |
dq_gpu | real(kind=R8P) | inout | Step residual. |
Call graph
fill_seam_copy_dev
Copy a peer realm's interior cells into this realm's seam ghost cells, following the seam map rows.
fortran
subroutine fill_seam_copy_dev(row_start, row_count, nv, ngc, rows_gpu, src_gpu, dst_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
row_start | integer(kind=I4P) | in | Seam map slice of the peer. | |
row_count | integer(kind=I4P) | in | Seam map slice of the peer. | |
nv | integer(kind=I4P) | in | Variables number. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
rows_gpu | integer(kind=I4P) | in | Seam map rows. | |
src_gpu | real(kind=R8P) | in | Peer active buffer. | |
dst_gpu | real(kind=R8P) | inout | Own active buffer. |
Call graph
pack_seam_skins_dev
Pack the face fluxes of every seam register face f of the rank in one launch (issue #90, F-B): face faces_gpu(:,f) = [block, fec, first column - 1] goes to skins_gpu(:, first column:), its cells over the two tangential axes, inner fastest (x faces: j, k; y faces: i, k; z faces: i, j), the flux register order (accumulate_seam_skin).
fortran
subroutine pack_seam_skins_dev(n_faces, max_cells, faces_gpu, ni, nj, nk, nv, flx_f_gpu, fly_f_gpu, flz_f_gpu, skins_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n_faces | integer(kind=I4P) | in | Register faces number. | |
max_cells | integer(kind=I4P) | in | Most skin cells of a face, max(nj nk, ni nk, ni nj). | |
faces_gpu | integer(kind=I4P) | in | Faces [3, n_faces]: block, fec, first column - 1. | |
ni | integer(kind=I4P) | in | Grid dimensions. | |
nj | integer(kind=I4P) | in | Grid dimensions. | |
nk | integer(kind=I4P) | in | Grid dimensions. | |
nv | integer(kind=I4P) | in | Variables number. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
skins_gpu | real(kind=R8P) | inout | Packed skins (nv, columns). |
Call graph
pack_density_dev
Pack the interior density of every block into buf_gpu, block-major then k, j, i fastest: the order of the library FFT Poisson solver's solve_packed (issue #81, M8-P3), which gathers it on the host.
fortran
subroutine pack_density_dev(ni, nj, nk, ngc, blocks_number, q_gpu, buf_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 | Actual blocks number. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
buf_gpu | real(kind=R8P) | inout | Packed density [blocks_number ni nj nk]. |
Call graph
unpack_potential_dev
Unpack the potential of the active blocks, every ghost layer included, from buf_gpu (the host layout (i, j, k, b) flattened, i fastest) into phi_gpu(b, i, j, k, 1) (issue #81, M8-P3). Only the active blocks cross the bus: the host and device arrays are sized to the block capacity, not to the blocks in use.
fortran
subroutine unpack_potential_dev(ni, nj, nk, ngc, blocks_number, buf_gpu, phi_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 | Actual blocks number. | |
buf_gpu | real(kind=R8P) | in | Packed potential [(ni+2ngc)(nj+2ngc)(nk+2ngc) nb]. | |
phi_gpu | real(kind=R8P) | inout | Potential (b, i, j, k, 1). |
Call graph
gather_seam_cells_dev
Gather out_gpu(v, m) = a_gpu(b, i, j, k, v) at the cells cells_gpu(:, m) = (i, j, k, b) of a ghosted field (issue #50: the seam synchronisation of the positivity limiter works on the host, over the seam cells only).
fortran
subroutine gather_seam_cells_dev(n, nv, ngc, cells_gpu, a_gpu, out_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Cells number. | |
nv | integer(kind=I4P) | in | Components gathered (the first nv). | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
cells_gpu | integer(kind=I4P) | in | Cells (i, j, k, b) [4, n]. | |
a_gpu | real(kind=R8P) | in | Field. | |
out_gpu | real(kind=R8P) | inout | Gathered values [nv, n]. |
Call graph
gather_seam_stencils_dev
Gather the three axis stencils of half width s around the cells cells_gpu(:, m) = (i, j, k, b): out_gpu(v, l + s + 1, d, m) is the state l cells from the cell along d (issue #50).
fortran
subroutine gather_seam_stencils_dev(n, nv, ngc, s, cells_gpu, q_gpu, out_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Cells number. | |
nv | integer(kind=I4P) | in | Variables number. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
s | integer(kind=I4P) | in | Stencil half width (s <= ngc). | |
cells_gpu | integer(kind=I4P) | in | Cells (i, j, k, b) [4, n]. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
out_gpu | real(kind=R8P) | inout | Stencils [nv, 2 s + 1, 3, n]. |
Call graph
gather_seam_faces_dev
Gather the face fluxes at the faces faces_gpu(:, m) = (axis, i, j, k, b), (i, j, k) the face index of the flux array of axis (issue #50).
fortran
subroutine gather_seam_faces_dev(n, nv, faces_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, out_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Faces number. | |
nv | integer(kind=I4P) | in | Variables number. | |
faces_gpu | integer(kind=I4P) | in | Faces (axis, i, j, k, b) [5, n]. | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
out_gpu | real(kind=R8P) | inout | Gathered fluxes [nv, n]. |
Call graph
scatter_seam_faces_dev
Set the face fluxes at the faces faces_gpu(:, m) = (axis, i, j, k, b) to in_gpu(:, m) (issue #50).
fortran
subroutine scatter_seam_faces_dev(n, nv, faces_gpu, in_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Faces number. | |
nv | integer(kind=I4P) | in | Variables number. | |
faces_gpu | integer(kind=I4P) | in | Faces (axis, i, j, k, b) [5, n]. | |
in_gpu | real(kind=R8P) | in | Fluxes [nv, n]. | |
flx_f_gpu | real(kind=R8P) | inout | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | inout | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | inout | Z-face fluxes. |
Call graph
scatter_seam_cells_dev
Set a_gpu(b, i, j, k, v) = in_gpu(v, m) at the cells cells_gpu(:, m) = (i, j, k, b) (issue #50).
fortran
subroutine scatter_seam_cells_dev(n, nv, ngc, cells_gpu, in_gpu, a_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Cells number. | |
nv | integer(kind=I4P) | in | Components set (the first nv). | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
cells_gpu | integer(kind=I4P) | in | Cells (i, j, k, b) [4, n]. | |
in_gpu | real(kind=R8P) | in | Values [nv, n]. | |
a_gpu | real(kind=R8P) | inout | Field. |
Call graph
set_boundary_conditions_dev
Set boundary conditions on one crown, for the rows beyond pass realm faces (see the CPU set_boundary_conditions): pass 1 the face rows (each face's kind, inward along its normal), pass 2 and 3 the rows beyond two or three realm faces (the kind of one physical face among them, realm_edge_face, on the donor realm_edge_donor, issue #65 P0).
The caller runs the passes in order, and every donor is interior, filled by the exchange or the seams, or by an earlier pass: a face row reads the mirrored (walls) or the first interior (extrapolation) cell along its normal, never another ghost of its pass, so the rows of one launch are independent.
fortran
subroutine set_boundary_conditions_dev(ni, nj, nk, ngc, nv, crown, pass, face_kind, gamma, R, psi_energy, wall_velocity, wall_temperature, g, has_phi, phi_gpu, local_map_bc_crown_gpu, row_first, row_last, bc_rows_gpu, q_inflow_gpu, wall_sign_gpu, dxyz_gpu, q_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. | |
nv | integer(kind=I4P) | in | Conservative variables number. | |
crown | integer(kind=I4P) | in | Crown counter. | |
pass | integer(kind=I4P) | in | Realm faces the rows of this launch lie beyond. | |
face_kind | integer(kind=I4P) | in | Kind of each realm face, BC_SEAM for a seam. | |
gamma | real(kind=R8P) | in | Specific heats ratio, gas constant. | |
R | real(kind=R8P) | in | Specific heats ratio, gas constant. | |
psi_energy | real(kind=R8P) | in | 1 if the total energy holds psi^2 / 2 (EGLM). | |
wall_velocity | real(kind=R8P) | in | No-slip walls: wall velocity of each face. | |
wall_temperature | real(kind=R8P) | in | Isothermal walls: wall temperature of each face. | |
g | real(kind=R8P) | in | Hydrostatic faces: gravity (issue #73). | |
has_phi | logical | in | Hydrostatic faces: a cell potential (issue #81). | |
phi_gpu | real(kind=R8P) | in | Gravitational potential (read with has_phi). | |
local_map_bc_crown_gpu | integer(kind=I8P) | in | Boundary crown map (row, field, crown). | |
row_first | integer(kind=I4P) | in | The rows of pass in bc_rows_gpu(:,crown). | |
row_last | integer(kind=I4P) | in | The rows of pass in bc_rows_gpu(:,crown). | |
bc_rows_gpu | integer(kind=I4P) | in | Crown map rows grouped by pass, per crown. | |
q_inflow_gpu | real(kind=R8P) | in | Conservative inflow state of each face [nv, 6]. | |
wall_sign_gpu | real(kind=R8P) | in | Wall mirror sign per variable and direction [nv, 3]. | |
dxyz_gpu | real(kind=R8P) | in | Cell spacing of each block [nb, 3]. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph