Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 9/08/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Visible to Intel only — GUID: GUID-89F486ED-4CB5-4A61-91F9-8BB48D32307A

Document Table of Contents

Declarations for Noncharacter Types

The following table shows the data types that can appear in noncharacter type declarations.

Noncharacter Data Types

BYTE1

LOGICAL2

LOGICAL([KIND=]1) (or LOGICAL*1)

LOGICAL([KIND=]2) (or LOGICAL*2)

LOGICAL([KIND=]4) (or LOGICAL*4)

In noncharacter type declarations, you can optionally specify the name of the data object or function as v*n, where n is the length (in bytes) of v. The length specified overrides the length implied by the data type.

The value for n must be a valid length for the type of v. The type specifiers BYTE, DOUBLE PRECISION, and DOUBLE COMPLEX have one valid length, so the n specifier is invalid for them.

For an array specification, the n must be placed immediately following the array name; for example, in an INTEGER declaration, IVEC*2(10) is an INTEGER(2) array of 10 elements.

Note that certain compiler options can affect the defaults for numeric and logical data types.

Examples

In a noncharacter type declaration, a subsequent kind parameter overrides any initial kind parameter. For example, consider the following statements:

INTEGER(KIND=2) I, J, K, M12*4, Q, IVEC*4(10)
REAL(KIND=8) WX1, WXZ, WX3*4, WX5, WX6*4
REAL(KIND=8) PI/3.14159E0/, E/2.72E0/, QARRAY(10)/5*0.0,5*1.0/

In the first statement, M12*4 and IVEC*4 override the KIND=2 specification. In the second statement, WX3*4 and WX6*4 override the KIND=8 specification. In the third statement, QARRAY is initialized with implicit conversion of the REAL(4) constants to a REAL(8) data type.

See Also