Re: Calling Fortran 77 from Fortran 95

On 6 Mar, 19:48, n...@xxxxxxxxx wrote:

Mark it BIND(C).  In all compilers I know of, it will happen, anyway.
But why do you want to?  If you want to call C, you should use
the C interoperability features.  If not, your program can't tell.

Say I have a F77 package called LAPACK. (Vendor supplied, not one I
can build with my F95 compiler.)

Obviously I don't want the F95 compiler to pass a dope array to F77.
So I want to prevent that.

Then there is the question of the leading dimension, e.g. LDA and LDB
arguments. An F95 compiler can do copy-in copy-out, but then I have no
idea what the leading dimension is. The leading dimension might be
contiguous or it might not.

real :: X(100,4)

X(1:10,:) ! whats the leading dimension of this? 10 or 100?

C gives me full control of this, but in F95 it seems I can just depend
on the F95 compiler to do whatever it wants. The principle of "it just
works" usually depends on the same compiler being used to build