Intel fortran-80 manual Fen:• • • •

Models: fortran-80

1 130
Download 130 pages 742 b
Page 13
Image 13
FEN:• • • •

CHAPTER 2

FORTRAN CONCEPTS

The chapter discusses the concepts and terminology used to describe the structure and elements of a FORTRAN program.

2.1FORTRAN Program Structure

2.1.1Program Units 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-80and stored in an ISIS-II system library. Procedures are discussed in detail in Chapter 5.

MAIN

PROGRAM

[PROGRAM]

END

SUBPROGRAMS

SUBROUTINEJ

P-'S~UB=R=OU=T=IN=E

FEN:• •

 

 

 

 

 

 

 

 

 

 

 

 

 

END

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FUNCTION

 

 

 

 

 

 

J

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FUNCTION

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

..

 

..

 

 

 

 

 

 

 

 

 

 

END

 

 

 

 

 

 

,...

 

1 -

 

 

 

 

 

 

 

 

 

 

 

END

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BLOCK DATA

 

 

 

 

J

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BLOCK DATA

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

~

 

 

 

 

 

 

 

 

 

 

 

 

END

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

END

 

 

 

 

 

 

f'-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

~

 

 

 

 

 

 

 

 

 

 

 

 

 

'-----"

 

 

 

 

 

 

 

 

 

 

 

 

MISC.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

EXTERNAL

 

 

 

 

 

 

 

 

 

 

 

 

PRO-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CEDURES

 

 

 

 

 

 

 

 

 

 

 

~

Fig. 2-1Program Units

2-1

Page 13
Image 13
Intel fortran-80 manual Fen:• • • •