Skip to content

adam_flume_fnl_mhd_eglm_hlld_kernels ​

ADAM, FLUME FNL device kernels of the MHD-EGLM model with the HLLD Riemann solver (scheme weno-riemann).

The model- and solver-agnostic face loop (adam_flume_fnl_riemann_face_kernels_agnostic.INC, issue #47) instantiated on the MHD-EGLM model and the HLLD solver of adam_flume_mhd_riemann_library: the local arrays are sized by NV_K = NV_MHD_EGLM, NV_AUX_K = NV_AUX_MHD, and the four adapters call the MHD libraries.

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

Dependencies

Contents ​

Subroutines ​

compute_riemann_face_fluxes_dev ​

Compute the weno-riemann 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_riemann_face_fluxes): gather the stencil m = min(1-S,-1) ... max(S,2) into constant-bound privates, WENO-interpolate its fields to the two face states (weno_a_gpu, weno_p_gpu are the INTERPOLATION tables), take the Riemann flux F and add the correction F^ = F + s (cc(1) F + cc(2) (f_0 + f_1) + cc(3) (f_-1 + f_2) - F), s = 1 where every WENO weights ratio is >= tau, else 0; fallbacks counts the faces whose Riemann solver fell back (HLLD to HLL).

fortran
subroutine compute_riemann_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, cc, tau, q_gpu, q_aux_gpu, fl_gpu, fallbacks)

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 primitive) variables.
weno_a_gpureal(kind=R8P)inWENO interpolation optimal weights.
weno_p_gpureal(kind=R8P)inWENO interpolation 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).
ccreal(kind=R8P)inCorrection coefficients.
taureal(kind=R8P)inSensor threshold.
q_gpureal(kind=R8P)inConservative variables.
q_aux_gpureal(kind=R8P)inAuxiliary variables.
fl_gpureal(kind=R8P)inoutFace fluxes of direction d.
fallbacksinteger(kind=I4P)outFaces whose Riemann solver fell back.

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 of weno-riemann): each face computed as compute_riemann_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, cc, tau, 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 primitive) variables.
weno_a_gpureal(kind=R8P)inWENO interpolation optimal weights.
weno_p_gpureal(kind=R8P)inWENO interpolation 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).
ccreal(kind=R8P)inCorrection coefficients.
taureal(kind=R8P)inSensor threshold.
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

face_interpolation_fields ​

Interpolation-fields adapter of the shared face kernel: the MHD fields, the EGLM eigenvectors, ch unused.

Attributes: pure

fortran
subroutine face_interpolation_fields(gamma, ch, d, S, is_characteristic, qs, qas, fint, 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 primitive) variables.
qsreal(kind=R8P)inStencil conservative variables.
qasreal(kind=R8P)inStencil auxiliary variables.
fintreal(kind=R8P)outFields in the WENO upwind layout.
erreal(kind=R8P)outRight eigenvectors.
mureal(kind=R8P)outMagnitude of each field (WENO descaler).

Call graph

face_states ​

Face-states adapter of the shared face kernel: the MHD states, ch unused.

Attributes: pure

fortran
subroutine face_states(gamma, ch, is_characteristic, er, vr, q0, q1, qL, qR)

Arguments

NameTypeIntentAttributesDescription
gammareal(kind=R8P)inSpecific heats ratio.
chreal(kind=R8P)inGLM cleaning speed.
is_characteristiclogicalinCharacteristic (or primitive) variables.
erreal(kind=R8P)inRight eigenvectors.
vrreal(kind=R8P)inInterpolated fields.
q0real(kind=R8P)inConservative variables of cell 0.
q1real(kind=R8P)inConservative variables of cell 1.
qLreal(kind=R8P)outLeft state.
qRreal(kind=R8P)outRight state.

Call graph

riemann_flux ​

Riemann-solver adapter of the shared face kernel: MHD HLLD, ch the GLM cleaning speed, fallback to HLL flagged.

Attributes: pure

fortran
subroutine riemann_flux(gamma, ch, d, qL, qR, f, fallback)

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.
fallbacklogicaloutFallback flag (HLL used instead of HLLD).

Call graph

cell_flux ​

Cell-flux adapter of the shared face kernel: the MHD physical flux, gamma unused.

Attributes: pure

fortran
subroutine cell_flux(gamma, ch, d, q, qa, 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.
qreal(kind=R8P)inConservative variables.
qareal(kind=R8P)inAuxiliary variables.
freal(kind=R8P)outPhysical flux.

Call graph