> The only thing that comes to mind is to pass the user supplied procedure =
> as a
> dummy argument. For example:
>
> SUBROUTINE A( B )
> INTERFACE
> SUBROUTINE B( ... )
> ! USE modules req'd for B's arguments
> ! Declare other arguments
> END SUBROUTINE B
> END INTERFACE
>
> ! rest of A ...
>
> END SUBROUTINE A
>
> As long as B always has the same type of interface, A can be called from
> some wrapper routine with different B modules.
The problem with this approach, while it might me "made" to "work", is
that since the user-supplied routine might not even be written when A is
compiled, no sort of COMPILE-TIME automatic checking is possible
(presumably this is the reason for not using an EXTERNAL procedure).
Again, if the interface were specified separately from the
implementation (the interface, in some sense, has to be known to the
writer of A before it is compiled), and if later, when B is compiled, it
is forced to conform to this interface, then things would work as
desired.
Perhaps INCLUDE is the answer. One could specify the routine with an
interface which is INCLUDEd and use this later when B is compiled. I
have some notes on this approach somewhere....
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|