Re: Syntax for passing an external function into a contained function?
- From: "James Giles" <jamesgiles@xxxxxxxxxxxxxxxx>
- Date: Thu, 22 Dec 2005 19:20:51 GMT
ferrad wrote:
....
> subroutine sub1(func)
> real*8 func
> x = func1(n)
> ...
> contains
> real*8 function func1(n)
> func1 = func(n)
> return
> end
....
> The linker fails saying func is an unresolved external in func1 but it
> shouldn't be looking for func, rather ftest which is in the project.
After the line declaring fiunc (REAL*8 isn't standard by the way),
you might add:
EXTERNAL func
Or you might declare func as:
REAL(KIND(0.0d0)),EXTERNAL :: func
--
J. Giles
"I conclude that there are two ways of constructing a software
design: One way is to make it so simple that there are obviously
no deficiencies and the other way is to make it so complicated
that there are no obvious deficiencies." -- C. A. R. Hoare
.
- Follow-Ups:
- References:
- Prev by Date: Syntax for passing an external function into a contained function?
- Next by Date: Re: Int and Real to string *without* using internal I/O?
- Previous by thread: Syntax for passing an external function into a contained function?
- Next by thread: Re: Syntax for passing an external function into a contained function?
- Index(es):
Relevant Pages
|