apply_halos_2d Subroutine

public subroutine apply_halos_2d(state)

Fill all four halo bands per cfg % bc_* edge type.

Dual-path: if no MPI Cartesian communicator has been set up (serial unit tests), falls back to the Phase-2C pure per-edge fills for all four edges. When the cart comm exists (MPI app / multi-rank tests), calls exchange_halos_2d to fill from real neighbours and then applies the physical BC fill only on edges whose Cart neighbour is MPI_PROC_NULL.

Diagonal corner ghosts are intentionally left unfilled (the dimension-by-dimension residual never reads them).

Arguments

Type IntentOptional Attributes Name
type(solver_state_2d_t), intent(inout) :: state