Hello,
I was just going through a Fortran 90 module for the graphics library
DISLIN (http://www.linmpi.mpg.de/dislin/) and noticed that whoever wrote
it declared arrays as assumed-shape (:,:), even though the routines rely
on sequence association and are F77-based. This is obviously wrong for a
general Fortran 90 compiler, even though apparently nobody had any
problems with it so far.
I program in HPF, where there is a (in my modest opinion) a much better
EXTRINSIC(LANGUAGE="FORTRAN"...) interface to F77, so I was not sure
what the best way to change the interfaces is:
Do I use explicit-shape arrays (which as I am reading my Fortran 95
books do not have a requirment on sequence association?):
interface
subroutine plot(x,...,n,m)
integer :: n,m
real, dimension(n,m) :: x
...
end subroutine plot
end interface
Or the more F77 safe assumed-size:
interface
subroutine plot(x,...,n,m)
integer :: n,m
real, dimension(n,*) :: x
...
end subroutine plot
end interface
I don't want to make the compiler be too conservative and always do
copy-in for array arguments (I am not sure how smart they are these days
for this), but I don't want to get errors when calling this with
array-sections either.
Thanks,
Aleksandar
--
_____________________________________________
Aleksandar Donev
[log in to unmask]
http://www.pa.msu.edu/~donev/
Department of Physics and Astronomy
Michigan State University
East Lansing, MI 48825
(517) 432-6770
_____________________________________________
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|