To mix f77 and f90 object binaries, link with f90 and the f77 compatibility library, libf77compat, and not with libF77. For example, perform the link step with
f90 ..files.. -lf77compat
even if the main program is an f77 program.
Example: f90 main and f77 subroutine.
demo% cat m.f90 CHARACTER*74 :: c = 'This is a test.' CALL echo1( c ) END demo$ cat s.f SUBROUTINE echo1( a ) CHARACTER*74 a PRINT*, a RETURN END demo% f77 -c -silent s.f demo% f90 m.f90 s.o -lf77compat demo% a.out This is a test. demo%
The FORTRAN 77 library is generally compatible with f90.
Example: f90 main calls a routine from the FORTRAN 77 library.
demo% cat tdtime.f90 REAL e, dtime, t(2) e = dtime( t ) DO i = 1, 100000 as = as + cos(sqrt(float(i))) END DO e = dtime( t ) PRINT *, 'elapsed:', e, ', user:', t(1), ', sys:', t(2) END demo% f90 tdtime.f90 demo% a.out elapsed: 0.14 , user: 0.14 , sys: 0.0E+0 demo%
See dtime(3F).