We have a code that passes pointers. I think the standard requires that
you define an explicit interface for the called routine. Here is a code
fragment. Should the compiler flag an error if an interface is not
declared?
Complex, Pointer, Dimension(:,:) :: pufn
Complex, Pointer, Dimension(:,:) :: pvfn
complex, dimension(idim,2*jj+2,2), target :: w2
pufn =>w2(1:idim, 1: jj ,1)
pvfn =>w2(1:idim, jj+1: 2*jj ,1)
call abc(idim,pufn,pvfn)
Here is abc which is compiled seperately:
subroutine abc(idim,pu,pv)
#include xyz <<jj defined here
complex pu(idim,jj),pv(idim,jj)
Second question, can the interface be declared :
interface
subroutine abc(idim,pu,pv)
integer idim
complex pu(:,:),pv(:,:)
end interface
Jim Abeles
IBM Scientific and Technical Computing
301 879-3283 - work
[log in to unmask]
|