5.1.1 Declaration Statements for Noncharacter Types

Table 5-2 shows the data types that can appear in noncharacter type declaration statements.

Table 5-2 Noncharacter Data Types

LOGICAL(1) (or LOGICAL*1)   
LOGICAL(2) (or LOGICAL*2)   
LOGICAL(4) (or LOGICAL*4)   
LOGICAL(8) (or LOGICAL*8)[3]   
INTEGER(1) (or INTEGER*1)   
INTEGER(2) (or INTEGER*2)   
INTEGER(4) (or INTEGER*4)   
INTEGER(8) (or INTEGER*8)[3]   
REAL(4) (or REAL*4)   
REAL(16) (or REAL*16)[6]   
COMPLEX(4) (or COMPLEX*8)   

[1] Same as INTEGER(1).
[2] This is treated as default logical.
[3] Alpha only
[4] This is treated as default integer.
[5] This is treated as default real.
[6] VMS, U*X
[7] This is treated as default complex.

In noncharacter type declaration statements, 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 (see Table 15-2). 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 statement, IVEC*2(10) is an INTEGER(2) array of 10 elements.


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

INTEGER(2) I, J, K, M12*4, Q, IVEC*4(10)
REAL(8) WX1, WXZ, WX3*4, WX5, WX6*4
REAL(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.

For More Information:

Previous Page Next Page Table of Contents