Intel fortran-80 Laptop User Manual


 
CHAPTER 2
FORTRAN
CONCEPTS
The
chapter discusses the concepts
and
terminology used to describe the structure
and
elements
of
a
FORTRAN
program.
2.1
FORTRAN Program Structure
2.1.1 Program U nits and Procedures
The
scope
of
many
FORTRAN
operations
is
defined to be a program unit. A pro-
gram
unit
is
either a main program
or
a subprogram.
A main program can start with a
PROGRAM
statement, though it need not. Sub-
programs start with either a
FUNCTION,
SUBROUTINE,
or
BLOCK
DATA
state-
ment. A
FORTRAN
program
must have one
and
only one main program
and
may
have any
number
of
subprograms
(Figure 2-1).
Subroutines
and
functions are called procedures. Subroutines
and
'external'
func-
tions are further defined to be
external procedures. External procedures can be
created outside a
FORTRAN
program also; for example, a
FORTRAN
program can
call
an
external procedure written in
PL/M-80
and
stored in
an
ISIS-II system
library. Procedures are discussed in detail in
Chapter
5.
MAIN
PROGRAM
[PROGRAM]
END
SUBPROGRAMS
SUBROUTINE
J
P-'S~UB=R=OU=T=IN=E
FEN:
• •
END
FUNCTION
J
FUNCTION
..
..
END
END
,...
1-
BLOCK
DATA
J
BLOCK
DATA
~
• •
END
END
-
f'
~
'-----"
MISC.
EXTERNAL
PRO-
CEDURES
~
Fig.
2-1
Program Units
2-1