While we are on the subject of modules...



.... is there a solution to the following problem ?

I want a module that contains

1) INTERFACE OPERATOR and INTERFACE ASSIGNMENT statements

and

2) The corresponding FUNCTIONs and SUBROUTINEs

However, there is a catch, if I just use:

MODULE LESS
C
INTERFACE OPERATOR ( + )
MODULE PROCEDURE PLUS
END INTERFACE
C
CONTAINS
C
FUNCTION PLUS ( X,Y )
etc.
END FUNCTION
C
END MODULE

Then the FUNCTION PLUS will itself be subject to the INTERFACE OPERATOR
statement.


Now I know that this example is simplistic, and possibly illegal, but
in the more general case with many INTERFACE OPERATOR and INTERFACE
ASSIGNMENT statements, a genuine problem arises (For example code for
arrays accessing code for scalars).

My guess is somehow to use multiple modules accessed in a hierarchical
manner, but exactly how ?

I would add that all the module procedures are moved elsewhere, my
program works.

Thanks in advance

Dave Flower

.



Relevant Pages

  • Re: Cray pointers and gfortran
    ... written scanner/parser. ... end interface operator ... MODULE PROCEDURE Compare_Float_Single ... I haven't seen a bug report with this type of error message, ...
    (comp.lang.fortran)
  • Re: While we are on the subject of modules...
    ... David Flower wrote: ... | Then the FUNCTION PLUS will itself be subject to the INTERFACE OPERATOR ...
    (comp.lang.fortran)