Defining Variables, Arrays, And Memory

FORTRAN-80

where 'nlist' is a list of variable names, array names or array element names. The lat- ter may only be subscripted by integer constants. The use of an array name un- qualified by a subscript is the same as a reference to the first element of the array. Function names and the names of dummy arguments may not be listed.

Equivalenced items may have different data types, although this is not recommend- ed. The EQUIV ALENCE statement does no type conversion.

Example:

INTEGER* 1, ARRAY(3), LlST(6)

REAL FPNUMB

EQUIVALENCE (ARRAY,LlST), (LlST(4),FPNUMB)

The resulting memory allocation would be:

ARRAY

I A(1)

I

A(2)

I

A(3)

I

 

 

 

 

 

 

 

 

 

 

LIST

L(1)

I

L(2)

I

L(3)

I L(4) I L(S)

I L(6) I

 

 

 

 

 

 

 

 

FPNUMB

 

 

 

 

 

I LOW I

I HIGH I

 

 

 

 

 

 

 

 

The EQUIV ALENCE statement must not cause the same storage item to occur more than once in a memory sequence, nor can it result in the splitting of a memory se- quence.

Examples:

C THE FOLLOWING EXAMPLES ARE INVALID DIMENSION ARRAY(3)

EQUIVALENCE (ARRAY(1),FPNUM B),(ARRAY(2),FPNUMB)

CFPNUMB OCCURS MORE THAN ONCE IN MEMORY SEQUENCE REAL TABLE(2), ROOTS(3)

EQU IVALENCE (TABLE(1), ROOTS(1 )),(TABLE(2), &ROOTS(3))

CMEMORY SEQUENCE IS SPLIT

3.4.2COMMON Statement

Common memory blocks allow data and memory to be shared throughout an entire program. The COMMON statement defines common blocks that may be either named or unnamed (that is, 'blank').

The format of the COMMON statement is:

COMMON [/[eb]!] nlist [[,]/ [eb]! nlist] ...

where

cbis the name of a common block.

nlist is a list of variable names, array names, or array declarators. Function names and the names of dummy arguments cannot be listed.

3-12

Page 38
Image 38
Intel fortran-80 manual Common Statement, Real Fpnumb, Array List, Common /eb! nlist ,/ eb! nlist