Contact US

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.

Students Click Here

Help with compiling Fortran Legacy code

Help with compiling Fortran Legacy code

Help with compiling Fortran Legacy code


The code that I am working with was originally written in FORTRAN 77. I am hesitant to update all of the files to a more modern standard since there are multiple files thousands of lines long that rely on obsolete functions.

During compilation, I get a few type mismatch arguments, most of which are taken care of with -freal-4-real-8, but I am unsure if that is a permanent solution.

I currently use the following flags to compile all of the object files which are then compiled into the final executable: -ff2c -std=legacy -freal-4-real-8

The file in which the error occurs is compiled without the -freal flag because it uses a function that requires a real(4) variable.

The current error I am getting upon running the executable is: At line 2680 of file twopt.f Fortran runtime error: Assigned label is not a target label

The subroutine in which the error occurs takes in REENT as a logical parameter. ROUTE is later declared as an integer but is not assigned any value which I think might be the reason behind the problem. I used print statements to check its value before the error occurs, and REENT is true, and ROUTE is 0.

Code at lines 2678-2681:


In the subroutine there is no statement label with the value of 0 which also might contribute to the error. Again, I am hesitant to edit the code too much since it supposedly worked as intended back in the ‘90s. Any help would be greatly appreciated.

RE: Help with compiling Fortran Legacy code

ROUTE has not been set. Look for the statement



You need to work out why that was not executed. If that is being executed,
  • Is it in the same routine
  • If same routine, is there an array before it - is that array overrunning its bounds
  • If different routine, is it in a common block
  • If in a common block, are all the blocks where ROUTE is declared in the same order and are all the variables before ROUTE declared correctly

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! Already a Member? Login

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