Intel fortran-80 manual 3.3.5DATA Statement, ASSIGN stlTO name, r*c,r*c

Models: fortran-80

1 130
Download 130 pages 742 b
Page 36
Image 36
ASSIGN stlTO name

Defining Variables, Arrays, And Memory

FORTRAN-80

The ASSIGN statement has the format:

ASSIGN stlTO name

where

stlis a statement label (1-5 digits)

name is an integer variable name

The statement label must be the label of an executable statement or a FORMA T statement in the same program unit as the ASSIGN statement. The variable 'name' must not be declared as length INTEGER*1.

An integer variable defined with a statement label value may be redefined with the same or a different statement label value, as well as with an integer value.

Examples:

ASSIGN 1010 TO LOOP1

GOTO LOOP1

GO TO LOOP1(1000, 1010, 1020)

IF(.NOT.DONE) THEN

ASSIGN 20 TO WRFORM

ELSE

ASSIGN 25 TO WRFORM

ENDIF

WRITE (6,WRFORM) PNAME, AVG

20FORMAT.. .

25FORMAT...

3.3.5DATA Statement

The DATA statement gives the initial values of variables, arrays, and array clements. Dummy arguments and functions cannot be initialized by DATA. Shared, or 'common,' memory can be initialized by DATA statements if the DATA statements are part of a BLOCK DATA subprogram (section 3.4.3).

The DATA statement must appear in a program unit after the specification statements and before any statement function or executable statements.

The DATA statement has the format:

DATA nlist felistl [[,] nlist felistl] ...

where 'nlist' is a list of variable names, array names, and array element names, and 'clist' has the form:

[r*]c[,[r*]c] ...

where

cis a constant (including a Hollerith constant)

ris a 'repeat' character and is a nonzero, unsigned, integer constant; 'r*c' is equivalent to Or' successive repetitions of the constant 'c.'

3-10

Page 36
Image 36
Intel fortran-80 manual 3.3.5DATA Statement, ASSIGN stlTO name, r*c,r*c