Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 Discussions

Generic subroutine interface and individual subroutine interface

OP1
New Contributor III
388 Views

I want to create a library of subroutines. In this library I define the subroutines SUB_1, SUB_2, SUB_3, as well as a genericinterface name SUBfor these three subroutines (this interface definition being made in a user-accessible module).

I want the user to be able to call either the generic subroutine SUB,or any of the individual computational subroutines SUB_xx (directly). Should I also include individual interfaces for each of the SUB_xx subroutines in the module mentionned above(knowing that these interfaces are already declared in the generic interface definition of SUB - it seems a bit redondant) ?

Thanks,

Olivier

0 Kudos
2 Replies
Steven_L_Intel1
Employee
388 Views

The interfaces to the specific routines (SUB_1, etc.) are already declared. You don't need to do it again. The caller can call either the generic or any of the specifics, as long as those names are not PRIVATE.

Steve

0 Kudos
OP1
New Contributor III
388 Views
Thanks Steve!
O.

0 Kudos
Reply