Appearance
adam_flume_fnl_mhd_kernels
ADAM, FLUME FNL device kernels of the ideal MHD (no divergence control) model.
The model-agnostic auxiliary-variables kernel (adam_flume_fnl_aux_kernels_agnostic.INC) and the MHD dt and conservation kernels (adam_flume_fnl_mhd_kernels_agnostic.INC) instantiated with NV_K = NV_MHD, NV_AUX_K = NV_AUX_MHD (issue #41, section 4). The face-flux kernel is the shared body with the MHD split (M2-P3). Same kernel rules as adam_flume_fnl_kernels (issue #35, D-11/D-12).
Source: src/app/flume/fnl/adam_flume_fnl_mhd_kernels.F90
Dependencies
Contents
- compute_face_fluxes_dev
- add_gravity_edge_correction_dev
- compute_q_aux_dev
- count_nonfinite_dev
- compute_conservation_dev
- compute_lambda_max_dev
- compute_lambda_max_dissipative_dev
- apply_floors_dev
- compute_speed_max_dev
- compute_divb_norms_dev
- compute_positivity_factors_dev
- blend_positivity_fluxes_dev
- compute_seam_positivity_factors_host
- compute_backbone_fluxes_host
- positivity_cell_factor
- blend_inadmissible_ghosts_dev
- face_split_fluxes
- backbone_face_flux
- cell_sources
- cleaning_energy
- internal_energy
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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
di | integer(kind=I4P) | in | Unit step along d. | |
dj | integer(kind=I4P) | in | Unit step along d. | |
dk | integer(kind=I4P) | in | Unit step along d. | |
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. | |
S | integer(kind=I4P) | in | WENO stencil half-width. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (models with GLM only). | |
is_characteristic | logical | in | Characteristic (or conservative) variables. | |
weno_a_gpu | real(kind=R8P) | in | WENO optimal weights. | |
weno_p_gpu | real(kind=R8P) | in | WENO polynomials coefficients. | |
weno_d_gpu | real(kind=R8P) | in | WENO smoothness indicators coefficients. | |
weno_zeps | real(kind=R8P) | in | WENO parameter avoiding division by zero. | |
weno_sigma | real(kind=R8P) | in | WENO descaler switch (0 Jiang-Shu, 1 SI). | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
q_aux_gpu | real(kind=R8P) | in | Auxiliary variables. | |
fl_gpu | real(kind=R8P) | inout | Face 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
di | integer(kind=I4P) | in | Unit step along d. | |
dj | integer(kind=I4P) | in | Unit step along d. | |
dk | integer(kind=I4P) | in | Unit step along d. | |
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. | |
S | integer(kind=I4P) | in | WENO stencil half-width. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (models with GLM only). | |
is_characteristic | logical | in | Characteristic (or conservative) variables. | |
weno_a_gpu | real(kind=R8P) | in | WENO optimal weights. | |
weno_p_gpu | real(kind=R8P) | in | WENO polynomials coefficients. | |
weno_d_gpu | real(kind=R8P) | in | WENO smoothness indicators coefficients. | |
weno_zeps | real(kind=R8P) | in | WENO parameter avoiding division by zero. | |
weno_sigma | real(kind=R8P) | in | WENO descaler switch (0 Jiang-Shu, 1 SI). | |
ir | integer(kind=I4P) | in | Index of the density (mass) variable. | |
gd | real(kind=R8P) | in | Gravity along d. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
q_aux_gpu | real(kind=R8P) | in | Auxiliary variables. | |
gc_gpu | real(kind=R8P) | inout | Gravity 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
| 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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
q_aux_gpu | real(kind=R8P) | inout | Auxiliary 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
| 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. | |
n | integer(kind=I8P) | out | Non-finite values number. |
Call graph
compute_conservation_dev
Compute the volume integrals of the conservative variables (interior cells), one reduction per variable. The cell volume includes the null directions (issue #37).
fortran
subroutine compute_conservation_dev(ni, nj, nk, ngc, blocks_number, dxyz_gpu, q_gpu, integrals)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. | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
integrals | real(kind=R8P) | out | Volume integrals. |
Call graph
compute_lambda_max_dev
Compute max(sum_d (|u_d| + c_{f,d}) / dx_d) over the interior cells (null directions excluded), c_{f,d} the fast magnetosonic speed along d (issue #41, section 3.5).
fortran
subroutine compute_lambda_max_dev(ni, nj, nk, ngc, blocks_number, gamma, R, dxyz_gpu, is_null, q_gpu, lambda_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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
is_null | logical | in | Null directions. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
lambda_max | real(kind=R8P) | out | Maximum of sum_d (|u_d| + c_{f,d}) / dx_d. |
Call graph
compute_lambda_max_dissipative_dev
Device twin of the CPU MHD compute_lambda_max_dissipative (issue #65, D-M4-3).
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
| 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. | |
gamma | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
R | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
cp | real(kind=R8P) | in | Specific heats ratio, gas constant, cp. | |
mu0 | real(kind=R8P) | in | Dissipative coefficients. | |
k0 | real(kind=R8P) | in | Dissipative coefficients. | |
eta | real(kind=R8P) | in | Dissipative coefficients. | |
t_wall | real(kind=R8P) | in | Hottest isothermal wall temperature, 0 if none. | |
tref | real(kind=R8P) | in | Temperature laws. | |
omega_mu | real(kind=R8P) | in | Temperature laws. | |
omega_k | real(kind=R8P) | in | Temperature laws. | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
is_null | logical | in | Null directions. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
lambda_max | real(kind=R8P) | out | Maximum of the sum. | |
lambda_hyp | real(kind=R8P) | out | Maximum of the hyperbolic part. | |
lambda_dif | real(kind=R8P) | out | Maximum of the diffusive part. | |
re_cell_min | real(kind=R8P) | out | Minimum cell Reynolds number. |
Call graph
apply_floors_dev
Apply the MHD positivity floors to the interior cells of a stage state, before its ghost exchange (issue #41, section 3.8): a cell with rho < rho_floor or p < p_floor gets rho = max(rho, rho_floor) at fixed velocity and p = max(p, p_floor) (internal energy added; the model's cleaning_energy adapter adds psi^2 / 2 under EGLM, zero otherwise). Interior only: the exchange then carries the floored values to the ghost cells, and ghost cells that no map fills (never read by the stencils) are not inspected. Returns the floored cells, the cells with a non-positive density or pressure (counted before flooring) and the minimum density and pressure. Floors are not conservative: the caller logs the counters.
fortran
subroutine apply_floors_dev(ni, nj, nk, ngc, blocks_number, gamma, R, rho_floor, p_floor, q_gpu, floored, nonpositive, rho_min, p_min)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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
rho_floor | real(kind=R8P) | in | Density and pressure floors. | |
p_floor | real(kind=R8P) | in | Density and pressure floors. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
floored | integer(kind=I4P) | out | Floored cells. | |
nonpositive | integer(kind=I4P) | out | Cells with non-positive density or pressure. | |
rho_min | real(kind=R8P) | out | Minimum density and pressure. | |
p_min | real(kind=R8P) | out | Minimum density and pressure. |
Call graph
compute_speed_max_dev
Compute max(|u_d| + c_{f,d}) over the interior cells and the active directions, the fastest wave speed (the GLM c_h check, issue #41, section 3.5).
fortran
subroutine compute_speed_max_dev(ni, nj, nk, ngc, blocks_number, gamma, R, is_null, q_gpu, speed_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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
R | real(kind=R8P) | in | Gas constant. | |
is_null | logical | in | Null directions. | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
speed_max | real(kind=R8P) | out | Maximum of |u_d| + c_{f,d}. |
Call graph
compute_divb_norms_dev
Compute the div(B) norms over the interior cells (issue #41, D-10): max|div B|, sum |div B| dV and the maximum over the seam-local cells (within band cells of a block face with seam(b,face) /= 0, a 2:1 AMR or inter-realm seam). div B is the centred finite difference of the library (half stencil hs <= HS_MAX), null directions weighted zero; the cell volume includes the null directions (issue #37). The caller has refreshed the ghost cells.
fortran
subroutine compute_divb_norms_dev(ni, nj, nk, ngc, blocks_number, hs, band, dxyz_gpu, is_null, seam_gpu, q_gpu, divb_max, divb_l1, divb_seam_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. | |
hs | integer(kind=I4P) | in | Finite difference half stencil, <= min(ngc, HS_MAX). | |
band | integer(kind=I4P) | in | Seam-local band width, in cells. | |
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). | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
divb_max | real(kind=R8P) | out | Maximum of |div B|. | |
divb_l1 | real(kind=R8P) | out | Sum of |div B| dV. | |
divb_seam_max | real(kind=R8P) | out | Maximum of |div B| over the seam-local cells. |
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
| 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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
damping | real(kind=R8P) | in | GLM damping rate (EGLM only). | |
hs | integer(kind=I4P) | in | Half stencil of the sources, 1 <= hs <= S_MAX. | |
dt | real(kind=R8P) | in | Forward-Euler step of the stage. | |
g | real(kind=R8P) | in | Gravity (issue #73), zero without it. | |
has_phi | logical | in | The cell potential is applied (issue #81). | |
phi_gpu | real(kind=R8P) | in | Gravitational potential (read with has_phi). | |
dxyz_gpu | real(kind=R8P) | in | Blocks space steps [nb, 3]. | |
is_null | logical | in | Null directions. | |
q_gpu | real(kind=R8P) | in | Conservative variables (ghosts updated). | |
q_aux_gpu | real(kind=R8P) | in | Auxiliary variables. | |
flx_gpu | real(kind=R8P) | in | X-face high-order fluxes. | |
fly_gpu | real(kind=R8P) | in | Y-face high-order fluxes. | |
flz_gpu | real(kind=R8P) | in | Z-face high-order fluxes. | |
gc_gpu | real(kind=R8P) | in | Gravity energy correction (zero without it). | |
lam_gpu | real(kind=R8P) | inout | Cell factors (component 1). | |
bad | integer(kind=I4P) | out | Cells with an inadmissible backbone. | |
nonfinite | integer(kind=I4P) | out | Cells 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
di | integer(kind=I4P) | in | Unit step along d. | |
dj | integer(kind=I4P) | in | Unit step along d. | |
dk | integer(kind=I4P) | in | Unit step along d. | |
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. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
q_gpu | real(kind=R8P) | in | Conservative variables. | |
lam_gpu | real(kind=R8P) | in | Cell factors (component 1). | |
fl_gpu | real(kind=R8P) | inout | Face fluxes of direction d. | |
limited | integer(kind=I4P) | out | Faces 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ncells | integer(kind=I4P) | in | Seam cells. | |
hs | integer(kind=I4P) | in | Stencil half width, 1 <= hs <= S_MAX. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
damping | real(kind=R8P) | in | GLM damping rate (EGLM only). | |
dt | real(kind=R8P) | in | Forward-Euler step of the stage. | |
g | real(kind=R8P) | in | Gravity (issue #73), zero without it. | |
has_phi | logical | in | The cell potential is applied (issue #81). | |
ps | real(kind=R8P) | in | Potential axis stencils [1, 3, 3, ncells] (with has_phi). | |
ds | real(kind=R8P) | in | Space steps of the cells' blocks [3, ncells]. | |
is_null | logical | in | Null directions. | |
qs | real(kind=R8P) | in | Axis stencils [nv, 2 hs + 1, 3, ncells]. | |
qa | real(kind=R8P) | in | Auxiliary variables [nv_aux, ncells]. | |
fh | real(kind=R8P) | in | High-order face fluxes [nv, 6, ncells]. | |
omask | logical | in | Overridden faces [6, ncells]. | |
gcs | real(kind=R8P) | in | Gravity energy correction [ncells] (M7-G2a). | |
lsrc | real(kind=R8P) | out | Gravity face-form excess L [ncells] (issue #73). | |
olo | real(kind=R8P) | in | Override backbone fluxes [nv, 6, ncells]. | |
ohi | real(kind=R8P) | in | Override high-order fluxes [nv, 6, ncells]. | |
lam | real(kind=R8P) | out | Cell factors [ncells]. | |
dbad | integer(kind=I4P) | out | Change of the inadmissible backbones count. | |
dnonfinite | integer(kind=I4P) | out | Change 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
n | integer(kind=I4P) | in | Faces number. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed (EGLM only). | |
qL | real(kind=R8P) | in | Left states [nv, n]. | |
qR | real(kind=R8P) | in | Right states [nv, n]. | |
flo | real(kind=R8P) | out | Backbone 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
nf | integer(kind=I4P) | in | Active faces. | |
qb | real(kind=R8P) | in | Backbone update. | |
dlt | real(kind=R8P) | in | Antidiffusive differences. | |
dsrc | real(kind=R8P) | in | Source difference. | |
lc | real(kind=R8P) | out | Cell factor. | |
status | integer(kind=I4P) | out | 0 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
| 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. | |
q_gpu | real(kind=R8P) | inout | Conservative variables (ghosts updated). | |
blended | integer(kind=I4P) | out | Ghosts blended. |
Call graph
face_split_fluxes
Split adapter of the shared face kernel (issue #41, M2-P3): the MHD split without cleaning, ch unused.
Attributes: pure
fortran
subroutine face_split_fluxes(gamma, ch, d, S, is_characteristic, qs, qas, fsplit, er, mu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
S | integer(kind=I4P) | in | WENO stencil half-width, S <= S_MAX. | |
is_characteristic | logical | in | Characteristic (or conservative) variables. | |
qs | real(kind=R8P) | in | Stencil conservative variables. | |
qas | real(kind=R8P) | in | Stencil auxiliary variables. | |
fsplit | real(kind=R8P) | out | Split fields in the WENO upwind layout. | |
er | real(kind=R8P) | out | Right eigenvectors. | |
mu | real(kind=R8P) | out | Magnitude of each field (WENO descaler). |
Call graph
backbone_face_flux
Backbone adapter of the positivity limiter: the Lax-Friedrichs flux with the Wu speed, ch unused.
Attributes: pure
fortran
subroutine backbone_face_flux(gamma, ch, d, qL, qR, f)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
gamma | real(kind=R8P) | in | Specific heats ratio. | |
ch | real(kind=R8P) | in | GLM cleaning speed. | |
d | integer(kind=I4P) | in | Direction, 1=x, 2=y, 3=z. | |
qL | real(kind=R8P) | in | Left state. | |
qR | real(kind=R8P) | in | Right state. | |
f | real(kind=R8P) | out | Flux. |
Call graph
cell_sources
Sources adapter of the positivity limiter: none (MHD without divergence control).
Attributes: pure
fortran
subroutine cell_sources(hs, damping, ds, w, qsx, qsy, qsz, qac, s_lo, s_hi)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
hs | integer(kind=I4P) | in | Half stencil of the high-order sources. | |
damping | real(kind=R8P) | in | GLM damping rate. | |
ds | real(kind=R8P) | in | Block space steps. | |
w | real(kind=R8P) | in | Direction weights: 1 active, 0 null. | |
qsx | real(kind=R8P) | in | Stencil along x. | |
qsy | real(kind=R8P) | in | Stencil along y. | |
qsz | real(kind=R8P) | in | Stencil along z. | |
qac | real(kind=R8P) | in | Cell auxiliary variables. | |
s_lo | real(kind=R8P) | out | Backbone sources. | |
s_hi | real(kind=R8P) | out | High-order sources. |
Call graph
Functions
cleaning_energy
Cleaning-energy adapter of the floors kernel: zero, psi (if any) is not part of the energy of this model.
Attributes: pure
Returns: real(kind=R8P)
fortran
function cleaning_energy(q) result(e)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative variables. |
Call graph
internal_energy
Internal-energy adapter of the positivity limiter: E minus the kinetic and magnetic energies, per unit volume.
Attributes: pure
Returns: real(kind=R8P)
fortran
function internal_energy(q) result(e)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
q | real(kind=R8P) | in | Conservative variables. |
Call graph