Skip to content

adam_flume_fnl_euler_kernels ​

ADAM, FLUME FNL device kernels of the Euler model.

The model-agnostic kernel bodies (adam_flume_fnl_{face,aux}_kernels_agnostic.INC) instantiated on the Euler physics: the private arrays are sized by the Euler constants NV_K = NV_EULER, NV_AUX_K = NV_AUX (issue #41, section 4), plus the Euler kernels whose body depends on the variables (conservation integrals, signal speed). Same kernel rules as adam_flume_fnl_kernels (issue #35, D-11/D-12).

Source: src/app/flume/fnl/adam_flume_fnl_euler_kernels.F90

Dependencies

Contents ​

Subroutines ​

compute_face_fluxes_dev ​

Compute the WENO face fluxes of direction d: face (i,j,k) lies between cells (i,j,k) and (i+di,j+dj,k+dk), so the face array starts at index 0 along d.

Per face (device twin of the CPU compute_face_fluxes): gather the stencil m = 1-S ... S into constant-bound privates, project and split it, reconstruct every field (the private v is the packed stencil of the WENO primitive), back-project.

fortran
subroutine compute_face_fluxes_dev(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, S, gamma, ch, is_characteristic, weno_a_gpu, weno_p_gpu, weno_d_gpu, weno_zeps, weno_sigma, q_gpu, q_aux_gpu, fl_gpu)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
diinteger(kind=I4P)inUnit step along d.
djinteger(kind=I4P)inUnit step along d.
dkinteger(kind=I4P)inUnit step along d.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
Sinteger(kind=I4P)inWENO stencil half-width.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (models with GLM only).
is_characteristiclogicalinCharacteristic (or conservative) variables.
weno_a_gpureal(kind=R8P)inWENO optimal weights.
weno_p_gpureal(kind=R8P)inWENO polynomials coefficients.
weno_d_gpureal(kind=R8P)inWENO smoothness indicators coefficients.
weno_zepsreal(kind=R8P)inWENO parameter avoiding division by zero.
weno_sigmareal(kind=R8P)inWENO descaler switch (0 Jiang-Shu, 1 SI).
q_gpureal(kind=R8P)inConservative variables.
q_aux_gpureal(kind=R8P)inAuxiliary variables.
fl_gpureal(kind=R8P)inoutFace fluxes of direction d.

Call graph

add_gravity_edge_correction_dev ​

Add the faces beyond the block to the gravity energy correction of direction d (issue #73, M7-G2a; device twin of the CPU add_gravity_edge_correction): cell 1 takes -g_d F^rho / 24 of face -1, cell n_d that of face n_d + 1, each face computed as compute_face_fluxes_dev does (the same body, its mass component kept).

fortran
subroutine add_gravity_edge_correction_dev(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, S, gamma, ch, is_characteristic, weno_a_gpu, weno_p_gpu, weno_d_gpu, weno_zeps, weno_sigma, ir, gd, q_gpu, q_aux_gpu, gc_gpu)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
diinteger(kind=I4P)inUnit step along d.
djinteger(kind=I4P)inUnit step along d.
dkinteger(kind=I4P)inUnit step along d.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
Sinteger(kind=I4P)inWENO stencil half-width.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (models with GLM only).
is_characteristiclogicalinCharacteristic (or conservative) variables.
weno_a_gpureal(kind=R8P)inWENO optimal weights.
weno_p_gpureal(kind=R8P)inWENO polynomials coefficients.
weno_d_gpureal(kind=R8P)inWENO smoothness indicators coefficients.
weno_zepsreal(kind=R8P)inWENO parameter avoiding division by zero.
weno_sigmareal(kind=R8P)inWENO descaler switch (0 Jiang-Shu, 1 SI).
irinteger(kind=I4P)inIndex of the density (mass) variable.
gdreal(kind=R8P)inGravity along d.
q_gpureal(kind=R8P)inConservative variables.
q_aux_gpureal(kind=R8P)inAuxiliary variables.
gc_gpureal(kind=R8P)inoutGravity energy correction [..., 1].

Call graph

compute_q_aux_dev ​

Compute the auxiliary variables on every cell, ghost cells included.

fortran
subroutine compute_q_aux_dev(ni, nj, nk, ngc, blocks_number, gamma, R, q_gpu, q_aux_gpu)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
Rreal(kind=R8P)inGas constant.
q_gpureal(kind=R8P)inConservative variables.
q_aux_gpureal(kind=R8P)inoutAuxiliary variables.

Call graph

count_nonfinite_dev ​

Count the non-finite (NaN or infinite) conservative values of the interior cells (issue #45): the exponent field has all its bits set. Tested on the bit pattern, so that no floating point mode (-fast) can fold the test away.

fortran
subroutine count_nonfinite_dev(ni, nj, nk, ngc, blocks_number, q_gpu, n)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
q_gpureal(kind=R8P)inConservative variables.
ninteger(kind=I8P)outNon-finite values number.

Call graph

compute_positivity_factors_dev ​

Compute the cell factor Lambda of every interior cell into lam_gpu(:,:,:,:,1) and count the cells whose backbone is not admissible and those with a non-finite high-order face flux (device twin of the CPU compute_positivity_factors).

fortran
subroutine compute_positivity_factors_dev(ni, nj, nk, ngc, blocks_number, gamma, ch, damping, hs, dt, g, has_phi, phi_gpu, dxyz_gpu, is_null, q_gpu, q_aux_gpu, flx_gpu, fly_gpu, flz_gpu, gc_gpu, lam_gpu, bad, nonfinite)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (EGLM only).
dampingreal(kind=R8P)inGLM damping rate (EGLM only).
hsinteger(kind=I4P)inHalf stencil of the sources, 1 <= hs <= S_MAX.
dtreal(kind=R8P)inForward-Euler step of the stage.
greal(kind=R8P)inGravity (issue #73), zero without it.
has_philogicalinThe cell potential is applied (issue #81).
phi_gpureal(kind=R8P)inGravitational potential (read with has_phi).
dxyz_gpureal(kind=R8P)inBlocks space steps [nb, 3].
is_nulllogicalinNull directions.
q_gpureal(kind=R8P)inConservative variables (ghosts updated).
q_aux_gpureal(kind=R8P)inAuxiliary variables.
flx_gpureal(kind=R8P)inX-face high-order fluxes.
fly_gpureal(kind=R8P)inY-face high-order fluxes.
flz_gpureal(kind=R8P)inZ-face high-order fluxes.
gc_gpureal(kind=R8P)inGravity energy correction (zero without it).
lam_gpureal(kind=R8P)inoutCell factors (component 1).
badinteger(kind=I4P)outCells with an inadmissible backbone.
nonfiniteinteger(kind=I4P)outCells with a non-finite high-order face flux.

Call graph

blend_positivity_fluxes_dev ​

Blend the face fluxes of direction d with the backbone, theta the smaller factor of the two cells; faces with theta = 1 untouched, faces with theta = 0 set to the backbone flux (device twin of the CPU blend_positivity_fluxes).

fortran
subroutine blend_positivity_fluxes_dev(d, di, dj, dk, ni, nj, nk, ngc, blocks_number, gamma, ch, q_gpu, lam_gpu, fl_gpu, limited)

Arguments

NameTypeIntentAttributesDescription
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
diinteger(kind=I4P)inUnit step along d.
djinteger(kind=I4P)inUnit step along d.
dkinteger(kind=I4P)inUnit step along d.
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (EGLM only).
q_gpureal(kind=R8P)inConservative variables.
lam_gpureal(kind=R8P)inCell factors (component 1).
fl_gpureal(kind=R8P)inoutFace fluxes of direction d.
limitedinteger(kind=I4P)outFaces with theta < 1.

Call graph

compute_seam_positivity_factors_host ​

Recompute on the host the factor of the cells beside a 2:1 seam with the seam faces' backbone and high-order fluxes overridden (issue #50, D1; the host twin of the CPU compute_seam_positivity_factors, fed by the device gathers of the seam cells: their axis stencils qs(:, l + hs + 1, d, n), auxiliary variables qa(:, n) and face fluxes fh(:, fec, n), fec 1..6 = -x, +x, -y, +y, -z, +z). dbad, dnonfinite: the change of the counts against the factors without the overrides, which the device kernel has already counted.

fortran
subroutine compute_seam_positivity_factors_host(ncells, hs, gamma, ch, damping, dt, g, has_phi, ps, ds, is_null, qs, qa, fh, omask, gcs, lsrc, olo, ohi, lam, dbad, dnonfinite)

Arguments

NameTypeIntentAttributesDescription
ncellsinteger(kind=I4P)inSeam cells.
hsinteger(kind=I4P)inStencil half width, 1 <= hs <= S_MAX.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (EGLM only).
dampingreal(kind=R8P)inGLM damping rate (EGLM only).
dtreal(kind=R8P)inForward-Euler step of the stage.
greal(kind=R8P)inGravity (issue #73), zero without it.
has_philogicalinThe cell potential is applied (issue #81).
psreal(kind=R8P)inPotential axis stencils [1, 3, 3, ncells] (with has_phi).
dsreal(kind=R8P)inSpace steps of the cells' blocks [3, ncells].
is_nulllogicalinNull directions.
qsreal(kind=R8P)inAxis stencils [nv, 2 hs + 1, 3, ncells].
qareal(kind=R8P)inAuxiliary variables [nv_aux, ncells].
fhreal(kind=R8P)inHigh-order face fluxes [nv, 6, ncells].
omasklogicalinOverridden faces [6, ncells].
gcsreal(kind=R8P)inGravity energy correction [ncells] (M7-G2a).
lsrcreal(kind=R8P)outGravity face-form excess L [ncells] (issue #73).
oloreal(kind=R8P)inOverride backbone fluxes [nv, 6, ncells].
ohireal(kind=R8P)inOverride high-order fluxes [nv, 6, ncells].
lamreal(kind=R8P)outCell factors [ncells].
dbadinteger(kind=I4P)outChange of the inadmissible backbones count.
dnonfiniteinteger(kind=I4P)outChange of the non-finite cells count.

Call graph

compute_backbone_fluxes_host ​

Compute on the host the backbone flux of n face state pairs of direction d (issue #50: the fine faces of a 2:1 seam take the coarse donor cell as their outer state).

fortran
subroutine compute_backbone_fluxes_host(n, d, gamma, ch, qL, qR, flo)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inFaces number.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed (EGLM only).
qLreal(kind=R8P)inLeft states [nv, n].
qRreal(kind=R8P)inRight states [nv, n].
floreal(kind=R8P)outBackbone fluxes [nv, n].

Call graph

positivity_cell_factor ​

The factor of one cell from its backbone update, antidiffusive differences and source difference (the decision of compute_positivity_factors_dev, for the host seam pass): status 1 inadmissible backbone, 2 non-finite difference (lc = 0 both), else 0 with lc the largest factor of the corner box.

Attributes: pure

fortran
subroutine positivity_cell_factor(nf, qb, dlt, dsrc, lc, status)

Arguments

NameTypeIntentAttributesDescription
nfinteger(kind=I4P)inActive faces.
qbreal(kind=R8P)inBackbone update.
dltreal(kind=R8P)inAntidiffusive differences.
dsrcreal(kind=R8P)inSource difference.
lcreal(kind=R8P)outCell factor.
statusinteger(kind=I4P)out0 admissible, 1 inadmissible backbone, 2 non-finite.

Call graph

blend_inadmissible_ghosts_dev ​

Blend every inadmissible face ghost of q_gpu toward the adjacent interior cell and count the ghosts blended (device twin of the CPU blend_inadmissible_ghosts).

fortran
subroutine blend_inadmissible_ghosts_dev(ni, nj, nk, ngc, blocks_number, is_null, q_gpu, blended)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
is_nulllogicalinNull directions.
q_gpureal(kind=R8P)inoutConservative variables (ghosts updated).
blendedinteger(kind=I4P)outGhosts blended.

Call graph

compute_conservation_dev ​

Compute the volume integrals of the conservative variables (interior cells). The cell volume includes the null directions: the tree splits them too, so a refined block's cells are smaller along them (issue #37).

fortran
subroutine compute_conservation_dev(ni, nj, nk, ngc, blocks_number, dxyz_gpu, q_gpu, integrals)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
dxyz_gpureal(kind=R8P)inBlocks space steps [nb, 3].
q_gpureal(kind=R8P)inConservative variables.
integralsreal(kind=R8P)outVolume integrals.

Call graph

compute_lambda_max_dev ​

Compute max(sum_d (|u_d| + a) / dx_d) over the interior cells (null directions excluded).

fortran
subroutine compute_lambda_max_dev(ni, nj, nk, ngc, blocks_number, gamma, R, dxyz_gpu, is_null, q_gpu, lambda_max)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio.
Rreal(kind=R8P)inGas constant.
dxyz_gpureal(kind=R8P)inBlocks space steps [nb, 3].
is_nulllogicalinNull directions.
q_gpureal(kind=R8P)inConservative variables.
lambda_maxreal(kind=R8P)outMaximum of sum_d (|u_d| + a) / dx_d.

Call graph

compute_lambda_max_dissipative_dev ​

Device twin of the CPU compute_lambda_max_dissipative (issue #65, D-M4-3): the maximum of the hyperbolic plus diffusive cell sum, the maxima of each part and the minimum cell Reynolds number.

fortran
subroutine compute_lambda_max_dissipative_dev(ni, nj, nk, ngc, blocks_number, gamma, R, cp, mu0, k0, eta, t_wall, tref, omega_mu, omega_k, dxyz_gpu, is_null, q_gpu, lambda_max, lambda_hyp, lambda_dif, re_cell_min)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid dimensions.
njinteger(kind=I4P)inGrid dimensions.
nkinteger(kind=I4P)inGrid dimensions.
ngcinteger(kind=I4P)inGrid dimensions.
blocks_numberinteger(kind=I4P)inActual blocks number.
gammareal(kind=R8P)inSpecific heats ratio, gas constant, cp.
Rreal(kind=R8P)inSpecific heats ratio, gas constant, cp.
cpreal(kind=R8P)inSpecific heats ratio, gas constant, cp.
mu0real(kind=R8P)inDissipative coefficients.
k0real(kind=R8P)inDissipative coefficients.
etareal(kind=R8P)inDissipative coefficients.
t_wallreal(kind=R8P)inHottest isothermal wall temperature, 0 if none.
trefreal(kind=R8P)inTemperature laws.
omega_mureal(kind=R8P)inTemperature laws.
omega_kreal(kind=R8P)inTemperature laws.
dxyz_gpureal(kind=R8P)inBlocks space steps [nb, 3].
is_nulllogicalinNull directions.
q_gpureal(kind=R8P)inConservative variables.
lambda_maxreal(kind=R8P)outMaximum of the sum.
lambda_hypreal(kind=R8P)outMaximum of the hyperbolic part.
lambda_difreal(kind=R8P)outMaximum of the diffusive part.
re_cell_minreal(kind=R8P)outMinimum cell Reynolds number.

Call graph

face_split_fluxes ​

Split adapter of the shared face kernel (issue #41, M2-P3): the Euler split, ch unused.

Attributes: pure

fortran
subroutine face_split_fluxes(gamma, ch, d, S, is_characteristic, qs, qas, fsplit, er, mu)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
Sinteger(kind=I4P)inWENO stencil half-width, S <= S_MAX.
is_characteristiclogicalinCharacteristic (or conservative) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fsplitreal(kind=R8P)outSplit fields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors.
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

backbone_face_flux ​

Backbone adapter of the positivity limiter: the Rusanov flux, ch unused.

Attributes: pure

fortran
subroutine backbone_face_flux(gamma, ch, d, qL, qR, f)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
dinteger(kind=I4P)inDirection, 1=x, 2=y, 3=z.
qLreal(kind=R8P)inLeft state.
qRreal(kind=R8P)inRight state.
freal(kind=R8P)outFlux.

Call graph

cell_sources ​

Sources adapter of the positivity limiter: none (Euler).

Attributes: pure

fortran
subroutine cell_sources(hs, damping, ds, w, qsx, qsy, qsz, qac, s_lo, s_hi)

Arguments

NameTypeIntentAttributesDescription
hsinteger(kind=I4P)inHalf stencil of the high-order sources.
dampingreal(kind=R8P)inGLM damping rate.
dsreal(kind=R8P)inBlock space steps.
wreal(kind=R8P)inDirection weights: 1 active, 0 null.
qsxreal(kind=R8P)inStencil along x.
qsyreal(kind=R8P)inStencil along y.
qszreal(kind=R8P)inStencil along z.
qacreal(kind=R8P)inCell auxiliary variables.
s_loreal(kind=R8P)outBackbone sources.
s_hireal(kind=R8P)outHigh-order sources.

Call graph

Functions ​

internal_energy ​

Internal-energy adapter of the positivity limiter: E minus the kinetic energy, per unit volume.

Attributes: pure

Returns: real(kind=R8P)

fortran
function internal_energy(q) result(e)

Arguments

NameTypeIntentAttributesDescription
qreal(kind=R8P)inConservative variables.

Call graph