I have been entrusted with the responsibility of maintaining some heritage fortran code, and I'm having trouble compiling it with Gaferan I have written a fair amount of Forrestran 95, but this is my first experience with Fortran 77. This snippet of code is problematic:
CHARACTER * 22 IFILE, OFIL IFILE = 'test .IN' OFIL = 'TEST.OUT' Open (5, file = iefile, condition = 'new' ) Open (6, File = Opel, Status = 'New') Normal / Pubbed / NFFI
When I compile with griefran file.FOR
All the rows that begin with the normal
statement are errors (such as error: unexpected COMMON statement (1)
for each of the following line until this error 25 Received no hits). I compiled with -Wall -pedantic
, but fixing the alerts did not fix this problem.
The crazy thing is that if I start all 4 lines with IF = 'TEST.IN'
, then the program is compiled and expected work I have to comment on them all leaving any of them uncomfortable, I get errors starting from the normal
statement. Commenting the statement, I get the same errors, just starting with the following line Is there.
I have gfortran
on OS X Leopard (not Snow Leopard). I have used this system with a large amount of writing code for Fortran 95 programs, so the compiler in the theory is only wise. What's going on with this code?
Edit : Compiles with g77:
test.FOR: Program 'MAIN__' in: test.FOR : 154: IFILE = 'TEST.IN' 1 test. FOR: 158: (Continued): Details on common / pubbed / NFF2 description (2) (1) / code> Which reference is established in er, (1)?
I do not think you want normal
under executable statements in Fortran 77 You can put the statement, see, compress. 3.5. Before any executable statement, simply move the COMMON
statement close to the beginning of the process.
Comments
Post a Comment