Fast connection between fortran 77 and 90

  • Context: Fortran 
  • Thread starter Thread starter querky
  • Start date Start date
  • Tags Tags
    Connection Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 replies · 3K views
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:
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