Skip to content

adam_prism_fnl_kernels

ADAM, PRISM FNL application kernels.

Source: src/app/prism/fnl/adam_prism_fnl_kernels.F90

Dependencies

Contents

Subroutines

compute_coils_current_dev

Compute current coils sources.

fortran
subroutine compute_coils_current_dev(ni, nj, nk, ngc, blocks_number, time, a_gpu, d_gpu, f_gpu, phase_gpu, coil_flag_gpu, td, j_vec_gpu, dx_gpu, q_gpu)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid cells number in I direction.
njinteger(kind=I4P)inGrid cells number in J direction.
nkinteger(kind=I4P)inGrid cells number in K direction.
ngcinteger(kind=I4P)inGhost cells number.
blocks_numberinteger(kind=I4P)inNumber of blocks.
timereal(kind=R8P)inSimulation time, to compute current value if AC.
a_gpureal(kind=R8P)inCurrent amplitude (A).
d_gpureal(kind=R8P)inWire diameter.
f_gpureal(kind=R8P)inCurrent frequency, if AC (Hz).
phase_gpureal(kind=R8P)inCurrent initial phase, if AC.
coil_flag_gpuinteger(kind=I4P)inCoils ID map.
tdreal(kind=R8P)inCoils transitory delay.
j_vec_gpureal(kind=R8P)inCurrent J versors into coils.
dx_gpureal(kind=R8P)inSpace step in x direction.
q_gpureal(kind=R8P)inoutField variables.

Call graph

compute_div_d_b_dev

Compute div(D), div(B).

fortran
subroutine compute_div_d_b_dev(ni, nj, nk, ngc, blocks_number, dx_gpu, q_gpu, div_gpu)

Arguments

NameTypeIntentAttributesDescription
niinteger(kind=I4P)inGrid cells number in I direction.
njinteger(kind=I4P)inGrid cells number in J direction.
nkinteger(kind=I4P)inGrid cells number in K direction.
ngcinteger(kind=I4P)inGhost cells number.
blocks_numberinteger(kind=I4P)inNumber of blocks.
dx_gpureal(kind=R8P)inSpace step in x direction (m)
q_gpureal(kind=R8P)inField variables.
div_gpureal(kind=R8P)inoutDivergence of D, B.

compute_fluxes_convective_dev

Compute convective fluxes along x direction. is done by compiler, check it!

fortran
subroutine compute_fluxes_convective_dev(dir, blocks_number, ni, nj, nk, ngc, nv_c, weno_s, weno_zeps, weno_a_gpu, weno_p_gpu, weno_d_gpu, evmax, ER_GPU, EL_GPU, si_gpu, sir_gpu, q_gpu, fluxes_gpu)

Arguments

NameTypeIntentAttributesDescription
dirinteger(kind=I4P)inDirection, 1=X, 2=Y, 3=Z.
blocks_numberinteger(kind=I4P)inNumber of blocks.
niinteger(kind=I4P)inGrid cells number in I direction.
njinteger(kind=I4P)inGrid cells number in J direction.
nkinteger(kind=I4P)inGrid cells number in K direction.
ngcinteger(kind=I4P)inGhost cells number.
nv_cinteger(kind=I4P)inNumber of conservative varibales in q vector.
weno_sinteger(kind=I4P)inWeno stencils number/dimension.
weno_zepsreal(kind=R8P)inParameter to avoid division by zero.
weno_a_gpureal(kind=R8P)inOptimal weights.
weno_p_gpureal(kind=R8P)inPolinomials coefficients.
weno_d_gpureal(kind=R8P)inSmoothness indicators coefficients.
evmaxreal(kind=R8P)inMaximum eigenvalue.
ER_GPUreal(kind=R8P)inEigenvectors.
EL_GPUreal(kind=R8P)inEigenvectors.
si_gpuinteger(kind=I4P)inDirectional (1=x,2=y,3=z) increment.
sir_gpureal(kind=R8P)inDirectional (1=x,2=y,3=z) increment, real cast.
q_gpureal(kind=R8P)inFields variables.
fluxes_gpureal(kind=R8P)inoutFluxes.

Call graph

compute_fluxes_difference_dev

Compute fluxes difference.

fortran
subroutine compute_fluxes_difference_dev(blocks_number, ni, nj, nk, ngc, nv_c, dx_gpu, dy_gpu, dz_gpu, flx_gpu, fly_gpu, flz_gpu, q_gpu, eta, chi, d_divergence_cleaner, b_divergence_cleaner, dq_gpu)

Arguments

NameTypeIntentAttributesDescription
blocks_numberinteger(kind=I4P)inNumber of blocks.
niinteger(kind=I4P)inGrid cells number in I direction.
njinteger(kind=I4P)inGrid cells number in J direction.
nkinteger(kind=I4P)inGrid cells number in K direction.
ngcinteger(kind=I4P)inGhost cells number.
nv_cinteger(kind=I4P)inNumber of conservative varibales in q.
dx_gpureal(kind=R8P)inSpace steps.
dy_gpureal(kind=R8P)inSpace steps.
dz_gpureal(kind=R8P)inSpace steps.
flx_gpureal(kind=R8P)inX direction fluxes.
fly_gpureal(kind=R8P)inY direction fluxes.
flz_gpureal(kind=R8P)inZ direction fluxes.
q_gpureal(kind=R8P)inFields.
etareal(kind=R8P)inCoefficiente modello correzione divergenza campi.
chireal(kind=R8P)inCoefficiente modello correzione divergenza campi.
d_divergence_cleanerlogicalinFlag to perform electric field divergence cleaning.
b_divergence_cleanerlogicalinFlag to perform magnetic field divergence cleaning.
dq_gpureal(kind=R8P)inoutFluxes differences.

Call graph

set_sir_dev

Set directional increment si and sir on device.

fortran
subroutine set_sir_dev(si_gpu, sir_gpu)

Arguments

NameTypeIntentAttributesDescription
si_gpuinteger(kind=I4P)inoutDirectional (1=x,2=y,3=z) increment.
sir_gpureal(kind=R8P)inoutDirectional (1=x,2=y,3=z) increment, real cast.

compute_fluxes_convective_ri_dev

Compute convective fluxes at right interface of b,i,j,k.

fortran
subroutine compute_fluxes_convective_ri_dev(dir, b, i, j, k, ngc, nv_c, weno_s, weno_zeps, weno_a, weno_p, weno_d, evmax, ER, EL, si, sir, q, fluxes)

Arguments

NameTypeIntentAttributesDescription
dirinteger(kind=I4P)inDirection, 1=X, 2=Y, 3=Z.
binteger(kind=I4P)inCounter.
iinteger(kind=I4P)inCounter.
jinteger(kind=I4P)inCounter.
kinteger(kind=I4P)inCounter.
ngcinteger(kind=I4P)inGhost cells number.
nv_cinteger(kind=I4P)inNumber of conservative varibales in q vector.
weno_sinteger(kind=I4P)inWeno stencils number/dimension.
weno_zepsreal(kind=R8P)inParameter to avoid division by zero.
weno_areal(kind=R8P)inOptimal weights.
weno_preal(kind=R8P)inPolinomials coefficients.
weno_dreal(kind=R8P)inSmoothness indicators coefficients.
evmaxreal(kind=R8P)inMaximum eigenvalue.
ERreal(kind=R8P)inEigenvectors.
ELreal(kind=R8P)inEigenvectors.
siinteger(kind=I4P)inStencil increment.
sirreal(kind=R8P)inStencil increment, real cast.
qreal(kind=R8P)inFields variables.
fluxesreal(kind=R8P)inoutFluxes.

Call graph

decompose_fluxes_convective_dev

Decompose convective fluxes.

fortran
subroutine decompose_fluxes_convective_dev(dir, si, sir, b, i, j, k, ngc, nv_c, weno_s, evmax, EL, q, fmpc)

Arguments

NameTypeIntentAttributesDescription
dirinteger(kind=I4P)inDirection, 1=X, 2=Y, 3=Z.
siinteger(kind=I4P)inStencil increment.
sirreal(kind=R8P)inStencil increment, real cast.
binteger(kind=I4P)inCounter.
iinteger(kind=I4P)inCounter.
jinteger(kind=I4P)inCounter.
kinteger(kind=I4P)inCounter.
ngcinteger(kind=I4P)inGhost cells number.
nv_cinteger(kind=I4P)inNumber of conservative varibales in q vector.
weno_sinteger(kind=I4P)inWeno stencils number/dimension.
evmaxreal(kind=R8P)inMaximum eigenvalue.
ELreal(kind=R8P)inLeft eigenvectors.
qreal(kind=R8P)inAuxiliary variables.
fmpcreal(kind=R8P)inoutFluxes -+ decomposition in characteristics space.

Call graph

compute_convective_fluxes_maxwell_dev

Compute convective fluxes.

 Fx(1) =  0       Fy(1) = -Bz/muz  Fz(1) =  By/muy
 Fx(2) =  Bz/muz  Fy(2) =  0       Fz(2) = -Bx/mux
 Fx(3) = -By/muy  Fy(3) =  Bx/mux  Fz(3) =  0
 Fx(4) =  0       Fy(4) =  Dz/epsz Fz(4) = -Dy/epsy
 Fx(5) = -Dz/epsz Fy(5) =  0       Fz(5) =  Dx/epsx
 Fx(6) =  Dy/epsy Fy(6) = -Dx/epsx Fz(6) =  0
fortran
subroutine compute_convective_fluxes_maxwell_dev(sir, q, f)

Arguments

NameTypeIntentAttributesDescription
sirreal(kind=R8P)inDirectional (1=x,2=y,3=z) increment.
qreal(kind=R8P)inAuxiliary variables.
freal(kind=R8P)inoutConservative fluxes.

Call graph