Re: generic interface real function vs real
- From: Herman D. Knoble <SkipKnobleLESS@xxxxxxxxxxxxxxx>
- Date: Thu, 17 Apr 2008 08:37:20 -0400
Have you tried overloading (on arg type) ?
Skip Knoble
On Wed, 16 Apr 2008 15:13:54 -0700 (PDT), mabrowning <mabrowningrr@xxxxxxxxx> wrote:
-|I am trying to create a subroutine that can either take a time
-|dependent function, or a constant.
-|
-|It compiles and runs perfectly with GNU Fortran (GCC) 4.2.3, but ifort
-|(IFORT) 10.0 20070426 complains:
-|
-|fortcom: Warning: generic.f90, line 13: The type/rank/keyword
-|signature for this specific procedure matches another specific
-|procedure that shares the same generic-name. [FOO_SCALAR]
-| SUBROUTINE foo_scalar(A)
-|-------------------^
-|
-|It looks like the function signature and the scalar signature are the
-|same? This doesn't seem to make sense!
-|
-|---------------------------------------------------------------------------
-|example:
-|
-|MODULE foo
-| INTERFACE generic
-| MODULE PROCEDURE foo_fun, foo_scalar
-| END INTERFACE
-|CONTAINS
-| SUBROUTINE foo_fun(f)
-| INTERFACE
-| REAL FUNCTION f(t)
-| REAL t
-| END FUNCTION
-| END INTERFACE
-| WRITE(*,*)f(1.0)
-| END SUBROUTINE
-| SUBROUTINE foo_scalar(A)
-| REAL A
-| WRITE(*,*)A
-| END SUBROUTINE
-|END MODULE
-|
-|PROGRAM main
-|USE foo
-|REAL ::A=1.0
-|REAL, EXTERNAL :: f
-|CALL generic(A)
-|CALL generic(f)
-|END PROGRAM
-|
-|REAL FUNCTION f(t)
-| REAL t
-| f=t
-|END FUNCTION
.
- References:
- generic interface real function vs real
- From: mabrowning
- generic interface real function vs real
- Prev by Date: Re: Fortran templates
- Next by Date: Re: Derived type argument to subroutine
- Previous by thread: Re: generic interface real function vs real
- Next by thread: Derived type argument to subroutine
- Index(es):
Relevant Pages
|