PDA

View Full Version : Fortran compiling Help


Bala06
May8-11, 09:47 AM
Dear Physics forum

I tried to compile fortran program using the command "g77-ffree-form program.for", while compiling it shows following error.

C:\Documents and Settings\Balaji\Desktop\Fortaran>gfortran -ffree-form program.f
or
program.for:1.64:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCO
1
Error: Name at (1) is too long
program.for:2:


CCC PROGRAM: POPULATIONS OF C-ALPHA TO 2D MAP
1
Error: Unclassifiable statement at (1)
program.for:3.64:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCO
1
Error: Name at (1) is too long
program.for:7:


CCC DEFINE OCCUPIED GRIDS ON XY PLANE
1
Error: Unclassifiable statement at (1)
program.for:14:

CCC OPEN DATA FILE
1
Error: Unclassifiable statement at (1)
program.for:17:

CCC READ INPUT DATA
1
Error: Unclassifiable statement at (1)
program.for:28:


CCC WRITE DATA FOR SIGMAPLOT
1
Error: Unclassifiable statement at (1)
program.for:34.64:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCCO
1
Error: Name at (1) is too long

C:\Documents and Settings\Balaji\Desktop\Fortaran>

Let me know wats wrong while compliling.


Many Thanks
Balaji

Mark44
May8-11, 03:07 PM
You're missing the PROGRAM statement, which might be causing the compiler to not treat your comments correctly.

Bala06
May8-11, 03:19 PM
You're missing the PROGRAM statement, which might be causing the compiler to not treat your comments correctly.


Dear Mark

In the code, the "PROGRAM" statement is included.

Let me know exactly where to include, because I'm not a fortran expert.

Many Thanks
Balaji

TheoMcCloskey
May8-11, 05:10 PM
Bala06 - your using "free-form" source file format. Try replacing the leading "C" in each comment with "!". This seemed to work for me (using gfortran compilier).

I suspect the possible cause of this error is that the compilier can not distinuish your "comments" from an attempt to define a symbol - this is a reason that the usual "...the character 'C' in column one ..." rule is thrown out for comments in free format source files. You must use the "!" comment character.

Bala06
May8-11, 06:03 PM
You're missing the PROGRAM statement, which might be causing the compiler to not treat your comments correctly.

Bala06 - your using "free-form" source file format. Try replacing the leading "C" in each comment with "!". This seemed to work for me (using gfortran compilier).

I suspect the possible cause of this error is that the compilier can not distinuish your "comments" from an attempt to define a symbol - this is a reason that the usual "...the character 'C' in column one ..." rule is thrown out for comments in free format source files. You must use the "!" comment character.


Dear McCloskey

Thanks that works fine.


Many Thanks
Balaji