diff --git a/src/post_process/m_data_input.f90 b/src/post_process/m_data_input.f90 index e7d1bd3e07..287a8a505c 100644 --- a/src/post_process/m_data_input.f90 +++ b/src/post_process/m_data_input.f90 @@ -211,13 +211,17 @@ impure subroutine s_read_serial_data_files(t_step) call s_assign_default_bc_type(bc_type) end if - call s_read_grid_data_direction(t_step_dir, 'x', x_cb, dx, x_cc, m) + ! Pass explicit slices so the dummy `dimension(-1:)` / `dimension(0:)` arguments map to the correct interior indices of the + ! actual arrays. Without slicing, when offset_x%beg or buff_size > 0 (i.e. format=1 parallel 3D ranks), Fortran's + ! assumed-shape re-mapping shifts the read by that many slots and leaves the last interior cells uninitialized - corrupting + ! downstream ghost-cell extrapolation. + call s_read_grid_data_direction(t_step_dir, 'x', x_cb(-1:m), dx(0:m), x_cc(0:m), m) if (n > 0) then - call s_read_grid_data_direction(t_step_dir, 'y', y_cb, dy, y_cc, n) + call s_read_grid_data_direction(t_step_dir, 'y', y_cb(-1:n), dy(0:n), y_cc(0:n), n) if (p > 0) then - call s_read_grid_data_direction(t_step_dir, 'z', z_cb, dz, z_cc, p) + call s_read_grid_data_direction(t_step_dir, 'z', z_cb(-1:p), dz(0:p), z_cc(0:p), p) end if end if