Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Annonces
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Interfaces

JohnNichols
Précieux contributeur III
1 131 Visites

I am using a lot more modules for data, and the subroutines,  is it a good idea to always use interfaces?

Just checking.

0 Compliments
5 Réponses
FortranFan
Contributeur émérite III
1 116 Visites

Re "is it a good idea to always use interfaces?" - yes, absolutely.

0 Compliments
mecej4
Contributeur émérite III
1 107 Visites

When subroutines and functions in a module are accessed by USE <module_name> in a "consumer" of that module, an interface is already available, so there is no need to provide an interface block. Similarly, any procedure that is in a module has interfaces for other procedures in that module without your having to write interface blocks.

0 Compliments
Steve_Lionel
Contributeur émérite III
1 077 Visites

My position is that, with a couple of exceptions, if you're writing an interface block for a Fortran procedure in your own application, you're doing it wrong. Exceptions are declarations of generic procedures and when using submodules. Otherwise, your procedures should be in modules (or contained), in which case, as @mecej4 says, you get the explicit interface automatically.

I have written about interfaces twice: Doctor Fortran Gets Explicit! and Doctor Fortran Gets Explicit – Again!

0 Compliments
JohnNichols
Précieux contributeur III
1 069 Visites
0 Compliments
JohnNichols
Précieux contributeur III
1 063 Visites

Some unspecified AT&T weenie

-------------------------------------------------------------------

Found in a file from an internet source, quite disturbing in a way 

0 Compliments
Répondre