Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

gfortran compiler error messages

Howdy,

I am using gfortran, BBEdit, and the terminal to work on leaning Fortran. Many of the fortran examples of source code, mostly of the old Adventure game, that I have found are rather old and I get a mess of compiler error messages, which is ok, but I do not understand the message format completely.

for example;

C 9650 WORDS OF MESSAGE TEXT (LINES, LINSIZ).

results in.

C 9650 WORDS OF MESSAGE TEXT (LINES, LINSIZ).

1

Error: Unclassifiable statement at (1)

Which I take to mean that the compiler expects a comment to start with ! now.

===============================================================

these two lines of code

DIMENSION LTEXT(150),STEXT(150),KEY(150),COND(150),ABB(150),

1 ATLOC(150)


result in the following error message:

Error: Unclassifiable statement at (1)

advent.f90:37.61:


DIMENSION LTEXT(150),STEXT(150),KEY(150),COND(150),ABB(150),

1

Error: Invalid character in name at (1)

advent.f90:38.3:


1 ATLOC(150)

1

Error: Unclassifiable statement at (1)


I can read the Error: statement ok, it's just the 1 and (1) that I do not understand.

Can anyone tell me what they mean or direct me to a website that explains the error message formats?

Thank you,

DN

iMac, OS X Yosemite (10.10.2), Wants to be a Mac Pro!!

Posted on Feb 24, 2015 6:03 AM

Reply
Question marked as Best reply

Posted on Feb 25, 2015 9:33 PM

It looks like you're compiling Fortran 77 source in a file with a .f90 suffix. Try changing the suffix to .f and see what happens. You might also need to use a compiler flag to specify Fortran 77 source.


I think the "1" on the line before the error message is intended to mark the point in the source line above it at which the parser detected the error, and "at (1)" in the error message refers to this marker. But a web search should give you a definitive answer.

2 replies
Question marked as Best reply

Feb 25, 2015 9:33 PM in response to danuke

It looks like you're compiling Fortran 77 source in a file with a .f90 suffix. Try changing the suffix to .f and see what happens. You might also need to use a compiler flag to specify Fortran 77 source.


I think the "1" on the line before the error message is intended to mark the point in the source line above it at which the parser detected the error, and "at (1)" in the error message refers to this marker. But a web search should give you a definitive answer.

Feb 26, 2015 5:21 AM in response to fpDoug

Howdy,

Thank you for your help!!

Regarding compiling older fort source code, I found that using:

gfortran -std=legacy works on the older *.f, *.for, etc. codes. that is, things like C for comments works, however, some of the code statements have been deleted from gfortran such as FORMAT, or using line numbers in the code for things like GO TO line number, and perhaps TYPE(###) as used in the original Adventure program. Going through the gfortran.info file has helped a lot more than the gfortran man pages.

Alas, I have not been able to find much about them on the net. I have a Fortran IV manual, seeing as how some of this code is really old, and have ordered

Fortran 90 Programming (International Computer Science Series)

gfortran compiler error messages

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.