Re: Passing module procedures to external procedures -- type issues
  Home FAQ Contact Sign in
comp.lang.fortran only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Passing module procedures to external procedures -- type issues         

Group: comp.lang.fortran · Group Profile
Author: glen herrmannsfeldt
Date: Sep 19, 2008 21:15

Rich Townsend wrote:
> module foo
> implicit none
> contains
> subroutine main_sub
> call internal_sub()
> contains
> subroutine internal_sub()
> call QAG(other_sub)
> end subroutine internal_sub
> end subroutine main_sub
> subroutine other_sub ()
> end subroutine other_sub
> end module foo

No error from g95, either.
> This compiles fine with Intel Fortran (Linux), but on gfortran 4.3.1, I
> get the following error:
> Error: Symbol 'other_sub' at (1) has no IMPLICIT type

Would it be happier with an EXTERNAL statement
for other_sub?
> I don't really understand what this error message means; surely, the
> other_sub name uniquely identifies a subroutine throughout the whole
> module? Is my code standard conforming or not?

Some languages have rules that names have to be defined
before they are used. I believe Fortran doesn't, but
you can imagine with a large number of statements in those
subroutines that the compiler wouldn't find out for a
long time that other_sub is the name of a subroutine.

-- glen
no comments
diggit! del.icio.us! reddit!