Re: Does F90 do type checking when calling module subroutines?



In article <pan.2005.04.26.08.34.06.212774@xxxxxxxxxxxxxxxxxxxxxx>,
Neilen Marais <junkmail@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Now I have learnt that f90 by
> default makes an implicit function call if it can't find an interface. So
> misspelled function / subroutine calls only get caught at link time. Is
> this correct?

Yes, that is correct. That's what I was referring to when I said I
wished there were an equivalent to "implicit none" for interfaces.

You do tend to get an error from this at link time, though, so not all
is lost. It is just that compile time would be better and clearer. The
"link name" of a module procedure is different from that of an external
procedure - it has to be so because it is legal to have an external
procedure and a module procedure of the same name (and, in fact,
multiple module procedures of the same name in different modules). I
wouldn't advise having such an external procedure, but it is allowed, so
the compiler has to have a way to distinguish it.

Generally, you will see a "link name" of an external procedure will have
something like an underscore added to the end (details and fine points
vary), while the "link name" of a module procedure will have both the
module name and the procedure name conflated somehow.

--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.



Relevant Pages

  • Re: Fortran 2003
    ... subroutine seti_interface ... end interface ... Don't write an interface body for a module procedure. ... external procedure, but the external procedure has the same name as the ...
    (comp.lang.fortran)
  • Re: why doesnt this compile ?
    ... You either have an interface body or use a module procedure statement. ... If you have a procedure whose interface is already explicit, but which is not a module procedure, then this is awkward. ... "module procedure" in the main program is a compiler *extension*, ...
    (comp.lang.fortran)
  • Re: Interface declarations
    ... That is much stronger than being redundant. ... say in the main program - is an interface declaration. ... MODULE PROCEDURE xyz ... SUBROUTINE xyz ...
    (comp.lang.fortran)
  • Re: Vector Algebra Module
    ... transformations, projections, and least squares solutions ... cartesian coordinates, but for determining the interference pattern ... interface operator ... module procedure rotate_3d_point ...
    (comp.lang.fortran)
  • Re: Interface declarations
    ... MODULE PROCEDURE flux_godunov ... This is one of that kind of interface block. ... I haven't yet mentioned the extra oddity in this particular case. ... I personally regard that as very confusing. ...
    (comp.lang.fortran)