06.03.2014 Views

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

Intel Fortran Language Reference - NCI National Facility

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Data Types, Constants, and Variables 3<br />

When the length of the constant is greater than the length implied by the data type, the<br />

constant is truncated on the right. If any characters other than blank characters are truncated,<br />

an error occurs.<br />

Each Hollerith character occupies one byte of memory.<br />

See Also<br />

Variables<br />

The Compiler Options reference for details on compiler options<br />

A variable is a data object whose value can be changed at any point in a program. A variable can<br />

be any of the following:<br />

• A scalar<br />

A scalar is a single object that has a single value; it can be of any intrinsic or derived<br />

(user-defined) type.<br />

• An array<br />

An array is a collection of scalar elements of any intrinsic or derived type. All elements must<br />

have the same type and kind parameters.<br />

• A subobject designator<br />

A subobject is part of an object. The following are subobjects:<br />

An array element<br />

An array section<br />

A structure component<br />

A character substring<br />

For example, B(3) is a subobject (array element) designator for array B. A subobject cannot<br />

be a variable if its parent object is a constant.<br />

The name of a variable is associated with a single storage location.<br />

Variables are classified by data type, as constants are. The data type of a variable indicates the type<br />

of data it contains, including its precision, and implies its storage requirements. When data of any<br />

type is assigned to a variable, it is converted to the data type of the variable (if necessary).<br />

A variable is defined when you give it a value. A variable can be defined before program<br />

execution by a DATA statement or a type declaration statement. During program execution,<br />

variables can be defined or redefined in assignment statements and input statements, or undefined<br />

(for example, if an I/O error occurs). When a variable is undefined, its value is unpredictable.<br />

When a variable becomes undefined, all variables associated by storage association also become<br />

undefined.<br />

3-33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!