Intel fortran-80 manual Chapter Defining Variables Arrays, And Memory, 3.1Type Statements

Models: fortran-80

1 130
Download 130 pages 742 b
Page 27
Image 27
CHAPTER 3

CHAPTER 3

DEFINING VARIABLES,

ARRAYS, AND MEMORY

This chapter describes the statements used to specify the types and lengths associated with symbolic names, how to assign values to these symbols, .how to structure memory, and how to assign values to a block of memory. The statements described are:

Type statements: REAL, INTEGER, LOGICAL, CHARACTER, IMPLICIT

Array definition statement: DIMENSION

Assignment statements: arithmetic, logical, and character assignment,

ASSIGN, DATA

Memory definition statements: COMMON , EQUIVALENCE, BLOCK DATA

3.1Type Statements

The type statements REAL, INTEGER, LOGICAL, and CHARACTER are used to confirm or override the type implied by a symbolic name (i.e., the convention that names beginning with the letters I-N refer to integers-Section 2.2.2.1). The conven- tion itself can be confirmed or changed by the IMPLICIT statement.

Type statements can also specify data length pr array dimension information.

Specifying the symbolic name of a variable, array, external function, or statement function in a type statement establishes the type of that name for all appearances in the program unit. The type of a name cannot be specified explicitly more than once in a program unit. Program names and subroutine names cannot appear in a type statement.

3.1.1 REAL Type Statement

The REAL type statement has the format:

REAL name [,name] ...

where 'name' is the symbolic name of a real variable, array, array declarator, func- tion, or dummy procedure.

Examples:

REAL TEMP

REAL NUMB1, NUMB2, NUMB3

C REAL OVERRIDES IMPLICITTYPING OF NUMB=INTEGER

3.1.2 INTEGER Type Statement

The INTEGER type statement has the format:

INTEG ER.fm!@ti£;l) name [,name] ...

3-1

Page 27
Image 27
Intel fortran-80 Chapter Defining Variables Arrays, And Memory, 3.1Type Statements, REAL Type Statement, REAL name ,name