Appearance
adam_ripple_cpu_object
RIPPLE, the CPU backend realm.
The residuals (ghost update, WENO face fluxes, flux difference) and the forest contract on the host. Two paths reach the integration: the fast path (advance_one_step_forest, a whole SSP Runge-Kutta step at once) when the grid has no 2:1 face, the staged path (open_step, begin_stage, end_stage, close_step, then the reflux) when it has one: there the forest's flux register collects the seam face fluxes of every stage, and the end-of-step reflux makes the coarse and fine sides of each 2:1 face exchange the same flux.
Source: src/app/ripple/cpu/adam_ripple_cpu_object.F90
Dependencies
Contents
- ripple_cpu_object
- update_ghost
- compute_residuals
- accumulate_seam_fluxes
- initialize_forest
- advance_one_step_forest
- post_step_forest
- finalize_forest
- open_step_forest
- begin_stage_forest
- end_stage_forest
- close_step_forest
- apply_reflux_to_stage_forest
Derived Types
ripple_cpu_object
RIPPLE CPU realm.
Inheritance
Extends: ripple_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) | FLAIL, the elliptic solver library (issue #84). | |
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) | A copy of the forest's flux register (its faces and lookup, the accumulators unused), refreshed by the forest each | |
flux_register_copy | type(flux_register_object) | 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. |
q | real(kind=R8P) | allocatable | State, point values u [1, 1-ngc:ni+ngc, ..., nb]. |
dq | real(kind=R8P) | allocatable | Residuals, same shape. |
a | real(kind=R8P) | Advection velocity. | |
cfl | real(kind=R8P) | CFL number. | |
time | real(kind=R8P) | Current time. | |
time_max | real(kind=R8P) | Final time. | |
dt | real(kind=R8P) | Current time step. | |
it | integer(kind=I4P) | Current iteration. | |
it_max | integer(kind=I4P) | Iterations number; <= 0: run to time_max. | |
history_unit | integer(kind=I4P) | Unit of the history file (rank 0). | |
amr_criteria | type(amr_criterion_pointer) | allocatable | Registered refinement criteria (issue #110). |
flx | real(kind=R8P) | allocatable | X-face fluxes [1, 0:ni, 1:nj, 1:nk, nb]. |
fly | real(kind=R8P) | allocatable | Y-face fluxes [1, 1:ni, 0:nj, 1:nk, nb]. |
flz | real(kind=R8P) | allocatable | Z-face fluxes [1, 1:ni, 1:nj, 0:nk, nb]. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
initialize | pass(self) | Initialize common data. |
load_fdv_from_file | pass(self) | Load FDV config from file. |
coupling_descriptor_forest | pass(self) | Report (scheme_time, rk_scheme, nv) for β admissibility. |
runtime_amr_forest | pass(self) | Whether this realm regrids during the run (#74). |
regrid_forest | pass(self) | Invoked by forest%regrid per realm per timestep (#74). |
regrid_begin_forest | pass(self) | Multi-realm regrid, phase 1: is it a regrid step (#110). |
regrid_mark_forest | pass(self) | Phase 2: mark one sweep, marks on the tree (#110). |
regrid_apply_forest | pass(self) | Phase 3: adapt to the (balanced) tree marks (#110). |
regrid_end_forest | pass(self) | Phase 4: refresh the grid-dependent state (#110). |
finalize_mpi_forest | pass(self) | Process-global MPI finalize; forest calls it ONCE after all. |
fill_seam_from_peer_forest | pass(self) | Receive-side roundtrip: copy peer's interior into self's ghosts. |
pack_seam_cells_forest | pass(self) | Pack own cells of the cross-rank seam send rows. |
unpack_seam_cells_forest | pass(self) | Unpack the cross-rank seam receive rows into own ghosts. |
after_topology_build_forest | pass(self) | Backend hook invoked once after the forest builds the seam maps. |
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 |
initialize_ripple | pass(self) | Initialize the common data. |
check_input | pass(self) | Refuse the inputs RIPPLE cannot honour. |
set_initial_conditions | pass(self) | Set the initial profile on the interior cells. |
amr_update | pass(self) | Initial AMR: box markers and registered criteria. |
register_amr_criterion | pass(self) | Register a refinement criterion by name (issue #110). |
compute_total | pass(self) | Total of u dV on this rank. |
save_output | pass(self) | Save one history row and the state (XH5F). |
advance_time | pass(self) | Count the step and cap dt on time_max. |
accumulate_seam_skin | pass(self) | Route one seam face skin to the flux register. |
apply_reflux | pass(self) | Berger-Colella correction of the coarse seam cells of q. |
compute_local_dt_forest | pass(self) | Local CFL time step. |
is_done_forest | pass(self) | True when the run is over. |
stages_per_step_forest | pass(self) | Runge-Kutta stages per step (staged path). |
update_ghost | pass(self) | Fill the ghost cells. |
compute_residuals | pass(self) | Residuals of one state. |
accumulate_seam_fluxes | pass(self) | Seam face fluxes of one stage to the flux register. |
initialize_forest | pass(self) | Initialize the realm. |
advance_one_step_forest | pass(self) | Advance one whole step. |
post_step_forest | pass(self) | Save the outputs on their cadence. |
finalize_forest | pass(self) | Finalize the realm. |
open_step_forest | pass(self) | Open a step. |
begin_stage_forest | pass(self) | Begin a stage. |
end_stage_forest | pass(self) | End a stage. |
close_step_forest | pass(self) | Close a step. |
apply_reflux_to_stage_forest | pass(self) | Reflux the committed step. |
Subroutines
update_ghost
Fill the ghost cells: copies (and 2:1 restriction/prolongation) between local blocks, then the MPI exchange. Every face is periodic, so there is no boundary condition to apply.
fortran
subroutine update_ghost(self, q)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
q | real(kind=R8P) | inout | State. |
Call graph
compute_residuals
Compute the residuals dq of state q: ghost update, WENO face fluxes of each non-null axis, flux difference. On the staged path (flux_register present), the seam face fluxes of stage s go to the register.
fortran
subroutine compute_residuals(self, q, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
q | real(kind=R8P) | inout | State. | |
s | integer(kind=I4P) | in | optional | Runge-Kutta stage. |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register. |
Call graph
accumulate_seam_fluxes
Pack the face flux skin of every registered seam face of every block and route it to the register, weighted by the SSP coefficient of stage s.
fortran
subroutine accumulate_seam_fluxes(self, s, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
s | integer(kind=I4P) | in | Runge-Kutta stage. | |
flux_register | class(flux_register_object) | inout | Forest's flux register. |
Call graph
initialize_forest
Initialize the realm: common data, face fluxes, initial AMR, initial condition, first output.
fortran
subroutine initialize_forest(self, filename, realms_number, memory_avail, nv, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
filename | character(len=*) | in | Input file name. | |
realms_number | integer(kind=I4P) | in | optional | Unused: RIPPLE is single-realm. |
memory_avail | real(kind=R8P) | in | optional | Unused: the budget comes from the MPI handler. |
nv | integer(kind=I4P) | in | optional | Unused: nv = 1. |
verbose | logical | in | optional | Unused. |
Call graph
advance_one_step_forest
Advance one whole SSP Runge-Kutta step (fast path: no 2:1 face).
fortran
subroutine advance_one_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Time step from the forest. |
Call graph
post_step_forest
Append the history row every step; save the fields every [IO] it_save steps and at the end.
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(ripple_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Unused: the realm keeps its own. | |
t | real(kind=R8P) | in | Unused. | |
it | integer(kind=I4P) | in | Unused. | |
do_save_state | logical | in | optional | Unused. |
do_save_residuals | logical | in | optional | Unused. |
do_save_restart | logical | in | optional | Unused. |
do_amr | logical | in | optional | Unused. |
realm | type(realm_pointer) | inout | target, optional | Unused. |
Call graph
finalize_forest
Finalize the realm (the forest finalizes MPI once).
fortran
subroutine finalize_forest(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. |
Call graph
open_step_forest
Open a step: count it, cap dt, copy q into every stage.
fortran
subroutine open_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in | Time step from the forest. |
Call graph
begin_stage_forest
Begin stage k: publish it (stage_active) and build its state.
fortran
subroutine begin_stage_forest(self, k, K_total, dt, realm)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index. | |
K_total | integer(kind=I4P) | in | Unused: the forest's stage count. | |
dt | real(kind=R8P) | in | Unused: the capped dt is self%dt. | |
realm | type(realm_pointer) | inout | target, optional | Unused. |
Call graph
end_stage_forest
End stage k: its residuals, the seam fluxes to the register, the stage assignment.
fortran
subroutine end_stage_forest(self, k, K_total, dt, realm, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
k | integer(kind=I4P) | in | Stage index. | |
K_total | integer(kind=I4P) | in | Unused. | |
dt | real(kind=R8P) | in | Unused. | |
realm | type(realm_pointer) | inout | target, optional | Unused. |
flux_register | class(flux_register_object) | inout | optional | Forest's flux register. |
Call graph
close_step_forest
Close a step: commit q, advance the time, clear the active stage.
fortran
subroutine close_step_forest(self, dt)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
dt | real(kind=R8P) | in |
Call graph
apply_reflux_to_stage_forest
Reflux the committed step (the forest calls it after close_step_forest, with the last stage).
fortran
subroutine apply_reflux_to_stage_forest(self, stage, dt, flux_register)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(ripple_cpu_object) | inout | The realm. | |
stage | integer(kind=I4P) | in | Stage: the correction acts at the last one. | |
dt | real(kind=R8P) | in | Unused: the capped dt is self%dt. | |
flux_register | class(flux_register_object) | in | Forest's flux register. |
Call graph