Intel fortran-80 manual File-HandlingStatements, OPEN Statement, Unit Specifier, OPEN open-list

Models: fortran-80

1 130
Download 130 pages 742 b
Page 64
Image 64
6.2 File-Handling Statements

Input/Output

FORTRAN-SO

6.2 File-Handling Statements

6.2.1 OPEN Statement

The OPEN statement can be used to connect an existing file to a unit, create a preconnected file, create a file and connect it to a unit, or change certain specifiers in the file/unit connection.

The format of the OPEN statement is

OPEN (open-list)

where 'open-list' is a list of specifiers separated by commas. The list of specifiers is:

[UNIT =] unit

U nit specifier

IOSTAT = stname

II0 status speci fier

ERR = st/

Error specifier

FilE = fname

File name specifier

STATUS = stat

File status specifier

ACCESS = aee

Access method specifier

FORM = fmat

Formatting specifier

RECl = ree/en

Record length specifier

BLANK = b/nk

Blank specifier

CARRIAGE::::; car

Carriage control specifier

The unit specifier 'unit' must be present and the unit specified must exist. All other specifiers are optional except that the record length (REeL) must be specified if the file is being connected for direct access. Some specifiers have default values.

The following sections 6.2.1.1 through 6.2.1.10 describe each of the 'open-list' specifiers in detail.

6.2.1.1 Unit Specifier

The format of the unit specifier is

[UNIT =] unit

where 'unit' identifies an external unit. If the optional 'UNIT ='is omitted, the unit specifier must be the first item in 'open-list.'

An external unit identifier must be an integer expression whose value is in the range

0:$unit:$255. Examples:

OPEN (UNIT=3)

OPEN (4)

6.2.1.21/0 Status Specifier

The format of the input/ output status specifier is

IOSTAT = stname

where 'stname' is an integer variable or integer array element name.

6-4

Page 64
Image 64
Intel fortran-80 File-HandlingStatements, OPEN Statement, Unit Specifier, 6.2.1.21/0 Status Specifier, OPEN open-list