DO-loop and WRITE strange behaviour

Paul Thomas paulthomas2@wanadoo.fr
Mon Jul 4 04:58:00 GMT 2005


Steve,

>Do you have both 4.0 and 4.1 installed in the same location
>e.g., a /usr/local/bin/gfortran40 and /usr/local/bin/gfortran41?
>

No, the libraries are in distinct places.  However, I do realise that 
4.0 is using the 4.1 library because only the one is being set in 
LD_LIBRARY_PATH.

On correcting that, I find that my 4.0 of 20050605 works correctly. 
 Note the comment in the following:

PROGRAM SIMPLE
  IMPLICIT NONE
  INTEGER i, j
! OPEN (10, status='scratch')     !works
  OPEN (10, file = "test.txt")    !doesn't work with libgfortran > 20050605
  DO i = 1, 1000
    WRITE (10, *) i
  END DO
  rewind (10)
  do i = 1, 1000
    read (10, *) j
    if (j.ne.i) call abort ()
  end do
  close (10)
END PROGRAM SIMPLE

There are a number of ChangeLog entries in the timeframe that involve IO 
but none of them whack be between the eyes a being  the problem.

Paul T




More information about the Fortran mailing list