INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Jobs from Indeed

fortran compiler error!

fortran compiler error!

(OP)
hi all, i tried to run a fortran program and i got this error message below;

C:\g77>g77 program001..f
program001..f:1:
   PROGRAM 001
   ^
Invalid first character at (^) [info -f g77 M LEX]
program001..f:5:
   IMPLICIT NONE
   ^
Invalid first character at (^) [info -f g77 M LEX]
program001..f:8:
       PRINT *,' Type in your first name.'
       ^
Non-numeric character at (^) in label field [info -f g77 M LEX]
program001..f:9:
       PRINT *,' up to 20 characters'
       ^
Non-numeric character at (^) in label field [info -f g77 M LEX]
program001..f:10:
       READ *, First_Name
       ^
Non-numeric character at (^) in label field [info -f g77 M LEX]
program001..f:11:
       PRINT *, First_Name
       ^
Non-numeric character at (^) in label field [info -f g77 M LEX]
program001..f:14:
   END PROGRAM 001
   ^
Invalid first character at (^) [info -f g77 M LEX]

pls what am i suppose to do?

thanks

RE: fortran compiler error!

Take care : you are using g77 which is obsolete. g77 is a Fortran-77 compiler. So you must respect the Fortran-77 norm.

In particular :
- a normal instruction starts with 6 spaces
- a label (composed of digits) may occupy the columns 1-5
- the column 6 is reserved to indicate a continuation card
- an instruction cannot exceed 72 characters

In addition, your first instruction is invalid even with a more recent compiler (usually Fortran95 compliant) :
The keyword PROGRAM must be followed by a name. In Fortran, a name starts by a letter and is composed of letters and digits

The last instruction  "END PROGRAM" is also incorrect in Fortran-77 (a simple "END" is required).

François Jacq

RE: fortran compiler error!

I suggest to try the option ffree-form

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close