Member Login

Remember Me
Forgot Password?
Join Us!

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!

Join Tek-Tips
*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 from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

fortran compiler error!

fortran compiler error!

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

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

pls what am i suppose to do?


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

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!


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