Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calling f90 subroutine from f77

201 views
Skip to first unread message

isaac

unread,
Apr 26, 2010, 6:36:53 AM4/26/10
to david...@gmail.com
is it possible to call F90 subroutine from a f77 code..??

Arjen Markus

unread,
Apr 26, 2010, 7:26:43 AM4/26/10
to
On 26 apr, 12:36, isaac <davidbh...@gmail.com> wrote:
> is it possible to call F90 subroutine from a f77 code..??

Yes, but you need to compile everything with a Fortran 90 compiler.
Which esentially turns the question into a trivial one: Almost all
FORTRAN 77 code is valid Fortran 90.
So if you compile the various source files with a Fortran 90 compiler,
there is no
problem whatsoever.

But perhaps you have something else in mind?

Regards,

Arjen

Dick Hendrickson

unread,
Apr 26, 2010, 11:34:11 AM4/26/10
to

Arjen's answer is correct. But, if by "F90 subroutine" you
mean a subroutine that uses some of the new F90 features, such
as assumed shape arrays, then the F90 subroutine will need an
explicit interface. The only practical way to get an interface
is to put the F90 subroutine in a module and USE it from the
f77 code. This effectively turns the f77 code into F90 code.

If the F90 routine doesn't use any of the new features, then
you don't need an interface. But, if you are going to use
some F90 subroutines, then you might as well go all the way
and convert your f77 code into F90. It's essentially trivial
to start using modules and then you will get the benefit of
enhanced error checking for subroutine calls.

Dick Hendrickson


robin

unread,
Apr 26, 2010, 8:22:42 PM4/26/10
to
"isaac" <david...@gmail.com> wrote in message
news:0d4f01ad-cbd9-4de8...@b39g2000prd.googlegroups.com...

| is it possible to call F90 subroutine from a f77 code..??

Depends if you are using an F77 compiler or an F90 compiler.


robert....@oracle.com

unread,
Apr 27, 2010, 3:19:32 AM4/27/10
to
On Apr 26, 3:36 am, isaac <davidbh...@gmail.com> wrote:
> is it possible to call F90 subroutine from a f77 code..??

It depends on the compilers used. In general, mixing
codes compiled with different Fortran compilers does
not work because of differences in the associated
run-time systems. Some Fortran 90/95/2003 compilers
are compatible with earlier FORTRAN 77 compilers.

Robert Corbett

0 new messages