> I tried the following with two compilers, and it didn't work. I
> think it ought to.
> ==========================================================================
> module m1
> interface foo
> module procedure foo
> end interface
>
> private
>
> contains
> subroutine foo ( x )
> real x
> x = 0.0
> return
> end subroutine foo
>
> end module m1
>
> module m2
> interface foo
> module procedure foo
> end interface
>
> private
>
> contains
> subroutine foo ( x )
> double precision x
> x = 0.0d0
> return
> end subroutine foo
>
> end module m2
Maybe I've really misunderstood what you're trying to do, but for a
generic interface one usually has the routines having different names
than the interface, such as real_foo and double_foo for the interface
foo, then have these routines in the same module and the procedure names
in the same interface. Then you CALL FOO and, depending on the data
type of the argument, one or the other routine is selected, the idea
being that it behaves like an intrinsic procedure, where SQRT implicitly
calls DSQRT if the argument is DOUBLE PRECISION and so on.
Or have I completely missed something?
--
Phillip Helbig Email ... [log in to unmask]
Nuffield Radio Astronomy Laboratories Tel. ..... +44 1477 571 321 (ext. 297)
Jodrell Bank Fax ................. +44 1477 571 618
Macclesfield Telex ................. 36149 JODREL G
UK-Cheshire SK11 9DL Web .... http://www.jb.man.ac.uk/~pjh/
My opinions are not necessarily those of NRAL or the University of Manchester.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|