>>>>> Jörg Stiller writes:
Jörg> Hello,
Jörg> I am working on a library module (A), which makes uses of an
Jörg> user supplied procedure (P) which, preferably, is placed in
Jörg> another module (B). In particular, it should be possible to
Jörg> compile A without knowing the body of B. However, a rudimental
Jörg> version of B containing a dummy for P could be supplied.
Jörg> Is there a legal way to do this in Fortran 95?
Jörg> If not, what is the "textbook solution" for this problem?
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.
Does this work for you?
--
Ted Stern Porting/Tuning/Analysis, Applications & Libraries
Cray Inc. http://www.cray.com
411 First Avenue South, Suite 600 Direct 206-701-2182, Main 206-701-2000
Seattle, WA 98104-2860 FAX 206-701-2500
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|