I am trying to compile an old Fortran IV code using the gcc fortran compiler (gfortran 4.8.1 -4). I run the compiler as: gfortran nrlxrf_a.for -std=legacy. These are the error messages:
C:\MinGW\bin>gfortran nrlxrf_a.for -std=legacy
NRLXRF_a.for:5525.72:
IF ( NFILL.EQ. 0)
1
Error: Cannot assign to a named constant at (1)
I have checked the line, and there are no spaces after the end of the statement.
NRLXRF_a.for:5531.7:
1 ( HFILL( I), I= 1, NFILL), ( H( IU, I), I= I1, I2)
1
Error: Cannot assign to a named constant at (1)
Any suggestions would be greatly appreciated. Thomas
This is the code section where HFILL and NFILL are used. Is this a matter of selecting the correct option for the compiler or a syntax error?
C:DOC IS THE DATUM NUMERIC? IF SO, GO TO 44; ELSE GO TO 50.
NFILL= 0
HTEST= H( IU, I1)
IF ( HTEST.NE. HSIGN( 1)) GO TO 41
GO TO 45
C:-------
41 IF ( HTEST.NE. HSIGN( 2)) GO TO 42
45 NFILL= 1
HTEST= H( IU, I1+ 1)
42 DO 43 J= 1, 11
IF ( HTEST.EQ. HDIG( J)) GO TO 44
43 CONTINUE
NFILL= 0
GO TO 50
C:-------
C:DOC DATUM IS NUMERIC. CALCULATE NO. OF BLANKS TO RIGHT-JUSTIFY.
44 NFILL= NC- NII
IF ( I2P.NE. I2) WRITE( KW, 111) ( H( IU, J), J= I1, I2P)
IF ( I2P.NE. I2) WRITE( KW, 112) ( H( IU, J), J= I1, I2)
C:DOC WRITE ANY FILL BLANKS AND DATUM TO SCRATCH FILE.
50 CONTINUE
IF ( NFILL.EQ. 0) WRITE( KS, 102) ( H( IU, I), I= I1, I2)
IF ( NFILL.EQ. 0) line 5525
C: 1 ENCODE( NC, 102, HIN( 4* NR- 3)) ( H( IU, I), I= I1, I2)
IF ( NFILL.NE. 0) WRITE( KS, 102)
1 ( HFILL( I), I= 1, NFILL), ( H( IU, I), I= I1, I2)
IF ( NFILL.NE. 0)
C: 1 ENCODE( NC, 102, HIN( 4* NR- 3))
1 ( HFILL( I), I= 1, NFILL), ( H( IU, I), I= I1, I2) line 5531
I1= I3+ 1