Running a f90 code in f77 compiler

Click For Summary
SUMMARY

Running Fortran 90 (f90) code in a Fortran 77 (f77) compiler requires specific modifications to the code structure. Each line of code must be shifted to start at the 7th column to comply with f77 formatting. Additionally, f90 intrinsic functions, such as MATMUL(A,B) for matrix multiplication, must be rewritten in f77 syntax, typically using nested DO-loops or custom functions. The complexity of these changes increases with the size of the codebase, particularly if it exceeds 1,000 lines.

PREREQUISITES
  • Understanding of Fortran 90 and Fortran 77 syntax
  • Familiarity with intrinsic functions in Fortran
  • Knowledge of code formatting requirements for Fortran compilers
  • Experience with debugging compiler error messages
NEXT STEPS
  • Research how to rewrite Fortran 90 intrinsic functions in Fortran 77 syntax
  • Learn about the differences between fixed-form and free-form source code in Fortran
  • Explore tools for converting Fortran 90 code to Fortran 77
  • Investigate best practices for debugging Fortran compiler errors
USEFUL FOR

Fortran developers, software engineers transitioning legacy code, and anyone involved in maintaining or converting Fortran applications.

vissu219
Messages
3
Reaction score
0
heys..can anyone tell me..how could i run f90 codes in an f77 compiler..wht changes in the code do i need to make to do that?
 
Technology news on Phys.org
Have you tried running it through the compiler to see what error messages it generates?
 
no.. but i figured out that.. i have to move each line of code such that it starts at the 7th column to run in f77 compiler..i don't know wht other changes to be made
 
It will be a lot of work, other than the shifting of all of the lines of code to appropriate position, f90 intrinsic functions will have to be rewritten in f77 syntax, the first that comes to mind is MATMUL(A,B) which is a matrix multiplication routine. It will become a set of nested DO-loops, unless you write a function, then you only have to do it once, but there are others to look for and the compiler will find them for you.
 
Is the f90 source in freeform format? (i.e. not tabbed out to column 7).

Does the f77 compiler support freeform?

How much code is there? 1k lines, 10k, 100k? or more?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 29 ·
Replies
29
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
8
Views
4K
  • · Replies 34 ·
2
Replies
34
Views
5K
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
2K
Replies
7
Views
3K
Replies
4
Views
5K