Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with compiling Fortran Legacy code

Status
Not open for further replies.

Scarletttt

Programmer
Apr 29, 2020
1
US


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:

IF (REENT) THEN REENT = .FALSE. GO TO ROUTE END IF

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.
 
ROUTE has not been set. Look for the statement
Code:
ASSIGN xxx TO ROUTE

You need to work out why that was not executed. If that is being executed,
[ul]
[li]Is it in the same routine[/li]
[li]If same routine, is there an array before it - is that array overrunning its bounds[/li]
[li]If different routine, is it in a common block[/li]
[li]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[/li]
[/ul]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top