Fortran Fast connection between fortran 77 and 90

AI Thread Summary
Integrating Fortran 77 with Fortran 90 can be challenging, particularly when trying to implement functionality from Fortran 90 into an existing Fortran 77 program. It is possible to call Fortran 77 subroutines from Fortran 90 using the 'call' statement, although calling Fortran 77 functions requires rewriting them as subroutines. Directly calling Fortran 90 code from Fortran 77 is not feasible. To compile both versions of the code, a compatible compiler like gfortran is necessary. The use of COMMON blocks in Fortran 77 and MODULE statements in Fortran 90 for data sharing is a consideration, but concerns about performance with I/O interfaces suggest that this may not be the most efficient approach.
querky
Messages
1
Reaction score
0
Hi!

I'm having kind of a "little" problem. I got an old program written in Fortran77 and I want to implement some functionality from Fortran90 routines. The routines are quite long, so I'm not able to rewrite them in F77...

Is there a possibility to connect the routines so that they can communicate (exchange variable values) in a fast way.

I have though about the COMMON Blocks of F77 and the MODULE Statements in F90. Is there a way of connecting these data structures in a way, that a F90 program can read a F77 COMMON Block. (I though about a I/O-interface but I think this is too slow)

Thanks for your help!
 
Last edited:
Technology news on Phys.org
Hey

The connection between Fortran 77 and Fortran 90 is in my opinion a bit tricky. I have myself succeeded to call Fortran 77 subroutines from Fortran 95 (I assume it works in Fortran 90 also) by using the 'call' statement. I have not succeed to call the Fortran 77 functions but I had to rewrite them as subroutines instead. I don't think it is possible to call Fortran 90 code from Fortran 77. To compile the code I think you need a compiler which is able to compile both Fortran 77 and Fortran 90 code, e.g. gfortran
I hope this helps
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
3
Views
5K
Replies
34
Views
4K
Replies
8
Views
6K
Replies
8
Views
4K
Replies
3
Views
2K
Replies
21
Views
3K
Replies
1
Views
2K
Back
Top