On 19 Jul 9:02AM, Alexander Beck-Ratzka wrote:
integer ierr, i, myrank, BUFSIZE, thefile, intsize
parameter (BUFSIZE=100)
integer buf(BUFSIZE)
do i=0,BUFSIZE
buf(i) = myrank*BUFSIZE + i
print*, 'i =', i, 'myrank =', myrank, 'buf(i)=',buf(i)
end do
[...]
When I am reading the data in again and print them out, I always have:
buf(0)=0
If you compile your code with -check bounds and run, you'll get an error
pointing out that buf(0) is an illegal access; in Fortran arrays start at 1.
- Jonathan
--
Jonathan Dursi | SciNet, Compute/Calcul Canada