11.07.2015 Views

Fortran 90 Handbook

Fortran 90 Handbook

Fortran 90 Handbook

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Program Units 11There are several kinds of executable and nonexecutable program units in<strong>Fortran</strong>. Each of these program units provides unique functionality. Theexecutable program units are the main program and procedure subprograms;the nonexecutable program units are block data units, which are noweffectively obsolescent, and modules, which provide definitions used by otherprogram units. This chapter describes each of these as well as the closelyrelated concepts of host association and use association. Only one of theseprogram units—the module—is new in <strong>Fortran</strong> <strong>90</strong>, although internalprocedures, which are procedure subprograms, represent a significant additionto the executable program units. A section on the major uses of modules isincluded.A complete <strong>Fortran</strong> program might be compared to a complete meal. There area number of parts to a meal—the main course, salad, dessert, etc. Each coursehas a specific part in the meal, just like each program unit (main program,subroutine, etc.) plays a specific part in a complete program. The parts worktogether, and in a well-planned program, as with a well-designed meal, the netresult is something analogous to the whole being greater than the sum of itsparts.11.1 OverviewA <strong>Fortran</strong> program is a collection of program units. One and only one of theseunits must be a main program. In all but the simplest programs, the individualtasks are typically organized into a collection of function and subroutinesubprograms and module program units. The program may be organized so483Copyright © 1992 J. Adams, W. Brainerd, J. Martin, B. Smith, and J. Wagener

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!