Windows gfortran namelist input error

David Drum daviddrum@excite.com
Wed May 11 22:47:00 GMT 2016


The following program works fine under Linux but fails under Windows.
      IMPLICIT REAL*8(A-H,O-Z)
      DIMENSION SENID(30)
      NAMELIST /FITH/ SENID
      DO I=1,30
         SENID(I) = I
      ENDDO
      OPEN(UNIT=7,FILE='TEST.OUT',FORM='FORMATTED',
     *         STATUS='NEW',ACTION='READWRITE')
      WRITE(7,NML=FITH)
      REWIND(7)
      READ(7,NML=FITH)
      END
The error is:
At line 11 of file xxx.f (unit = 7, file = 'TEST.OUT')
Fortran runtime error: Cannot match namelist object name 27.0000000000
I am using GNU Fortran (GCC) 5.3.1 20160402 under Windows. 
I believe the error is caused because the ^M line terminator (for DOS files) is interpreted as a value separator for namelist input.



More information about the Fortran mailing list