Table 5-2 shows the data types that can appear in noncharacter type declaration statements.
Table 5-2 Noncharacter Data Types
BYTE 1 |
LOGICAL 2 |
LOGICAL(1) (or LOGICAL*1) |
LOGICAL(2) (or LOGICAL*2) |
LOGICAL(4) (or LOGICAL*4) |
LOGICAL(8) (or LOGICAL*8) |
INTEGER 3 |
INTEGER(1) (or INTEGER*1) |
INTEGER(2) (or INTEGER*2) |
INTEGER(4) (or INTEGER*4) |
INTEGER(8) (or INTEGER*8) |
REAL 4 |
REAL(4) (or REAL*4) |
DOUBLE PRECISION (REAL(8) or REAL*8) |
REAL(16) (or REAL*16) 5 |
COMPLEX 6 |
COMPLEX(4) (or COMPLEX*8) |
DOUBLE COMPLEX (COMPLEX(8) or COMPLEX*16) |
COMPLEX(16) (or COMPLEX*32) 5 |
1 Same as INTEGER(1).
2 This is treated as default logical. 3 This is treated as default integer. 4 This is treated as default real. 5 VMS, U*X 6 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 16-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.
Examples
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: