Hello,
I got a similar message and identified that the problem was with line 222 in the optimize_input.F file.
...
214 IF (ASSOCIATED(cell_traj_read)) ALLOCATE (cell_traj(3, 3, n_frames))
215
216 n_frames = 0
217 DO i_frame = oi_env%fm_env%frame_start, oi_env%fm_env%frame_stop, oi_env%fm_env%frame_stride
218 n_frames = n_frames + 1
219 force_traj(:, :, n_frames) = force_traj_read(:, :, i_frame)
220 pos_traj(:, :, n_frames) = pos_traj_read(:, :, i_frame)
221 energy_traj(n_frames) = energy_traj_read(i_frame)
222 IF (ASSOCIATED(cell_traj)) cell_traj(:, :, n_frames) = cell_traj_read(:, :, i_frame)
223 ENDDO
...
In the above version of the code, line 214 allows cell_traj to be allocated if cell_traj_read is allocated.
But this doesn't guarantee that if cell_traj_read is not allocated, cell_traj is not allocated, , which leads to a memory access problems line 222 (if cell_traj is allocated then we try to write in an array which is not allocated which leads to the error)
I fixed the problem by adding cell_traj to the NULLIFY command line 200 :
...
200 NULLIFY (cell_traj_read, force_traj_read, pos_traj_read, energy_traj_read,cell_traj)
...
regards,
Hervé Bulou