On master, the MPI halo buffers can be undersized for chemistry runs in post_process.
Allocation (s_initialize_mpi_common_module, src/common/m_mpi_common.fpp:52-58) reserves the larger buffer only when diffusion is on:
else if (chemistry .and. chem_params%diffusion) then
v_size = sys_size + 1
else
v_size = sys_size
Use (s_mpi_sendrecv_variables_buffers, same file, ~line 575) takes the +1 branch in post_process without requiring diffusion:
#ifdef MFC_SIMULATION
else if (present(q_T_sf) .and. chemistry .and. chem_params%diffusion) then
#else
else if (present(q_T_sf) .and. chemistry) then ! post_process: any chemistry run
#endif
v_size = nVar + 1
So for a chemistry run without chem_params%diffusion in post_process, the buffers are allocated at v_size = sys_size but written at v_size = nVar + 1. Where nVar + 1 > sys_size this overruns the send/recv buffers.
The #else branch is deliberate and correct in intent — post_process converts cons->prim over ghost-inclusive bounds, so the temperature guess must be exchanged for every chemistry run or seam ghosts give NaN. The allocation side simply was not widened to match.
This is fixed on the common-stage-independence branch (the sizing conditions were unified); filing so the master-side defect is tracked independently of that PR's fate, and so it can be verified or backported.
On
master, the MPI halo buffers can be undersized for chemistry runs in post_process.Allocation (
s_initialize_mpi_common_module,src/common/m_mpi_common.fpp:52-58) reserves the larger buffer only when diffusion is on:Use (
s_mpi_sendrecv_variables_buffers, same file, ~line 575) takes the+1branch in post_process without requiring diffusion:So for a chemistry run without
chem_params%diffusionin post_process, the buffers are allocated atv_size = sys_sizebut written atv_size = nVar + 1. WherenVar + 1 > sys_sizethis overruns the send/recv buffers.The
#elsebranch is deliberate and correct in intent — post_process converts cons->prim over ghost-inclusive bounds, so the temperature guess must be exchanged for every chemistry run or seam ghosts give NaN. The allocation side simply was not widened to match.This is fixed on the
common-stage-independencebranch (the sizing conditions were unified); filing so the master-side defect is tracked independently of that PR's fate, and so it can be verified or backported.