Caractere inválido no nome em (1) com origem de formulário fixo
Estou recebendo um erro "Caractere inválido no nome em (1)" no meu programa Fortran 77. Por que é isso?
Está na minha declaração de leitura
100 READ(S,*,END=200) LINE
mas não sei por que
Código:
PROGRAM Exercise
C
C PARAMETERS
C
INTEGER UNUM
PARAMETER (UNUM=15)
C
C LOCAL VARIABLES
C
REAL LINES
C
C FUNCTION DECLARATIONS
C
REAL NUMLIN
C
C COMMON VARIABLES
C
C
C DATA STATEMENTS
C
C MAIN PROGRAM MODULE
C
OPEN(UNIT=UNUM, FILE = 'line.txt', STATUS='OLD')
LINES=NUNMLIN(UNUM)
C
C Rewinding to the top of the file because the pointer is at the end
C of the file
C
REWIND(UNUM)
CLOSE(UNUM)
CALL PROCES(UNUM,LINES)
STOP
END PROGRAM
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C SUBROUTINE PROCES
C
C dynamically allocates space
C
SUBROUTINE PROCES(U,L)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C FUNCTIONS
C
C NUMLIN - counts the number of lines, uses the fact that the file
C is already open and passes this information to the next subroutine
C
REAL FUNCTION NUMLIN(S)
REAL NUMLIN
REAL S
CHARACTER*256 LINE
100 READ(S,*,END=200) LINE
NUMLIN=NUMLIN+1
GOTO 100
200 CONTINUE
RETURN
END
Erro:
NumberCountingExercise.for:90.7:
100 READ(S,*,END=200) LINE
1
Error: Invalid character in name at (1)
NumberCountingExercise.for:93.7:
200 CONTINUE
1
Error: Invalid character in name at (1)
NumberCountingExercise.for:85.27: