At 16:08 22-09-98 +0200, you wrote:
>Compiling the following Fortran90 program
>with HP Fortran90 V1 and Mips Pro Fortran90 7.20
>gives an error :
>
>% cat generic.f90
>
>module trygen
> implicit none
> real, public :: r
> public :: subr
> private :: subr1, subr2
> interface subr
> module procedure subr1, subr2
> end interface
>
>contains
>
>subroutine subr1(proc)
>interface
> function proc(intarg)
> integer :: proc
> integer, intent(in) :: intarg
> end function proc
>end interface
>r = proc(12)
>end subroutine subr1
>
>subroutine subr2(proc)
>interface
> function proc(realarg)
> real :: proc
> real, intent(in) :: realarg
> end function proc
>end interface
>r = proc(14.0)
>end subroutine subr2
>
>end module trygen
>
>program try_gen
>
> use trygen
> interface
> integer function fi(i)
> integer :: i
> end function fi
> real function fr(r)
> real :: r
> end function fr
> end interface
> call subr(fi)
> print *, r
> call subr(fr)
> print *, r
>end program try_gen
>integer function fi(i)
> fi = 2 * i
>end function fi
>real function fr(r)
> fr = 3.141596 * r
>end function fr
I did a quick test.
Using Salford FTN95 the programme compiles and links without errors.
BUT gives output
24.000
and then Floating point stack error, whatever that may be.
Second, Absoft F90 gives same error mesages as yours;
D:\FORTRAN\DIV>f90 generic.f90 > g.txt
cf90-855 error on line 3 of generic.f90: The compiler has detected errors
in mod
ule "TRYGEN". No module information file will be created for this module.
cf90-487 error on line 9 of generic.f90: The specific interfaces for
"SUBR2" and
"SUBR1" make the GENERIC interface "SUBR" ambiguous.
cf90-894 error on line 38 of generic.f90: Module "TRYGEN" has compile
errors, th
erefore declarations obtained from the module via the USE statement may be
incom
plete.
f90: Copyright Absoft Corporation 1994-1997 Version 1.01; Cray Research,
Inc. 19
94-1996 CF90 (2.x.x.x f36t87) Tue Sep 22, 1998 16:34:23
f90fe: Compile time 0.600000 seconds
f90fe: Maximum field length 0 decimal words
f90fe: 60 source lines
f90fe: 3 Errors, 0 Warnings, 0 Other messages, 0 ANSI
f90fe: CODE: 0 words, DATA: 0 words
At first sight I don't see a standard violation in the programme, but
I have no time now to study this in depth.
---
Meilleures Salutations,
Best Greetings,
/---
Jan van Oosterwijk
Computing Centre
Delft University of Technology
Postbus 354
2600 AJ Delft
Netherlands / Pays Bas
Phone: +31 15 278 50 17
Fax: +31 15 278 37 87
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|