Phase D helper. Reused by write_solution_file and write_snapshot to produce byte-identical multi-rank output.
Hybrid cpp split mirrors src/parallel_reductions.F90: MS-MPI ships only
the legacy use mpi module; OpenMPI ships both and we prefer mpi_f08
for the strong typing.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private, | parameter | :: | TAG_EDGE_RIGHT | = | 4001 |
Point-to-point tag for the right-edge ghost exchange (F2). The left edge
never needs a tag: |
Gather (neq, n_local) primitives from every rank into (neq, n_global) on rank 0 via MPI_Gatherv.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | local_prim(:,:) | |||
| integer, | intent(in) | :: | n_local |
this rank's interior cell count |
||
| type(decomp_t), | intent(in) | :: | decomp |
per-rank decomposition descriptor (needed for n_global, n_ranks) |
||
| real(kind=wp), | intent(inout) | :: | gather_buf(:,:) |
Gather the boundary halo/ghost cells owned by the global left- and
right-edge ranks to rank 0: left(neq,h) = the left-edge rank's
ub(:,1-h:0), right(neq,h) = the right-edge rank's
ub(:,n_local+1:n_local+h). Needed because checkpoint/restart must
persist these cells for "prescribed" BCs (dirichlet/inflow/
supersonic_inlet) whose ghost values are never recomputed by apply_bcs
after the initial seed, yet are NOT actually constant across a run (see
checkpoint.f90's module header for the full story) — F2.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(in) | :: | state |
This rank's solver state ( |
||
| real(kind=wp), | intent(inout) | :: | left(:,:) | |||
| real(kind=wp), | intent(inout) | :: | right(:,:) |
Inverse of gather_edge_ghosts_to_root: rank 0 delivers the left/
right ghost blocks (as just read from a checkpoint) to the ranks that
own those edges, copying directly into state % ub's halo columns.
Same ownership derivation and np=1 pure-local-copy behaviour as the
gather — F2.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(solver_state_t), | intent(inout) | :: | state |
This rank's solver state ( |
||
| real(kind=wp), | intent(in) | :: | left(:,:) | |||
| real(kind=wp), | intent(in) | :: | right(:,:) |