Appearance
adam_prism_fnl_object
ADAM, PRISM (Plasma Research usIng Simulation Methods) equations system class definition, GPU (FNL) backend.
Source: src/app/prism/fnl/adam_prism_fnl_object.F90
Dependencies
Contents
- prism_fnl_object
- compute_curl_interface_dev
- compute_derivative1_interface_dev
- compute_derivative2_interface_dev
- compute_derivative4_interface_dev
- compute_divergence_interface_dev
- compute_gradient_interface_dev
- compute_laplacian_interface_dev
- compute_residuals_interface_dev
- integrate_interface_dev
- allocate_gpu
- copy_cpu_gpu
- copy_gpu_cpu
- initialize_prism
- load_restart_files
- save_residuals
- save_simulation_data
- apply_fwl_correction
- compute_coils_current
- set_boundary_conditions
- set_initial_conditions
- update_ghost
- update_rk_ghost
- compute_curl_fd_dev
- compute_curl_fv_dev
- compute_derivative1_fd_dev
- compute_derivative1_fv_dev
- compute_derivative2_fd_dev
- compute_derivative2_fv_dev
- compute_derivative4_fd_dev
- compute_divergence_fd_dev
- compute_divergence_fv_dev
- compute_gradient_fd_dev
- compute_gradient_fv_dev
- compute_laplacian_fd_dev
- compute_laplacian_fv_dev
- compute_residuals_fd_centered_dev
- fd_centered_plain_dev_kernel
- fd_centered_phi_dev_kernel
- fd_centered_psi_dev_kernel
- fd_centered_phi_psi_dev_kernel
- compute_residuals_fv_centered_dev
- fv_cell_fluxes_maxwell_dev_kernel
- fv_cell_fluxes_maxwell_adim_dev_kernel
- fv_cell_fluxes_maxwell_div_d_dev_kernel
- fv_cell_fluxes_maxwell_div_b_dev_kernel
- fv_cell_fluxes_maxwell_div_d_b_dev_kernel
- fv_cell_fluxes_maxwell_adim_div_d_dev_kernel
- fv_cell_fluxes_maxwell_adim_div_b_dev_kernel
- fv_cell_fluxes_maxwell_adim_div_d_b_dev_kernel
- fv_recon_x_dev_kernel
- fv_recon_y_dev_kernel
- fv_recon_z_dev_kernel
- fv_flux_diff_plain_dev_kernel
- fv_flux_diff_phi_dev_kernel
- fv_flux_diff_psi_dev_kernel
- fv_flux_diff_phi_psi_dev_kernel
- accumulate_seam_fluxes_fv_dev
- fv_pack_face_skin_dev_kernel
- fv_apply_reflux_face_dev_kernel
- integrate_blanesmoan_dev
- integrate_cfm_dev
- integrate_leapfrog_dev
- integrate_leapfrog_pic
- integrate_rk_ls_dev
- integrate_rk_ssp_dev
- integrate_rk_yoshida_dev
- is_done_forest
- finalize_forest
- finalize_mpi_forest
- simulate
- initialize_forest
- compute_local_dt_forest
- advance_one_step_forest
- open_step_forest
- begin_stage_forest
- end_stage_forest
- close_step_forest
- fill_seam_from_peer_forest
- after_topology_build_forest
- apply_reflux_to_stage_forest
- post_step_forest
- compute_dt
- compute_energy
- compute_energy_error
- compute_max_divergence
- impose_ct_correction
- impose_div_free
- stages_per_step_forest
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
FV_FLUX_VARIANT_MAXWELL | integer(kind=I4P) | parameter | Plain dimensional Maxwell fluxes. |
FV_FLUX_VARIANT_MAXWELL_ADIM | integer(kind=I4P) | parameter | Plain adimensional Maxwell fluxes. |
FV_FLUX_VARIANT_MAXWELL_DIV_D | integer(kind=I4P) | parameter | Dimensional hyperbolic fluxes with D cleaning. |
FV_FLUX_VARIANT_MAXWELL_DIV_B | integer(kind=I4P) | parameter | Dimensional hyperbolic fluxes with B cleaning. |
FV_FLUX_VARIANT_MAXWELL_DIV_D_B | integer(kind=I4P) | parameter | Dimensional hyperbolic fluxes with D/B cleaning. |
FV_FLUX_VARIANT_MAXWELL_ADIM_DIV_D | integer(kind=I4P) | parameter | Adimensional hyperbolic fluxes with D cleaning. |
FV_FLUX_VARIANT_MAXWELL_ADIM_DIV_B | integer(kind=I4P) | parameter | Adimensional hyperbolic fluxes with B cleaning. |
FV_FLUX_VARIANT_MAXWELL_ADIM_DIV_D_B | integer(kind=I4P) | parameter | Adimensional hyperbolic fluxes with D/B cleaning. |
FD_RESIDUAL_VARIANT_PLAIN | integer(kind=I4P) | parameter | Centered-FD Maxwell residual without hyperbolic cleaning. |
FD_RESIDUAL_VARIANT_PHI | integer(kind=I4P) | parameter | Centered-FD Maxwell residual with phi cleaning only. |
FD_RESIDUAL_VARIANT_PSI | integer(kind=I4P) | parameter | Centered-FD Maxwell residual with psi cleaning only. |
FD_RESIDUAL_VARIANT_PHI_PSI | integer(kind=I4P) | parameter | Centered-FD Maxwell residual with phi/psi cleaning. |
Derived Types
prism_fnl_object
PRISM equations system class definition, GPU (FNL) backend.
Inheritance
Extends: prism_common_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
io | type(io_object) | IO handler. | |
amr | type(amr_object) | AMR marker handler. | |
slices | type(slices_object) | Slices handler. | |
blanesmoan | type(blanesmoan_object) | Blanes-Moan integrator. | |
cfm | type(cfm_object) | Commutator-Free Magnus integrator. | |
leapfrog | type(leapfrog_object) | Leapfrog integrator. | |
flail | type(flail_object) | Linear algebra methods handler. | |
weno | type(weno_object) | WENO reconstructor. | |
ib | type(ib_object) | Immersed boundary. | |
rk | type(rk_object) | Runge-Kutta integrator. | |
adam | type(adam_object) | ADAM, grid + tree + field + maps orchestrator. | |
fdv_scheme | character(len=:) | allocatable | FDV scheme, fd/fv. |
fdv_order | integer(kind=I4P) | Order of finite difference/volume schemes, general order. | |
fdv_half_stencil | integer(kind=I4P) | Half stencil length of finite difference/volume schemes. | |
fdv_half_stencils | integer(kind=I4P) | Half stencil length of fdv schemes for each derivative up to 6. | |
ngc | integer(kind=I4P) | pointer | Number of ghost cells. |
ni | integer(kind=I4P) | pointer | Number of cells in i direction. |
nj | integer(kind=I4P) | pointer | Number of cells in j direction. |
nk | integer(kind=I4P) | pointer | Number of cells in k direction. |
nb | integer(kind=I4P) | pointer | Total blocks number for MPI. |
blocks_number | integer(kind=I4P) | pointer | Actual blocks number. |
nv | integer(kind=I4P) | pointer | Number of variables in q vector. |
realm_index | integer(kind=I4P) | Inter-realm seam coupling — currently-published stage buffer key. | |
stage_active | integer(kind=I4P) | Procedure pointer TBPs for FDV operators (set at initialization by backend). | |
compute_block_total_variation | procedure(compute_block_total_variation_interface) | pass(self), pointer | Compute TV. |
compute_curl | procedure(compute_curl_interface) | pass(self), pointer | Compute curl. |
compute_curl_extended | procedure(compute_curl_interface) | pass(self), pointer | Compute curl on extended support. |
compute_derivative1 | procedure(compute_derivative1_interface) | pass(self), pointer | Compute deriv1. |
compute_derivative2 | procedure(compute_derivative2_interface) | pass(self), pointer | Compute deriv2. |
compute_derivative4 | procedure(compute_derivative4_interface) | pass(self), pointer | Compute deriv4. |
compute_divergence | procedure(compute_divergence_interface) | pass(self), pointer | Compute dive. |
compute_gradient | procedure(compute_gradient_interface) | pass(self), pointer | Compute grad. |
compute_gradient_extended | procedure(compute_gradient_interface) | pass(self), pointer | Compute gradient on extended support. |
compute_laplacian | procedure(compute_laplacian_interface) | pass(self), pointer | Compute laplac. |
amr_locked_ | logical | AMR regrid lock (issue #22 GA6): set .true. by backends whose device/topology | |
nv_c | integer(kind=I4P) | pointer | Number of conservative variables in q vector. |
nv_s | integer(kind=I4P) | pointer | Number of source variables in q vector. |
nv_cl | integer(kind=I4P) | pointer | Number of divergence cleaning variables in q vector. |
q | real(kind=R8P) | allocatable | Conservative cell centered variables. |
dq | real(kind=R8P) | allocatable | Residuals right hand side. |
q_pic | real(kind=R8P) | allocatable | PIC variables. |
pic_fields | real(kind=R8P) | allocatable | Fields value at particle locations. |
curl | real(kind=R8P) | allocatable | Curl fields. |
divergence | real(kind=R8P) | allocatable | Divergence fields. |
q_name | type(string) | allocatable | Fields names [1:nv]. |
dq_name | type(string) | allocatable | Residuals names [1:nv]. |
q_pic_name | type(string) | allocatable | PIC Fields names. |
curl_name | type(string) | allocatable | Curl fields names. |
div_name | type(string) | allocatable | Divergence fields names. |
energy_D | real(kind=R8P) | allocatable | Energy of field D, time history. |
energy_B | real(kind=R8P) | allocatable | Energy of field B, time history. |
coil_power | real(kind=R8P) | allocatable | Power of coils, time history. |
Poynting_flux | real(kind=R8P) | allocatable | Total Poynting flux from boundary, time history. |
rms_energy_error_D | real(kind=R8P) | RMS energy error of D field. | |
rms_energy_error_B | real(kind=R8P) | RMS energy error of B field. | |
max_divergence_D | real(kind=R8P) | Maximum of divergence of D field. | |
max_divergence_B | real(kind=R8P) | Maximum of divergence of B field. | |
max_divergence_J | real(kind=R8P) | Maximum of divergence of J field. | |
bc | type(prism_bc_object) | Boundary conditions. | |
coil | type(prism_coil_object) | Coil source term. | |
external_fields | type(prism_external_fields_object) | External fields. | |
fWLayer | type(prism_fWLayer_object) | Far-field weighted layer. | |
ic | type(prism_ic_object) | Initial conditions. | |
leapfrog_pic | type(prism_leapfrog_pic_object) | Leapfrog PIC integrator. | |
numerics | type(prism_numerics_object) | Numerics configuration. | |
particle_injection | type(prism_particle_injection_object) | Particle injection. | |
physics | type(prism_physics_object) | Physics configuration. | |
pic | type(prism_pic_object) | PIC state. | |
rk_pic | type(prism_rk_pic_object) | Runge-Kutta PIC handler. | |
time | type(prism_time_object) | Time integration state. | |
field_fnl | type(field_fnl_object) | GPU field handler. | |
ib_fnl | type(ib_fnl_object) | GPU immersed boundary. | |
rk_fnl | type(rk_fnl_object) | GPU Runge-Kutta integrator. | |
weno_fnl | type(weno_fnl_object) | GPU WENO reconstructor. | |
coil_fnl | type(prism_fnl_coil_object) | GPU coil source. | |
fwlayer_fnl | type(prism_fnl_fwlayer_object) | GPU fWLayer. | |
q_gpu | real(kind=R8P) | pointer | Field cell centered variables. |
dq_gpu | real(kind=R8P) | pointer | Residuals right hand side. |
flxyz_c_gpu | real(kind=R8P) | pointer | Fluxes at cell center with +/- decomposition for all directions. |
flx_f_gpu | real(kind=R8P) | pointer | Fluxes along x at cell face. |
fly_f_gpu | real(kind=R8P) | pointer | Fluxes along y at cell face. |
flz_f_gpu | real(kind=R8P) | pointer | Fluxes along z at cell face. |
curl_gpu | real(kind=R8P) | pointer | Curl fields. |
divergence_gpu | real(kind=R8P) | pointer | Divergence fields. |
db5 | integer(kind=I4P) | Device data bounds (rank 5): bb(1,:)=lower, bb(2,:)=upper. | |
hb5 | integer(kind=I4P) | Host buffer data bounds (rank 5): bb(1,:)=lower, bb(2,:)=upper. | |
buf_5D_R8P | real(kind=R8P) | allocatable | Buffer (host memory, device shape), rank 5, R8P. |
fv_flux_variant | integer(kind=I4P) | FV Maxwell-flux variant selector. | |
fv_add_phi_damping | logical | Apply phi damping in FV residuals. | |
fv_add_psi_damping | logical | Apply psi damping in FV residuals. | |
fv_ivar_phi | integer(kind=I4P) | Phi slot index in FV residuals. | |
fv_ivar_psi | integer(kind=I4P) | Psi slot index in FV residuals. | |
fd_residual_variant | integer(kind=I4P) | Centered-FD residual selector. | |
fd_ivar_phi | integer(kind=I4P) | Phi slot index in FD residuals. | |
fd_ivar_psi | integer(kind=I4P) | Psi slot index in FD residuals. | |
fd_inv_mu_scale | real(kind=R8P) | Dimensional/adimensional scaling on curl(B). | |
fd_inv_eps_scale | real(kind=R8P) | Dimensional/adimensional scaling on curl(D). | |
fd_chi_wave | real(kind=R8P) | Hyperbolic transport speed for phi/psi equations. | |
fd_chi_damp | real(kind=R8P) | Dedner damping speed for phi/psi equations. | |
compute_curl_dev | procedure(compute_curl_interface_dev) | pass(self), pointer | Compute curl. |
compute_derivative1_dev | procedure(compute_derivative1_interface_dev) | pass(self), pointer | Compute derivative1. |
compute_derivative2_dev | procedure(compute_derivative2_interface_dev) | pass(self), pointer | Compute derivative2. |
compute_derivative4_dev | procedure(compute_derivative4_interface_dev) | pass(self), pointer | Compute derivative4. |
compute_divergence_dev | procedure(compute_divergence_interface_dev) | pass(self), pointer | Compute divergence. |
compute_gradient_dev | procedure(compute_gradient_interface_dev) | pass(self), pointer | Compute gradient. |
compute_laplacian_dev | procedure(compute_laplacian_interface_dev) | pass(self), pointer | Compute laplacian. |
compute_residuals_dev | procedure(compute_residuals_interface_dev) | pass(self), pointer | Compute residuals. |
integrate_dev | procedure(integrate_interface_dev) | pass(self), pointer | Integrate, time operator. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
load_fdv_from_file | pass(self) | Load FDV config from file. |
close_block_xh5f | nopass | Close XH5F file block. |
close_file_xh5f | nopass | Close XH5F file. |
open_block_xh5f | pass(self) | Open block file XH5F. |
open_file_xh5f | pass(self) | Open file XH5F. |
save_q_xh5f | pass(self) | Save in XH5F (XDMF/HDF5) format. |
compute_curl_fd_extended | pass(self) | Compute curl of vector field, finite difference, even for half gcs. |
compute_gradient_fd_extended | pass(self) | Compute gradient of scalar field, finite difference, even for half gcs. |
amr_update | pass(self) | Do AMR update (init-time only where amr_locked_). |
mark_by_geometry | pass(self) | Mark blocks to be refined by a primitive geometric box. |
mark_by_j_vec_total_variation | pass(self) | Mark by j_vec total variation (backend override; common |
allocate_common | pass(self) | Allocate common data. |
compute_auxiliary_fields | pass(self) | Compute auxiliary fields. |
initialize | pass(self) | Initialize the equation common data. |
save_energy_error | pass(self) | Save energy error history. |
save_energy_history | pass(self) | Save energy history. |
save_divergence_history | pass(self) | Save divergence history. |
save_restart_files | pass(self) | Save restart files. |
save_xh5f | pass(self) | Save simulation data in XH5F format. |
initialize_coils | pass(self) | Initialize coils. |
set_rectangular_coil_x | pass(self) | Subroutine to set a rectangular coil source with +-x normal |
set_rectangular_coil_y | pass(self) | Subroutine to set a rectangular coil source with +-y normal |
set_rectangular_coil_z | pass(self) | Subroutine to set a rectangular coil source with +-z normal |
set_circular_coil_x | pass(self) | Subroutine to set a circular coil source with +-x normal |
set_circular_coil_y | pass(self) | Subroutine to set a circular coil source with +-y normal |
set_circular_coil_z | pass(self) | Subroutine to set a circular coil source with +-z normal |
set_solenoid_x | pass(self) | Subroutine to set a solenoid source with +-x normal |
set_solenoid_y | pass(self) | Subroutine to set a solenoid source with +-y normal |
set_solenoid_z | pass(self) | Subroutine to set a solenoid source with +-z normal |
set_helicon_coil | pass(self) | Subroutine to set a helicon coil source. |
coupling_descriptor_forest | pass(self) | Report (scheme_time, rk_scheme, nv) for β admissibility. |
allocate_gpu | pass(self) | Allocate GPU data. |
copy_cpu_gpu | pass(self) | Copy data from CPU to GPU. |
copy_gpu_cpu | pass(self) | Copy data from GPU to CPU. |
initialize_prism | pass(self) | Initialize PRISM equation. |
load_restart_files | pass(self) | Load restart files. |
save_residuals | pass(self) | Save residuals history. |
save_simulation_data | pass(self) | Save all simulation data. |
apply_fwl_correction | pass(self) | Apply fWLayer correction (if present) |
compute_coils_current | pass(self) | Compute current coils sources. |
set_boundary_conditions | pass(self) | Set boundary conditions of equation. |
set_initial_conditions | pass(self) | Set initial conditions of equation. |
update_ghost | pass(self) | Update ghost cells and set boundary conditions. |
update_rk_ghost | pass(self) | Update RK stage ghost cells. |
compute_curl_fd_dev | pass(self) | Compute curl of vector field by finite difference. |
compute_curl_fv_dev | pass(self) | Compute curl of vector field by finite volume. |
compute_derivative1_fd_dev | pass(self) | Compute derivative1 of scalar fields, finite difference schemes. |
compute_derivative1_fv_dev | pass(self) | Compute derivative1 of scalar fields, finite volume schemes. |
compute_derivative2_fd_dev | pass(self) | Compute derivative2 of scalar fields, finite difference schemes. |
compute_derivative2_fv_dev | pass(self) | Compute derivative2 of scalar fields, finite volume schemes. |
compute_derivative4_fd_dev | pass(self) | Compute derivative4 of scalar fields, finite difference schemes. |
compute_divergence_fd_dev | pass(self) | Compute divergence of vector field by finite difference. |
compute_divergence_fv_dev | pass(self) | Compute divergence of vector field by finite volume. |
compute_gradient_fd_dev | pass(self) | Compute gradient of scalar field, finite difference schemes. |
compute_gradient_fv_dev | pass(self) | Compute gradient of scalar field, finite volume schemes. |
compute_laplacian_fd_dev | pass(self) | Compute laplacian of scalar field, finite difference schemes. |
compute_laplacian_fv_dev | pass(self) | Compute laplacian of scalar field, finite volume schemes. |
compute_residuals_fd_centered_dev | pass(self) | Compute residuals, centered finite difference schemes. |
integrate_blanesmoan_dev | pass(self) | Blanes and Moan scheme. |
integrate_cfm_dev | pass(self) | Commutator-Free Magnus scheme. |
integrate_leapfrog_dev | pass(self) | Leapfrog scheme. |
integrate_rk_ls_dev | pass(self) | RK classical low storage schemes. |
integrate_rk_ssp_dev | pass(self) | SSP RK schemes. |
integrate_rk_yoshida_dev | pass(self) | Yoshida schemes. |
initialize_forest | pass(self) | Invoked by forest%initialize per realm at startup. |
compute_local_dt_forest | pass(self) | Invoked by forest%compute_global_dt during the min reduction. |
advance_one_step_forest | pass(self) | Invoked by forest%evolve_one_step per realm per timestep. |
stages_per_step_forest | pass(self) | Number of integrator stages this realm exposes per step. |
open_step_forest | pass(self) | Per-step prologue (multi-realm path). |
begin_stage_forest | pass(self) | Begin one integrator stage on this realm (multi-realm path). |
end_stage_forest | pass(self) | End the stage: residuals + assignment (multi-realm path). |
close_step_forest | pass(self) | Per-step epilogue (multi-realm path). |
post_step_forest | pass(self) | Invoked by forest%post_step per realm per timestep. |
is_done_forest | pass(self) | Invoked by forest%is_done during the termination reduction. |
finalize_forest | pass(self) | Invoked by forest%finalize per realm at shutdown. |
finalize_mpi_forest | pass(self) | Process-global MPI finalize (mpih_fnl). |
fill_seam_from_peer_forest | pass(self) | OpenACC device-direct copy of peer's GPU interior into self's GPU ghosts. |
after_topology_build_forest | pass(self) | Refresh device-resident seam maps from freshly-built host maps. |
apply_reflux_to_stage_forest | pass(self) | Apply Berger-Colella reflux to self's RK stage buffer (FNL no-op). |
compute_dt | pass(self) | Compute time step. |
compute_energy | pass(self) | Compute energy. |
compute_energy_error | pass(self) | Compute energy error. |
compute_max_divergence | pass(self) | Compute divergence of D, B and J fields for diagnostics. |
impose_ct_correction | pass(self) | Impose Constrained Transport correction on q(ivar:ivar+2). |
impose_div_free | pass(self) | Impose divergence-free property. |
simulate | pass(self) | Perform the simulation. |
Interfaces
compute_curl_interface_dev
compute_derivative1_interface_dev
compute_derivative2_interface_dev
compute_derivative4_interface_dev
compute_divergence_interface_dev
compute_gradient_interface_dev
compute_laplacian_interface_dev
compute_residuals_interface_dev
integrate_interface_dev
Subroutines
allocate_gpu
Allocate GPU data.
fortran
subroutine allocate_gpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
copy_cpu_gpu
Copy data from CPU to GPU.
fortran
subroutine copy_cpu_gpu(self, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
copy_gpu_cpu
Copy data from GPU to CPU.
fortran
subroutine copy_gpu_cpu(self, compute_copy_q_aux, copy_phi, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
compute_copy_q_aux | logical | in | optional | Flag to compute auxiliary variables. |
copy_phi | logical | in | optional | Copy also phi. |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
initialize_prism
Initialize PRISM equation.
fortran
subroutine initialize_prism(self, filename, realms_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | target | The equation. |
filename | character(len=*) | in | Input file name. | |
realms_number | integer(kind=I4P) | in | optional | Forest realm count; divides the per-device budget |
Call graph
load_restart_files
Save restart files.
fortran
subroutine load_restart_files(self, t, time)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
t | integer(kind=I4P) | out | Time iteration. | |
time | real(kind=R8P) | out | Time. |
Call graph
save_residuals
Save residuals history.
fortran
subroutine save_residuals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
save_simulation_data
Save all simulation data.
fortran
subroutine save_simulation_data(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
apply_fwl_correction
Apply correction if a fWL is present.
fortran
subroutine apply_fwl_correction(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
compute_coils_current
Compute current coils sources.
fortran
subroutine compute_coils_current(self, q_gpu, gamm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
gamm | real(kind=R8P) | in | optional | RK coefficient. |
Call graph
set_boundary_conditions
Set boundary conditions of equation.
fortran
subroutine set_boundary_conditions(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
set_initial_conditions
Set initial conditions of field.
fortran
subroutine set_initial_conditions(self, is_restart)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
is_restart | logical | in | Branching sentinel for restart/non restart path. |
Call graph
update_ghost
Update ghost cells (intra-realm only).
Inter-realm seam ghost cells are filled by the forest's Phase 2 seam exchange (between assemble and evaluate) via fill_seam_from_peer_forest, NOT here. The legacy realm(:) optional dummy and the exchange_inter_realm_halos_forest call have been retired by the agnostic-dummy seam redesign.
fortran
subroutine update_ghost(self, q_gpu, step, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
step | integer(kind=I4P) | in | optional | Step to be performed in async comp. |
s | integer(kind=I4P) | in | optional | Stage counter. |
Call graph
update_rk_ghost
Update RK ghost cells.
fortran
subroutine update_rk_ghost(self, dt, phi_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | RK object. | |
dt | real(kind=R8P) | in | Current time step. | |
phi_gpu | real(kind=R8P) | in | optional | IB distance. |
compute_curl_fd_dev
Compute curl of vector fields, div(q(ivar:ivar+2), using finite difference schemes.
fortran
subroutine compute_curl_fd_dev(self, ivar, q_gpu, curl_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
curl_gpu | real(kind=R8P) | inout | Curl. |
Call graph
compute_curl_fv_dev
Compute curl of vector fields, div(q(ivar:ivar+2), using finite volume schemes.
fortran
subroutine compute_curl_fv_dev(self, ivar, q_gpu, curl_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
curl_gpu | real(kind=R8P) | inout | Curl. |
compute_derivative1_fd_dev
Compute derivative1 of scalar fields, dq(ivar)/ds, using finite difference schemes.
fortran
subroutine compute_derivative1_fd_dev(self, dir, ivar, q_gpu, dq_ds_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
dq_ds_gpu | real(kind=R8P) | inout | Derivative1, dq/ds. |
compute_derivative1_fv_dev
Compute derivative1 of scalar fields, dq(ivar)/ds, using finite volume schemes.
fortran
subroutine compute_derivative1_fv_dev(self, dir, ivar, q_gpu, dq_ds_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
dq_ds_gpu | real(kind=R8P) | inout | Derivative1, dq/ds. |
compute_derivative2_fd_dev
Compute derivative2 of scalar fields, d2q(ivar)/ds2, using finite difference schemes.
fortran
subroutine compute_derivative2_fd_dev(self, dir, ivar, q_gpu, d2q_ds2_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
d2q_ds2_gpu | real(kind=R8P) | inout | Derivative2, d2q/ds2. |
compute_derivative2_fv_dev
Compute derivative2 of scalar fields, d2q(ivar)/ds2, using finite volume schemes.
fortran
subroutine compute_derivative2_fv_dev(self, dir, ivar, q_gpu, d2q_ds2_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
d2q_ds2_gpu | real(kind=R8P) | inout | Derivative2, d2q/ds2. |
compute_derivative4_fd_dev
Compute derivative4 of scalar fields, d4q(ivar)/ds4, using finite difference schemes.
fortran
subroutine compute_derivative4_fd_dev(self, dir, ivar, q_gpu, d4q_ds4_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
dir | integer(kind=I4P) | in | Direction, 1=X, 2=Y, 3=Z. | |
ivar | integer(kind=I4P) | in | Start index of variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
d4q_ds4_gpu | real(kind=R8P) | inout | Derivative4, d4q/ds4. |
compute_divergence_fd_dev
Compute divergence of vector fields, div(q(ivar:ivar+2), using finite difference schemes. Directly computes divergence from transposed GPU layout (b,i,j,k,v).
fortran
subroutine compute_divergence_fd_dev(self, ivar, ovar, q_gpu, divergence_gpu, maxdiv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Start index of | |
ovar | integer(kind=I4P) | in | Output index in | |
q_gpu | real(kind=R8P) | in | Field variables. | |
divergence_gpu | real(kind=R8P) | inout | Divergence. | |
maxdiv | real(kind=R8P) | out | optional | Max divergence, |
Call graph
compute_divergence_fv_dev
Compute divergence of vector fields, div(q(ivar:ivar+2), using finite volume schemes. Directly computes divergence from transposed GPU layout (b,i,j,k,v).
fortran
subroutine compute_divergence_fv_dev(self, ivar, ovar, q_gpu, divergence_gpu, maxdiv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Start index of | |
ovar | integer(kind=I4P) | in | Output index in | |
q_gpu | real(kind=R8P) | in | Field variables. | |
divergence_gpu | real(kind=R8P) | inout | Divergence. | |
maxdiv | real(kind=R8P) | out | optional | Max divergence, |
compute_gradient_fd_dev
Compute gradient of scalar variable q(ivar), finite difference schemes.
fortran
subroutine compute_gradient_fd_dev(self, ivar, q_gpu, gradient_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Index of scalar var of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
gradient_gpu | real(kind=R8P) | inout | Gradient. |
compute_gradient_fv_dev
Compute gradient of scalar variable q(ivar), finite volume schemes.
fortran
subroutine compute_gradient_fv_dev(self, ivar, q_gpu, gradient_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Index of scalar var of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
gradient_gpu | real(kind=R8P) | inout | Gradient. |
compute_laplacian_fd_dev
Compute laplacian of scalar variable q(ivar), finite difference schemes.
fortran
subroutine compute_laplacian_fd_dev(self, ivar, q_gpu, laplacian_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Index of scalar variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
laplacian_gpu | real(kind=R8P) | inout | Gradient. |
compute_laplacian_fv_dev
Compute laplacian of scalar variable q(ivar), finite volume schemes.
fortran
subroutine compute_laplacian_fv_dev(self, ivar, q_gpu, laplacian_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The equation. | |
ivar | integer(kind=I4P) | in | Index of scalar variable of q. | |
q_gpu | real(kind=R8P) | in | Field variables. | |
laplacian_gpu | real(kind=R8P) | inout | Gradient. |
compute_residuals_fd_centered_dev
Compute residuals of equation, space operator, centered finite difference schemes.
fortran
subroutine compute_residuals_fd_centered_dev(self, q_gpu, dq_gpu, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
dq_gpu | real(kind=R8P) | inout | Residuals. | |
s | integer(kind=I4P) | in | optional | Stage counter. |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register (interface parity; the |
Call graph
fd_centered_plain_dev_kernel
Centered-FD Maxwell residual without hyperbolic cleaning.
fortran
subroutine fd_centered_plain_dev_kernel(ni, nj, nk, ngc, blocks_number, var_jx, var_jy, var_jz, s1, inv_mu_scale, inv_eps_scale, dxyz_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
s1 | integer(kind=I4P) | in | ||
inv_mu_scale | real(kind=R8P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fd_centered_phi_dev_kernel
Centered-FD Maxwell residual with phi cleaning only.
fortran
subroutine fd_centered_phi_dev_kernel(ni, nj, nk, ngc, blocks_number, var_jx, var_jy, var_jz, s1, inv_mu_scale, inv_eps_scale, chi_wave, chi_damp, c_r, ivar_phi, dxyz_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
s1 | integer(kind=I4P) | in | ||
inv_mu_scale | real(kind=R8P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
chi_wave | real(kind=R8P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
ivar_phi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fd_centered_psi_dev_kernel
Centered-FD Maxwell residual with psi cleaning only.
fortran
subroutine fd_centered_psi_dev_kernel(ni, nj, nk, ngc, blocks_number, var_jx, var_jy, var_jz, s1, inv_mu_scale, inv_eps_scale, chi_wave, chi_damp, c_r, ivar_psi, dxyz_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
s1 | integer(kind=I4P) | in | ||
inv_mu_scale | real(kind=R8P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
chi_wave | real(kind=R8P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
ivar_psi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fd_centered_phi_psi_dev_kernel
Centered-FD Maxwell residual with phi/psi cleaning.
fortran
subroutine fd_centered_phi_psi_dev_kernel(ni, nj, nk, ngc, blocks_number, var_jx, var_jy, var_jz, s1, inv_mu_scale, inv_eps_scale, chi_wave, chi_damp, c_r, ivar_phi, ivar_psi, dxyz_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
s1 | integer(kind=I4P) | in | ||
inv_mu_scale | real(kind=R8P) | in | ||
inv_eps_scale | real(kind=R8P) | in | ||
chi_wave | real(kind=R8P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
ivar_phi | integer(kind=I4P) | in | ||
ivar_psi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
compute_residuals_fv_centered_dev
Compute residuals, space operator, centered finite volume scheme — FNL device backend (issue #23 R2). 1:1 structural mirror of prism_cpu_object%compute_residuals_fv_centered: ghost refresh on q, pointwise Maxwell fluxes at ALL cells (incl. ghosts) into flxyz_c_gpu, three staggered face-reconstruction sweeps into fl{x,y,z}_f_gpu (the m=0 SOTA primitive, already acc routine seq), flux difference + J source into dq_gpu. The Maxwell-flux variant is selected ONCE at host side, then a specialized device kernel runs with no per-cell variant branch. Inter-realm seam accumulation (issue #23 R3): after the face sweeps, at the realm's FINAL RK substage only (α.r1, CPU parity), the seam face skins are device-packed, D2H-copied (tiny slabs) and accumulated into the HOST-side flux register — see accumulate_seam_fluxes_fv_dev.
Race discipline (CLAUDE-gpu): the kernels below are MODULE-LEVEL procedures (not contained here) with constant-bound private gathers — the certified #22 F2/F3 pattern.
fortran
subroutine compute_residuals_fv_centered_dev(self, q_gpu, dq_gpu, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. | |
dq_gpu | real(kind=R8P) | inout | Residuals. | |
s | integer(kind=I4P) | in | optional | Stage counter (gates the seam-flux accumulation). |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register for FV seam reflux. |
Call graph
fv_cell_fluxes_maxwell_dev_kernel
Pointwise plain dimensional Maxwell fluxes at every cell (incl. ghosts).
fortran
subroutine fv_cell_fluxes_maxwell_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_adim_dev_kernel
Pointwise plain adimensional Maxwell fluxes at every cell (incl. ghosts).
fortran
subroutine fv_cell_fluxes_maxwell_adim_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_div_d_dev_kernel
Pointwise dimensional Maxwell fluxes with D hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_div_d_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_div_b_dev_kernel
Pointwise dimensional Maxwell fluxes with B hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_div_b_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_div_d_b_dev_kernel
Pointwise dimensional Maxwell fluxes with D/B hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_div_d_b_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_adim_div_d_dev_kernel
Pointwise adimensional Maxwell fluxes with D hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_adim_div_d_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_adim_div_b_dev_kernel
Pointwise adimensional Maxwell fluxes with B hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_adim_div_b_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_cell_fluxes_maxwell_adim_div_d_b_dev_kernel
Pointwise adimensional Maxwell fluxes with D/B hyperbolic cleaning.
fortran
subroutine fv_cell_fluxes_maxwell_adim_div_d_b_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, chi, q_gpu, flxyz_c_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
chi | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
flxyz_c_gpu | real(kind=R8P) | inout |
Call graph
fv_recon_x_dev_kernel
Reconstruct x-fluxes at x-faces from cell-center fluxes (issue #23 R2): per face i+1/2 (i = 0..ni), gather the 2*s1 cell-flux stencil into a constant-bound private buffer and call the m=0 SOTA face-reconstruction primitive (already acc routine seq).
fortran
subroutine fv_recon_x_dev_kernel(s1, ni, nj, nk, ngc, nv_c, blocks_number, flxyz_c_gpu, flx_f_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
s1 | integer(kind=I4P) | in | Half FDV stencil length. | |
ni | integer(kind=I4P) | in | Grids dimensions. | |
nj | integer(kind=I4P) | in | Grids dimensions. | |
nk | integer(kind=I4P) | in | Grids dimensions. | |
ngc | integer(kind=I4P) | in | Grids dimensions. | |
nv_c | integer(kind=I4P) | in | Conservative variables number. | |
blocks_number | integer(kind=I4P) | in | Grids dimensions. | |
flxyz_c_gpu | real(kind=R8P) | in | Cell-center fluxes (b,1,d,i,j,k,v). | |
flx_f_gpu | real(kind=R8P) | inout | X-face fluxes (b,0:ni,j,k,v). |
Call graph
fv_recon_y_dev_kernel
Reconstruct y-fluxes at y-faces (issue #23 R2); twin of fv_recon_x_dev_kernel.
fortran
subroutine fv_recon_y_dev_kernel(s1, ni, nj, nk, ngc, nv_c, blocks_number, flxyz_c_gpu, fly_f_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
s1 | integer(kind=I4P) | in | Half FDV stencil length. | |
ni | integer(kind=I4P) | in | Grids dimensions. | |
nj | integer(kind=I4P) | in | Grids dimensions. | |
nk | integer(kind=I4P) | in | Grids dimensions. | |
ngc | integer(kind=I4P) | in | Grids dimensions. | |
nv_c | integer(kind=I4P) | in | Conservative variables number. | |
blocks_number | integer(kind=I4P) | in | Grids dimensions. | |
flxyz_c_gpu | real(kind=R8P) | in | Cell-center fluxes (b,1,d,i,j,k,v). | |
fly_f_gpu | real(kind=R8P) | inout | Y-face fluxes (b,i,0:nj,k,v). |
Call graph
fv_recon_z_dev_kernel
Reconstruct z-fluxes at z-faces (issue #23 R2); twin of fv_recon_x_dev_kernel.
fortran
subroutine fv_recon_z_dev_kernel(s1, ni, nj, nk, ngc, nv_c, blocks_number, flxyz_c_gpu, flz_f_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
s1 | integer(kind=I4P) | in | Half FDV stencil length. | |
ni | integer(kind=I4P) | in | Grids dimensions. | |
nj | integer(kind=I4P) | in | Grids dimensions. | |
nk | integer(kind=I4P) | in | Grids dimensions. | |
ngc | integer(kind=I4P) | in | Grids dimensions. | |
nv_c | integer(kind=I4P) | in | Conservative variables number. | |
blocks_number | integer(kind=I4P) | in | Grids dimensions. | |
flxyz_c_gpu | real(kind=R8P) | in | Cell-center fluxes (b,1,d,i,j,k,v). | |
flz_f_gpu | real(kind=R8P) | inout | Z-face fluxes (b,i,j,0:nk,v). |
Call graph
fv_flux_diff_plain_dev_kernel
Conservative flux difference + J source, no hyperbolic damping fields.
fortran
subroutine fv_flux_diff_plain_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, var_jx, var_jy, var_jz, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
flx_f_gpu | real(kind=R8P) | in | ||
fly_f_gpu | real(kind=R8P) | in | ||
flz_f_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fv_flux_diff_phi_dev_kernel
Conservative flux difference + J source + phi damping.
fortran
subroutine fv_flux_diff_phi_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, var_jx, var_jy, var_jz, chi_damp, c_r, fv_ivar_phi, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
fv_ivar_phi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
flx_f_gpu | real(kind=R8P) | in | ||
fly_f_gpu | real(kind=R8P) | in | ||
flz_f_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fv_flux_diff_psi_dev_kernel
Conservative flux difference + J source + psi damping.
fortran
subroutine fv_flux_diff_psi_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, var_jx, var_jy, var_jz, chi_damp, c_r, fv_ivar_psi, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
fv_ivar_psi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
flx_f_gpu | real(kind=R8P) | in | ||
fly_f_gpu | real(kind=R8P) | in | ||
flz_f_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
fv_flux_diff_phi_psi_dev_kernel
Conservative flux difference + J source + phi/psi damping.
fortran
subroutine fv_flux_diff_phi_psi_dev_kernel(ni, nj, nk, ngc, nv_c, blocks_number, var_jx, var_jy, var_jz, chi_damp, c_r, fv_ivar_phi, fv_ivar_psi, dxyz_gpu, flx_f_gpu, fly_f_gpu, flz_f_gpu, q_gpu, dq_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ni | integer(kind=I4P) | in | ||
nj | integer(kind=I4P) | in | ||
nk | integer(kind=I4P) | in | ||
ngc | integer(kind=I4P) | in | ||
nv_c | integer(kind=I4P) | in | ||
blocks_number | integer(kind=I4P) | in | ||
var_jx | integer(kind=I4P) | in | ||
var_jy | integer(kind=I4P) | in | ||
var_jz | integer(kind=I4P) | in | ||
chi_damp | real(kind=R8P) | in | ||
c_r | real(kind=R8P) | in | ||
fv_ivar_phi | integer(kind=I4P) | in | ||
fv_ivar_psi | integer(kind=I4P) | in | ||
dxyz_gpu | real(kind=R8P) | in | ||
flx_f_gpu | real(kind=R8P) | in | ||
fly_f_gpu | real(kind=R8P) | in | ||
flz_f_gpu | real(kind=R8P) | in | ||
q_gpu | real(kind=R8P) | in | ||
dq_gpu | real(kind=R8P) | inout |
Call graph
accumulate_seam_fluxes_fv_dev
Accumulate end-of-step FV seam face fluxes into the forest's flux register — FNL twin of prism_cpu_object%accumulate_seam_fluxes_fv (issue #23 R3).
Register crossing (grilled R0 default): the flux register stays HOST-side. Per seam (block, fec) hit, a tiny device kernel packs the face skin into a contiguous device slab (inner axis fastest — the register's cell order), ONE D2H copy (~nv*nface_cells doubles, tens of KB per step) brings it to the host, and the shared register machinery does the rest: coarse side → accumulate_coarse_flux directly; fine side → quadrant offset from maps%amr_seam_quadrant (Morton-code precompute, issue #28 D2) + the pure 2:1 restriction restrict_fine_face_to_quadrant (moved to adam_flux_register_object, shared with the CPU backend) → accumulate_fine_flux. Fires once per realm per step (final-substage gate at the call site). Third-axis register index hardcoded to 1 (α.r1 collapsed register), exactly as on CPU.
fortran
subroutine accumulate_seam_fluxes_fv_dev(self, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
flux_register | class(flux_register_object) | inout | Forest's flux register. |
Call graph
fv_pack_face_skin_dev_kernel
Pack one block's face flux skin into a contiguous device slab (issue #23 R3): skin_gpu(c, v) with c = (outer-1)*inner_n + inner — the register cell order, identical to the CPU pack (pack_coarse_face / fine_face_cell mappings). Scalar element reads/writes only: no private arrays, no section actuals. The fec branch is uniform per launch (firstprivate scalar). Tiny kernel: one launch per seam (block, fec) hit, once per step.
fortran
subroutine fv_pack_face_skin_dev_kernel(fec, ni, nj, nk, nv_c, b, inner_n, outer_n, flx_f_gpu, fly_f_gpu, flz_f_gpu, skin_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
fec | integer(kind=I4P) | in | Face code 1..6 (-x,+x,-y,+y,-z,+z). | |
ni | integer(kind=I4P) | in | Interior cell counts. | |
nj | integer(kind=I4P) | in | Interior cell counts. | |
nk | integer(kind=I4P) | in | Interior cell counts. | |
nv_c | integer(kind=I4P) | in | Conservative variables number. | |
b | integer(kind=I4P) | in | Block index. | |
inner_n | integer(kind=I4P) | in | Tangential cell counts (inner fastest). | |
outer_n | integer(kind=I4P) | in | Tangential cell counts (inner fastest). | |
flx_f_gpu | real(kind=R8P) | in | X-face fluxes. | |
fly_f_gpu | real(kind=R8P) | in | Y-face fluxes. | |
flz_f_gpu | real(kind=R8P) | in | Z-face fluxes. | |
skin_gpu | real(kind=R8P) | inout | Packed skin (inner_n*outer_n, nv_c). |
Call graph
fv_apply_reflux_face_dev_kernel
Apply the Berger-Colella end-of-step correction for ONE register face to the committed q_gpu (issue #23 R4): per skin cell c (register cell order — the SAME (axis, sgn) → (i,j,k) mapping as the CPU apply), add scale * delta(v, c) to every state row. Scalar element ops only: no private arrays, no section actuals; each c writes a distinct cell (disjoint), the inner v loop is per-thread seq. Tiny kernel — one launch per face per step.
fortran
subroutine fv_apply_reflux_face_dev_kernel(axis, sgn, b, ni, nj, nk, ngc, nv_reg, nface_cells, scale, delta_gpu, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
axis | integer(kind=I4P) | in | Face normal axis (1..3) and sign (+-1). | |
sgn | integer(kind=I4P) | in | Face normal axis (1..3) and sign (+-1). | |
b | integer(kind=I4P) | in | Coarse block index. | |
ni | integer(kind=I4P) | in | Grids dimensions. | |
nj | integer(kind=I4P) | in | Grids dimensions. | |
nk | integer(kind=I4P) | in | Grids dimensions. | |
ngc | integer(kind=I4P) | in | Grids dimensions. | |
nv_reg | integer(kind=I4P) | in | Register state-vector width. | |
nface_cells | integer(kind=I4P) | in | Skin cell count. | |
scale | real(kind=R8P) | in | sign * dt / dx_coarse. | |
delta_gpu | real(kind=R8P) | in | Flux mismatch slab (nv_reg, nface_cells). | |
q_gpu | real(kind=R8P) | inout | Committed conservative variables. |
Call graph
integrate_blanesmoan_dev
Integrate equation, time operator, Blanes and Moan scheme.
fortran
subroutine integrate_blanesmoan_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
integrate_cfm_dev
Integrate equation, time operator, Commutator-Free Magnus integrator.
fortran
subroutine integrate_cfm_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
integrate_leapfrog_dev
Integrate equation, time operator, leapfrog scheme.
fortran
subroutine integrate_leapfrog_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
integrate_leapfrog_pic
Integrate equation, time operator, leapfrog scheme.
fortran
subroutine integrate_leapfrog_pic(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
integrate_rk_ls_dev
Integrate equation, time operator, RK classical low storage schemes. Low storage RK working on q_rk(:,:,:,:,:,1)/q as stages, update q in place.
fortran
subroutine integrate_rk_ls_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
integrate_rk_ssp_dev
Integrate equation, time operator, SSP RK schemes. SSP RK working on q_rk as stages.
fortran
subroutine integrate_rk_ssp_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
integrate_rk_yoshida_dev
Integrate equation, time operator, Yoshida RK scheme.
fortran
subroutine integrate_rk_yoshida_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
is_done_forest
Decide whether this realm has reached its local termination criterion.
Invoked by forest%is_done. PRISM-FNL override: matches the legacy condition inline in simulate — terminate when either the simulated time has reached self%time%time_max (time-driven mode, it_max <= 0) or the iteration count has reached self%time%it_max (iteration-driven mode). Today the test reads time-state from the time module singleton, so self is unused; once the forest takes over time bookkeeping the body will consume self%time%* instead.
fortran
subroutine is_done_forest(self, done)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The realm. | |
done | logical | out | True if this realm is done evolving. |
Call graph
finalize_forest
Shut this realm down: final state dump, close residuals file, finalize MPI handler.
fortran
subroutine finalize_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. |
Call graph
finalize_mpi_forest
Finalize the process-global FNL MPI handler (mpih_fnl).
Overrides realm_object%finalize_mpi_forest to target the FNL mpih_fnl singleton instead of the CPU mpih. Called ONCE by forest%finalize after every realm's finalize_forest (see the base for the rationale).
fortran
subroutine finalize_mpi_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm (carries no MPI state). |
Call graph
simulate
Perform the simulation: legacy single-realm entry point.
fortran
subroutine simulate(self, filename)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. |
Call graph
initialize_forest
Initialize this realm from scratch: PRISM init, IC injection (or restart load), initial ghost update, initial diagnostics dump, IO files open, plus PIC/leapfrog priming if those schemes are active.
Invoked by forest%initialize. The forest writes self%realm_index = is BEFORE calling this routine, so the body can already read the 1-based forest position from self%realm_index if needed.
fortran
subroutine initialize_forest(self, filename, realms_number, memory_avail, nv, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
filename | character(len=*) | in | Input parameters file name. | |
realms_number | integer(kind=I4P) | in | optional | Realm count; divides the per-device budget. |
memory_avail | real(kind=R8P) | in | optional | Per-process memory budget override. |
nv | integer(kind=I4P) | in | optional | Number of field variables override. |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
compute_local_dt_forest
Compute this realm's local stability-limited dt (no MPI reduction).
Invoked by forest%compute_global_dt during the min reduction across all realms in the forest. The reduction itself is the orchestrator's job; this method computes only the value local to self. Compute this realm's local stability-limited dt (no MPI reduction).
fortran
subroutine compute_local_dt_forest(self, dt_local)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The realm. | |
dt_local | real(kind=R8P) | out | Local stability-limited dt. |
Call graph
advance_one_step_forest
Advance this realm by one full timestep of size dt.
Invoked by forest%evolve_one_step once per realm per timestep. Owns the integration itself, i.e. everything that turns q at time t into q at time t + dt.
fortran
subroutine advance_one_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest's global reduction. |
Call graph
open_step_forest
Per-step prologue on the multi-realm path: set dt, init RK stages.
Mirrors the head of integrate_rk_ssp: external-field prelude (if active), rk%initialize_stages(q=self%q), and the per-step time bookkeeping advance_one_step_forest does inline (it increment, dt cap for time_max, self%time%dt update). Time advance and progress print run in close_step_forest, mirroring the legacy ordering.
fortran
subroutine open_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest. |
Call graph
begin_stage_forest
Begin integrator stage k on the multi-realm path (FNL).
Mirrors the FIRST line of integrate_rk_ssp's substage body: rk_fnl%compute_stage(s=k, dt=self%time%dt [, phi_gpu=ib_fnl%phi_gpu]). This populates rk_fnl%q_rk_gpu(:,:,:,:,:,k) from previously computed substages and from self%q_gpu, and publishes the stage buffer to peers by setting self%stage_active = k. No ghost reads, no peer-realm access — peer realms may not yet have opened their stage-k buffer when this fires.
fortran
subroutine begin_stage_forest(self, k, K_total, dt, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index (1..K_total). | |
K_total | integer(kind=I4P) | in | Forest-wide stage count for this step. | |
dt | real(kind=R8P) | in | Timestep size from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (contract parity). |
Call graph
end_stage_forest
Close integrator stage k: residuals + stage assignment in one sweep (FNL).
This is the FNL forest's Phase 3 TBP. Inter-realm seam ghost cells on rk_fnl%q_rk_gpu(:,...,k) are already filled by Phase 2 (which called fill_seam_from_peer_forest on this realm and its peers), so compute_residuals_dev reads valid halo data and rk_fnl%assign_stage's in-place overwrite of the stage interior no longer races with peer reads.
realm accepted on contract for parity but unused: the seam has already been refreshed by the forest. FV seam-flux ACCUMULATION is threaded through flux_register (issue #23 R3, CPU parity); the reflux APPLICATION (apply_reflux_to_stage_forest) remains a no-op until #23 R4.
fortran
subroutine end_stage_forest(self, k, K_total, dt, realm, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index (1..K_total). | |
K_total | integer(kind=I4P) | in | Forest-wide stage count for this step. | |
dt | real(kind=R8P) | in | Timestep size from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (FNL parity only; unused). |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register for FV reflux. |
Call graph
close_step_forest
Per-step epilogue on the multi-realm path: q assembly, BC, div-clean, residual save, coil source refresh, time advance, progress print (FNL).
fortran
subroutine close_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size from the forest. |
Call graph
fill_seam_from_peer_forest
FNL twin of prism_cpu_object%fill_seam_from_peer_forest. Walks the host-side row-range bookkeeping (seam_local_peer_row_start/count, populated by build_seam_local_map on the host), then dispatches an OpenACC kernel that reads peer's GPU buffer at peer-INTERIOR coords (FNL layout (b,i,j,k,v)) and writes self's GPU buffer at recv-side coords.
fortran
subroutine fill_seam_from_peer_forest(self, peer, p_idx)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | ||
peer | class(realm_object) | in | target | |
p_idx | integer(kind=I4P) | in |
Call graph
after_topology_build_forest
Propagate the freshly-built host seam maps and per-peer buffers to device-resident counterparts on field_fnl%maps. Invoked by the forest at the end of populate_inter_realm_topology AFTER build_seam_local_map has populated self%adam%maps%seam_local_*.
fortran
subroutine after_topology_build_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout |
Call graph
apply_reflux_to_stage_forest
PRISM-FNL override of the Berger-Colella reflux correction TBP — the apply twin of prism_cpu_object%apply_reflux_to_stage_forest (issue #23 R4, M4 semantics).
α.r1 cadence: end-of-step barrier. Fires exactly once per realm per step at stage == self%rk%nrk; earlier substages return immediately. For each register face whose coarse side this realm — and this RANK (#28 D4) — owns, the correction sign*(dt/dx_coarse)*(F_coarse − F_fine_sum)(:,:,1) is applied to the COMMITTED q_gpu on the one-cell-thick coarse seam skin (this TBP runs AFTER close_step_forest's update_q). Full step weight dt/dx — NOT a stage RK coefficient, and NOT a q_rk_gpu(...,stage) write (both were the pre-M4 sketch's errors: ark is never allocated for the SSP family, and a stage-buffer write would entangle the stage beta weight — see the CPU apply's M4 note). The tiny host mismatch slab is H2D-copied per face and fv_apply_reflux_face_dev_kernel adds it to q_gpu (scalar ops only, disjoint cells).
fortran
subroutine apply_reflux_to_stage_forest(self, stage, dt, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
stage | integer(kind=I4P) | in | Integrator stage 1..K_total. | |
dt | real(kind=R8P) | in | Time step. | |
flux_register | class(flux_register_object) | in | Forest's flux register. |
Call graph
post_step_forest
Run PRISM-FNL's per-timestep post-step work: state IO, energy diagnostics, max-divergence diagnostics.
Invoked by forest%post_step. v1 implementation is the verbatim post- step block formerly inline in simulate — every action runs every step, since today's cadence is enforced inside the save_* routines themselves (e.g. save_simulation_data honours io%it_save). The do_* flags are signature-only for now: when the forest takes over cadence the flags will gate the individual calls. For now they are accepted but unused, preserving present-day behavior bit-for-bit.
dt, t, it are not consumed by the current body; they are on the contract so the forest can supply them once it owns time-state (today they are still read from the time module singleton).
Optional realm(:): forwarded to save_simulation_data and update_ghost for the dummy-argument inter-realm halo refresh path.
fortran
subroutine post_step_forest(self, dt, t, it, do_save_state, do_save_residuals, do_save_restart, do_amr, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Timestep size just advanced. | |
t | real(kind=R8P) | in | Simulation time after the advance. | |
it | integer(kind=I4P) | in | Iteration index after the advance. | |
do_save_state | logical | in | optional | Save state output this step. |
do_save_residuals | logical | in | optional | Save residuals output this step. |
do_save_restart | logical | in | optional | Save restart dump this step. |
do_amr | logical | in | optional | Run AMR update this step. |
realm | class(realm_object) | inout | target, optional | Sibling realms for inter-realm halo refresh. |
Call graph
compute_dt
Compute the global stability-limited dt and store it on self%time%dt.
Body delegates the local computation to compute_local_dt_forest (orchestrator contract method), then performs the legacy MPI_ALLREDUCE on MPI_COMM_WORLD for backward compatibility with simulate. The forest's compute_global_dt performs its own reduction, possibly on a per-realm sub-comm; the redundancy disappears once the legacy compute_dt is retired.
fortran
subroutine compute_dt(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
compute_energy
Compute energy.
fortran
subroutine compute_energy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
compute_energy_error
Compute energy error.
fortran
subroutine compute_energy_error(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
compute_max_divergence
Compute maximum divergence.
fortran
subroutine compute_max_divergence(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
impose_ct_correction
Impose Constrained Transport Correction on vectorial variable q(ivar:ivar+2). Note that self%divergence memory is used as buffer, be carefull.
fortran
subroutine impose_ct_correction(self, ivar)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. | |
ivar | integer(kind=I4P) | in | Variable (start) index in q. |
Call graph
impose_div_free
Impose divergence-free property.
fortran
subroutine impose_div_free(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | inout | The equation. |
Call graph
Functions
stages_per_step_forest
Number of integrator stages this realm exposes per step (FNL).
SSP-only contract, twin of prism_cpu_object%stages_per_step_forest (issue #25): the staged protocol reads gamm(k) per stage and beta_gpu in close_step_forest — for low-storage schemes those are never allocated (the FNL symptom was CUDA_ERROR_ILLEGAL_ADDRESS in rk_update_q_dev through a bogus beta_gpu). Refusing here leaves the fused fast path — where LS schemes legitimately run — untouched.
Returns: integer(kind=I4P)
fortran
function stages_per_step_forest(self) result(K)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_fnl_object) | in | The realm. |
Call graph