Fortran Compiling Help: Balaji's Physics Forum Inquiry

  • Context: Fortran 
  • Thread starter Thread starter Bala06
  • Start date Start date
  • Tags Tags
    Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 5K views
Bala06
Messages
10
Reaction score
0
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:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCO
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:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCO
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:

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCO
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
 

Attachments

Physics news on Phys.org
Mark44 said:
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
 
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.
 
Mark44 said:
You're missing the PROGRAM statement, which might be causing the compiler to not treat your comments correctly.

TheoMcCloskey said:
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