Appearance
adam_prism_fnl_kernels
ADAM, PRISM FNL application kernels.
Source: src/app/prism/fnl/adam_prism_fnl_kernels.F90
Dependencies
Contents
- compute_coils_current_dev
- compute_div_d_b_dev
- compute_fluxes_convective_dev
- compute_fluxes_difference_dev
- set_sir_dev
- compute_fluxes_convective_ri_dev
- decompose_fluxes_convective_dev
- compute_convective_fluxes_maxwell_dev
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
time | real(kind=R8P) | in | Simulation time, to compute current value if AC. | |
a_gpu | real(kind=R8P) | in | Current amplitude (A). | |
d_gpu | real(kind=R8P) | in | Wire diameter. | |
f_gpu | real(kind=R8P) | in | Current frequency, if AC (Hz). | |
phase_gpu | real(kind=R8P) | in | Current initial phase, if AC. | |
coil_flag_gpu | integer(kind=I4P) | in | Coils ID map. | |
td | real(kind=R8P) | in | Coils transitory delay. | |
j_vec_gpu | real(kind=R8P) | in | Current J versors into coils. | |
dx_gpu | real(kind=R8P) | in | Space step in x direction. | |
q_gpu | real(kind=R8P) | inout | Field 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
dx_gpu | real(kind=R8P) | in | Space step in x direction (m) | |
q_gpu | real(kind=R8P) | in | Field variables. | |
div_gpu | real(kind=R8P) | inout | Divergence 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q vector. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_zeps | real(kind=R8P) | in | Parameter to avoid division by zero. | |
weno_a_gpu | real(kind=R8P) | in | Optimal weights. | |
weno_p_gpu | real(kind=R8P) | in | Polinomials coefficients. | |
weno_d_gpu | real(kind=R8P) | in | Smoothness indicators coefficients. | |
evmax | real(kind=R8P) | in | Maximum eigenvalue. | |
ER_GPU | real(kind=R8P) | in | Eigenvectors. | |
EL_GPU | real(kind=R8P) | in | Eigenvectors. | |
si_gpu | integer(kind=I4P) | in | Directional (1=x,2=y,3=z) increment. | |
sir_gpu | real(kind=R8P) | in | Directional (1=x,2=y,3=z) increment, real cast. | |
q_gpu | real(kind=R8P) | in | Fields variables. | |
fluxes_gpu | real(kind=R8P) | inout | Fluxes. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
blocks_number | integer(kind=I4P) | in | Number of blocks. | |
ni | integer(kind=I4P) | in | Grid cells number in I direction. | |
nj | integer(kind=I4P) | in | Grid cells number in J direction. | |
nk | integer(kind=I4P) | in | Grid cells number in K direction. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q. | |
dx_gpu | real(kind=R8P) | in | Space steps. | |
dy_gpu | real(kind=R8P) | in | Space steps. | |
dz_gpu | real(kind=R8P) | in | Space steps. | |
flx_gpu | real(kind=R8P) | in | X direction fluxes. | |
fly_gpu | real(kind=R8P) | in | Y direction fluxes. | |
flz_gpu | real(kind=R8P) | in | Z direction fluxes. | |
q_gpu | real(kind=R8P) | in | Fields. | |
eta | real(kind=R8P) | in | Coefficiente modello correzione divergenza campi. | |
chi | real(kind=R8P) | in | Coefficiente modello correzione divergenza campi. | |
d_divergence_cleaner | logical | in | Flag to perform electric field divergence cleaning. | |
b_divergence_cleaner | logical | in | Flag to perform magnetic field divergence cleaning. | |
dq_gpu | real(kind=R8P) | inout | Fluxes differences. |
Call graph
set_sir_dev
Set directional increment si and sir on device.
fortran
subroutine set_sir_dev(si_gpu, sir_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
si_gpu | integer(kind=I4P) | inout | Directional (1=x,2=y,3=z) increment. | |
sir_gpu | real(kind=R8P) | inout | Directional (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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
b | integer(kind=I4P) | in | Counter. | |
i | integer(kind=I4P) | in | Counter. | |
j | integer(kind=I4P) | in | Counter. | |
k | integer(kind=I4P) | in | Counter. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q vector. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
weno_zeps | real(kind=R8P) | in | Parameter to avoid division by zero. | |
weno_a | real(kind=R8P) | in | Optimal weights. | |
weno_p | real(kind=R8P) | in | Polinomials coefficients. | |
weno_d | real(kind=R8P) | in | Smoothness indicators coefficients. | |
evmax | real(kind=R8P) | in | Maximum eigenvalue. | |
ER | real(kind=R8P) | in | Eigenvectors. | |
EL | real(kind=R8P) | in | Eigenvectors. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
q | real(kind=R8P) | in | Fields variables. | |
fluxes | real(kind=R8P) | inout | Fluxes. |
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
si | integer(kind=I4P) | in | Stencil increment. | |
sir | real(kind=R8P) | in | Stencil increment, real cast. | |
b | integer(kind=I4P) | in | Counter. | |
i | integer(kind=I4P) | in | Counter. | |
j | integer(kind=I4P) | in | Counter. | |
k | integer(kind=I4P) | in | Counter. | |
ngc | integer(kind=I4P) | in | Ghost cells number. | |
nv_c | integer(kind=I4P) | in | Number of conservative varibales in q vector. | |
weno_s | integer(kind=I4P) | in | Weno stencils number/dimension. | |
evmax | real(kind=R8P) | in | Maximum eigenvalue. | |
EL | real(kind=R8P) | in | Left eigenvectors. | |
q | real(kind=R8P) | in | Auxiliary variables. | |
fmpc | real(kind=R8P) | inout | Fluxes -+ 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) = 0fortran
subroutine compute_convective_fluxes_maxwell_dev(sir, q, f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
sir | real(kind=R8P) | in | Directional (1=x,2=y,3=z) increment. | |
q | real(kind=R8P) | in | Auxiliary variables. | |
f | real(kind=R8P) | inout | Conservative fluxes. |
Call graph