Re: why doesn't this compile ?



In article <1114673665.233497@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bart Vandewoestyne <MyFirstName.MyLastName@xxxxxxxxxx> wrote:


> Just for your information, and not requesting you to give comments on it
> if you're in grump mode ;-)

I'm better now. :-)

> This was the original example:
>
> http://www.cs.kuleuven.ac.be/~bartv/downloads/test_array_arguments_02.f95

Interesting. This is a variant of an issue that is addressed (with a
quite simple fix) in f2003. I had not seen quite this variant, with
internal procedures, but still it is recognizable as a variant of the
same thing.

Up though f95, there are 2 options for specifying a specific procedure
in a generic interface block. 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.

In f2003, this is solved by dropping the keyword "module" from the
module procedure statement. The restriction to module procedures was
silly in the first place; the only thing important was that an explicit
interface be accessible. Of course, the keyword "module" is still
allowed for compatibility with existing code (and in that case, it is
restricted to being a module procedure just because it is strange to
have a "module procedure" statement refer to something that isn't). But
there will probably be little reason for using the "module" keyword in
new f2003 code except for issues of compatibility with f90/f95
compilers; it doesn't add any useful functionality.

--
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: 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)
  • Re: generic interface question
    ... END INTERFACE ... Cannot change attributes of USE-associated symbol 'foo1' at ... the critical bit here is that foo1 is *NOT* a module procedure. ... Or put a generic interface block for foo in module a, ...
    (comp.lang.fortran)