Appearance
adam_flume_fnl_object
ADAM, FLUME FNL (OpenACC / OpenMP offload) backend object.
Implements the forest contract on the device. The state lives on the device for the whole run in the transposed layout (b, i, j, k, v); full-field device-to-host copies happen only on save steps. The FNL helpers (field, IB, RK, WENO) are per-realm components initialized after the common initialization from the realm's own objects; mpih_fnl is the only FNL singleton and is initialized once per process. Space operator: characteristic (or conservative) WENO flux splitting, face fluxes then flux difference (issue #35, section 3.4); the per-face physics is the shared adam_flume_euler_library, so only the kernels are FNL-specific.
Source: src/app/flume/fnl/adam_flume_fnl_object.F90
Dependencies
Contents
- flume_fnl_object
- accumulate_seam_fluxes
- apply_floors
- allocate_gpu
- check_glm_ch
- compute_conservation
- compute_divb_history
- compute_q_aux
- copy_cpu_gpu
- copy_gpu_cpu
- copy_phi_gpu
- destroy
- initialize_flume
- save_residuals
- save_simulation_data
- set_boundary_conditions
- update_ghost
- advance_one_step_forest
- after_topology_build_forest
- apply_reflux_to_stage_forest
- begin_stage_forest
- close_step_forest
- compute_local_dt_forest
- end_stage_forest
- fill_seam_from_peer_forest
- finalize_forest
- finalize_mpi_forest
- initialize_forest
- is_done_forest
- open_step_forest
- post_step_forest
- compute_residuals_weno_dev
- integrate_rk_ls_dev
- integrate_rk_ssp_dev
- rk_assign_stage
- rk_compute_stage
- rk_compute_stage_ls
- rk_update_q
- stages_per_step_forest
Derived Types
flume_fnl_object
FLUME FNL backend object.
Inheritance
Extends: flume_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 | Runtime AMR locked after initialization. | |
save_auxiliary_fields | logical | Save the auxiliary variables with the fields. | |
glm_speed_reported | real(kind=R8P) | Largest wave speed above c_h reported so far. | |
divb_reported | real(kind=R8P) | Largest max|div B| above divb_tol reported so far. | |
divb_seam | integer(kind=I4P) | allocatable | Seam faces flags of the div(B) history [nb, 6]. |
q | real(kind=R8P) | allocatable | Conservative variables [nv, 1-ngc:ni+ngc, ..., nb]. |
dq | real(kind=R8P) | allocatable | Residuals [nv, 1-ngc:ni+ngc, ..., nb]. |
q_aux | real(kind=R8P) | allocatable | Auxiliary variables [nv_aux, 1-ngc:ni+ngc, ..., nb]. |
q_name | type(string) | allocatable | Conservative variables names. |
dq_name | type(string) | allocatable | Residuals names. |
q_aux_name | type(string) | allocatable | Auxiliary variables names. |
bc | type(flume_bc_object) | Boundary conditions. | |
diagnostics | type(flume_diagnostics_object) | Diagnostics. | |
ic | type(flume_ic_object) | Initial conditions. | |
numerics | type(flume_numerics_object) | Numerics. | |
physics | type(flume_physics_object) | Physics. | |
time | type(flume_time_object) | Time handler. | |
field_fnl | type(field_fnl_object) | Field helper (coordinates, maps, ghost exchange). | |
ib_fnl | type(ib_fnl_object) | Immersed boundary helper. | |
rk_fnl | type(rk_fnl_object) | Runge-Kutta helper. | |
weno_fnl | type(weno_fnl_object) | WENO helper. | |
q_gpu | real(kind=R8P) | pointer | Conservative variables [nb, i, j, k, nv]. |
dq_gpu | real(kind=R8P) | pointer | Residuals [nb, i, j, k, nv]. |
q_aux_gpu | real(kind=R8P) | pointer | Auxiliary variables [nb, i, j, k, nv_aux]. |
flx_f_gpu | real(kind=R8P) | pointer | X-face fluxes [nb, 0:ni, 1:nj, 1:nk, nv]. |
fly_f_gpu | real(kind=R8P) | pointer | Y-face fluxes [nb, 1:ni, 0:nj, 1:nk, nv]. |
flz_f_gpu | real(kind=R8P) | pointer | Z-face fluxes [nb, 1:ni, 1:nj, 0:nk, nv]. |
q_inflow_gpu | real(kind=R8P) | pointer | Conservative inflow state of each face [nv, 6]. |
wall_sign_gpu | real(kind=R8P) | pointer | Wall mirror sign per variable and direction [nv, 3]. |
divb_seam_gpu | integer(kind=I4P) | pointer | Seam faces flags of the div(B) history [nb, 6]. |
buf_5D_R8P | real(kind=R8P) | allocatable | Transposed copy buffer, extent identical to q_gpu. |
db5 | integer(kind=I4P) | Device bounds of the transposed copies. | |
hb5 | integer(kind=I4P) | Host bounds of the transposed copies. | |
compute_residuals_dev | procedure(compute_residuals_dev_interface) | pass(self), pointer | Space operator. |
integrate_dev | procedure(integrate_dev_interface) | pass(self), pointer | 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 |
amr_update | pass(self) | Do AMR update (initialization-time only). |
mark_by_geometry | pass(self) | Mark blocks to be refined by a primitive geometric box. |
mark_by_gradient | pass(self) | Mark blocks by the gradient of a conservative or auxiliary variable. |
mark_by_solid | pass(self) | Mark blocks crossed by the surface of an immersed solid. |
accumulate_seam_skin | pass(self) | Route one weighted seam face skin to the forest's flux register. |
allocate_common | pass(self) | Allocate common data. |
compute_fields_number | pass(self) | Compute the block-sized fields allocated per block. |
compute_phi | pass(self) | Compute the immersed solids distance function (host). |
destroy_common | pass(self) | Free common data. |
glm_lambda | pass(self) | Return the GLM bound of the local dt, c_h max sum_d 1/dx_d. |
initialize | pass(self) | Initialize the common data. |
null_freeze | pass(self) | Return the variable each null direction freezes. |
report_divb | pass(self) | Reduce and save the div(B) norms, apply the divb_tol monitor. |
report_glm_speed | pass(self) | Check c_h against the fastest wave (warning or stop). |
load_restart_files | pass(self) | Load restart files. |
save_restart_files | pass(self) | Save restart files. |
save_slices | pass(self) | Save the slices on their cadence. |
save_xh5f | pass(self) | Save fields in XH5F format. |
set_divb_seam | pass(self) | Set the seam faces flags of the div(B) history. |
set_glm_damping | pass(self) | Set the GLM damping once the grid exists. |
coupling_descriptor_forest | pass(self) | Return the realm coupling descriptor. |
accumulate_seam_fluxes | pass(self) | Accumulate the weighted seam face fluxes of one stage. |
apply_floors | pass(self) | Apply the MHD positivity floors of a stage. |
allocate_gpu | pass(self) | Allocate device data. |
check_glm_ch | pass(self) | Check the GLM c_h against the fastest wave. |
compute_conservation | pass(self) | Compute and save the conservation integrals. |
compute_divb_history | pass(self) | Compute and save the div(B) norms (MHD). |
compute_q_aux | pass(self) | Compute the auxiliary variables. |
copy_cpu_gpu | pass(self) | Copy state and topology from host to device. |
copy_gpu_cpu | pass(self) | Copy state from device to host. |
copy_phi_gpu | pass(self) | Copy the immersed solids distance function to the device. |
destroy | pass(self) | Free device and host data. |
initialize_flume | pass(self) | Initialize the FNL backend. |
save_residuals | pass(self) | Save residuals history. |
save_simulation_data | pass(self) | Save fields, restart and diagnostics on their cadence. |
set_boundary_conditions | pass(self) | Set boundary conditions on the device crown maps. |
update_ghost | pass(self) | Update ghost cells: local, MPI, boundary conditions. |
advance_one_step_forest | pass(self) | Advance one full step (fast path). |
after_topology_build_forest | pass(self) | Copy the forest-built seam and BC maps to the device. |
apply_reflux_to_stage_forest | pass(self) | Apply the reflux correction. |
begin_stage_forest | pass(self) | Begin an integrator stage (staged path). |
close_step_forest | pass(self) | Close a step (staged path). |
compute_local_dt_forest | pass(self) | Compute the local stability-limited time step. |
end_stage_forest | pass(self) | End an integrator stage (staged path). |
fill_seam_from_peer_forest | pass(self) | Fill inter-realm seam ghosts from a peer. |
finalize_forest | pass(self) | Finalize the realm. |
finalize_mpi_forest | pass(self) | Finalize the FNL MPI handler. |
initialize_forest | pass(self) | Initialize the realm. |
is_done_forest | pass(self) | Return true if the realm is done. |
open_step_forest | pass(self) | Open a step (staged path). |
post_step_forest | pass(self) | Post-step IO and diagnostics. |
stages_per_step_forest | pass(self) | Return the integrator stages per step. |
Subroutines
accumulate_seam_fluxes
Accumulate the seam face fluxes of stage s, weighted by its SSP coefficient, into the forest's flux register.
The register is host-side: each seam face skin is packed on the device and copied to the host (a few KB per face and stage), then routed by the shared accumulate_seam_skin, as on the CPU.
fortran
subroutine accumulate_seam_fluxes(self, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
s | integer(kind=I4P) | in | Runge-Kutta stage. | |
flux_register | class(flux_register_object) | inout | Forest's flux register. |
Call graph
apply_floors
Apply the MHD positivity floors to the interior of a stage state, before its ghost exchange (issue #41, 3.8).
Euler has no floors (return before any work). MHD: the floored cells of the stage are logged by rank 0 when any; a non-positive density or pressure with the floors disabled (both zero) is fatal, reported with the global minimum density and pressure.
fortran
subroutine apply_floors(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
allocate_gpu
Allocate device data (every dev_alloc checked) and the host staging buffer.
fortran
subroutine allocate_gpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
check_glm_ch
Check the GLM cleaning speed against the fastest wave of the committed state (issue #41, section 3.5); a no-op without GLM.
fortran
subroutine check_glm_ch(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
compute_conservation
Compute the volume integrals of the conservative variables on the device and save them on their cadence.
fortran
subroutine compute_conservation(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
compute_divb_history
Compute and save the div(B) norms of the committed state on the diagnostics cadence (issue #41, D-10); a no-op for Euler. The ghost cells are refreshed first and, with sibling realms, the inter-realm seam ghosts are refilled from the peers (update_ghost does not fill them, issue #31): the stencils of the seam-local cells read them. The seam faces flags are rebuilt and copied to the device at every call (6 nb integers): at step 0 the forest may not have registered the seams yet.
fortran
subroutine compute_divb_history(self, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
realm | class(realm_object) | inout | target, optional | Sibling realms. |
Call graph
compute_q_aux
Compute the auxiliary variables on the device, ghost cells included.
fortran
subroutine compute_q_aux(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | in | Conservative variables. |
Call graph
copy_cpu_gpu
Copy state and topology (coordinates, maps) from host to device.
fortran
subroutine copy_cpu_gpu(self, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
copy_gpu_cpu
Copy state and residuals from device to host.
fortran
subroutine copy_gpu_cpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
copy_phi_gpu
Copy the immersed solids distance function (computed on the host, the solids are static) to the device, transposed from (s, i, j, k, b) to (b, i, j, k, s); the staging buffer has the extent of the device array (issue #31).
fortran
subroutine copy_phi_gpu(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
destroy
Free device and host data: own device buffers, the FNL helpers (library teardown) and the common data.
fortran
subroutine destroy(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
initialize_flume
Initialize the FNL backend: MPI and device (once per process), device budget, common data, FNL helpers, device data, dispatch.
fortran
subroutine initialize_flume(self, filename, realms_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | target | The equation. |
filename | character(len=*) | in | Input file name. | |
realms_number | integer(kind=I4P) | in | optional | Realm count; divides the device budget. |
Call graph
save_residuals
Save residuals history (L2 norm of dq on the device, MPI-reduced, rank 0 writes).
fortran
subroutine save_residuals(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
save_simulation_data
Save fields, restart, slices and conservation history, each on its own cadence; state copied to host only when saved.
fortran
subroutine save_simulation_data(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
set_boundary_conditions
Set boundary conditions on the device crown maps, crown by crown.
fortran
subroutine set_boundary_conditions(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
update_ghost
Update ghost cells on the device: intra-realm local copies, GPU-direct MPI exchange, boundary conditions.
fortran
subroutine update_ghost(self, q_gpu)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
q_gpu | real(kind=R8P) | inout | Conservative variables. |
Call graph
advance_one_step_forest
Advance one full step of size dt (fast path: single realm, no AMR seam faces).
fortran
subroutine advance_one_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
dt | real(kind=R8P) | in | Time step from the forest's global reduction. |
Call graph
after_topology_build_forest
Copy the host maps the forest built after the realm initialization to the device: the inter-realm seam map and buffers (maps%seam_local_*) and the BC crown map, whose seam rows the forest rewrote to BC_SEAM (issue #37; without it the seam fill kernel reads an unset device map and the BC kernel extrapolates over the seam ghosts).
fortran
subroutine after_topology_build_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
apply_reflux_to_stage_forest
Apply the Berger-Colella reflux correction to the committed q_gpu (the forest calls it once per step, after close_step_forest, with the final stage); device twin of the CPU apply.
For every register face whose coarse side this realm and this rank own, the host mismatch slab F_coarse - F_fine_sum (step fluxes, sum_s beta_s F_s) is copied to the device and added, scaled by sgn dt / dx_coarse, to the coarse skin cells.
The scale uses the step the update used, time%dt: on the last step of a time-driven run the realm caps it to land on time_max, and the forest's dt argument is the uncapped value (with it the correction was off by the ratio of the two, 1.3e-9 of the mass on sod-amr; issue #37).
fortran
subroutine apply_reflux_to_stage_forest(self, stage, dt, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
stage | integer(kind=I4P) | in | Integrator stage. | |
dt | real(kind=R8P) | in | Forest time step (unused: see the scale below). | |
flux_register | class(flux_register_object) | in | Forest's flux register. |
Call graph
begin_stage_forest
Begin integrator stage k (staged path): publish the stage and compute its state.
fortran
subroutine begin_stage_forest(self, k, K_total, dt, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
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 | Time step from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (contract parity). |
Call graph
close_step_forest
Close a step (staged path): assemble q, save residuals, advance time, clear the active stage.
fortran
subroutine close_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
dt | real(kind=R8P) | in | Time step from the forest (the local capped value is time%dt). |
Call graph
compute_local_dt_forest
Compute the local stability-limited time step on the device, dt = CFL / max(sum_d (|u_d| + a) / dx_d); with GLM, also dt <= CFL / (c_h max sum_d 1 / dx_d) (glm_lambda, host data, issue #41, section 3.5).
fortran
subroutine compute_local_dt_forest(self, dt_local)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | in | The equation. | |
dt_local | real(kind=R8P) | out | Local stability-limited time step. |
Call graph
end_stage_forest
End integrator stage k (staged path): residuals on the stage state, then stage assignment.
fortran
subroutine end_stage_forest(self, k, K_total, dt, realm, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
k | integer(kind=I4P) | in | Stage index (1..K_total). | |
K_total | integer(kind=I4P) | in | Forest-wide stage count. | |
dt | real(kind=R8P) | in | Time step from the forest. | |
realm | class(realm_object) | inout | target, optional | Sibling realms (parity only). |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register. |
Call graph
fill_seam_from_peer_forest
Fill this realm's seam ghosts for peer slot p_idx from the peer's interior, on the active device buffers (q_gpu when stage_active == 0, else the active stage of q_rk_gpu) of both realms.
fortran
subroutine fill_seam_from_peer_forest(self, peer, p_idx)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
peer | class(realm_object) | in | target | Peer realm. |
p_idx | integer(kind=I4P) | in | Peer slot. |
Call graph
finalize_forest
Finalize the realm: close the output files and free device and host data (MPI is finalized once by the forest).
fortran
subroutine finalize_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
finalize_mpi_forest
Finalize the FNL MPI handler (called once by the forest after every realm is finalized).
fortran
subroutine finalize_mpi_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation (carries no MPI state). |
Call graph
initialize_forest
Initialize the realm (issue #35, section 6.1): backend init, IC (or restart) and initial AMR on the host, device topology and state sync, ghost update, initial output, output files open, AMR lock.
fortran
subroutine initialize_forest(self, filename, realms_number, memory_avail, nv, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
filename | character(len=*) | in | Input file name. | |
realms_number | integer(kind=I4P) | in | optional | Realm count; divides the device budget. |
memory_avail | real(kind=R8P) | in | optional | Unused: the budget comes from the device. |
nv | integer(kind=I4P) | in | optional | Unused: nv is decided by the physics. |
verbose | logical | in | optional | Unused: initialization is always verbose. |
Call graph
is_done_forest
Return true if the realm has reached its end.
fortran
subroutine is_done_forest(self, done)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | in | The equation. | |
done | logical | out | True if the realm is done. |
Call graph
open_step_forest
Open a step (staged path): time bookkeeping and Runge-Kutta stages initialization.
fortran
subroutine open_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
dt | real(kind=R8P) | in | Time step from the forest. |
Call graph
post_step_forest
Post-step work: the GLM c_h check, the div(B) history (MHD), fields, restart and conservation history on their cadence.
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(flume_fnl_object) | inout | The equation. | |
dt | real(kind=R8P) | in | Time step just advanced. | |
t | real(kind=R8P) | in | Time after the advance. | |
it | integer(kind=I4P) | in | Iteration after the advance. | |
do_save_state | logical | in | optional | Unused: cadence is internal. |
do_save_residuals | logical | in | optional | Unused: cadence is internal. |
do_save_restart | logical | in | optional | Unused: cadence is internal. |
do_amr | logical | in | optional | Unused: AMR is init-time only. |
realm | class(realm_object) | inout | target, optional | Sibling realms. |
Call graph
compute_residuals_weno_dev
Compute the residuals with the WENO space operator on the device: ghost update, auxiliary variables, face fluxes of the active directions, flux difference.
The face fluxes of a null direction are never computed: they keep their zero initialization (dev_alloc). On the staged path (AMR seam faces), the seam face fluxes of every stage are accumulated into the forest's flux register.
fortran
subroutine compute_residuals_weno_dev(self, q_gpu, dq_gpu, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_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 | Runge-Kutta stage. |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register for reflux. |
Call graph
integrate_rk_ls_dev
Integrate one time step with a low-storage Runge-Kutta scheme on the device.
fortran
subroutine integrate_rk_ls_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
integrate_rk_ssp_dev
Integrate one time step with a strong stability preserving Runge-Kutta scheme on the device.
fortran
subroutine integrate_rk_ssp_dev(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
rk_assign_stage
Assign the residual of stage s to the Runge-Kutta stage buffer; the solid cells are masked with immersed solids.
fortran
subroutine rk_assign_stage(self, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
s | integer(kind=I4P) | in | Stage. |
Call graph
rk_compute_stage
Compute the state of stage s; the solid cells are masked with immersed solids.
fortran
subroutine rk_compute_stage(self, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
s | integer(kind=I4P) | in | Stage. |
Call graph
rk_compute_stage_ls
Advance low-storage stage s; the solid cells are masked with immersed solids.
fortran
subroutine rk_compute_stage_ls(self, s)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. | |
s | integer(kind=I4P) | in | Stage. |
Call graph
rk_update_q
Assemble the committed state of a strong stability preserving step; the solid cells are masked with immersed solids.
fortran
subroutine rk_update_q(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | inout | The equation. |
Call graph
Functions
stages_per_step_forest
Return the integrator stages per step: only SSP schemes are stage-splittable (staged path).
Returns: integer(kind=I4P)
fortran
function stages_per_step_forest(self) result(K)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(flume_fnl_object) | in | The equation. |
Call graph