Internal vs External Subprograms

Fortran functions and subroutines can be internal (part of another subprogram) or external (separate from all other subprograms).

Internal subprograms are not independent from the subprogram that contains them, and therefore don't do much to make the program modular and reduce debugging effort. They share variables with the subprogram that contains them and can only be called by the subprogram that contains them. They reduce typing time in exchange for increased debugging time and decreased reusability, which is usually a bad tradeoff.

External subprograms are completely independent from other subprograms. They can be written and debugged separately and even placed in a library for use by other programs.

All subprogram examples in this text will be external.

The C language does not support internal subprograms.