Type declaration: type parameters and specifiers
This is an overview section on declaring the type of an entity. The Statements section contains the particular syntax details and rules for derived and intrinsic type declarations.
XL Fortran provides
one or more representation methods for each intrinsic data type. You
can optionally specify this representation method with a kind type
parameter value, using kind_param in your
type declaration statement. This value can indicate:
The BYTE intrinsic
type does not have a kind type parameter.
A length type parameter specifies the number of characters for entities of type character.
A type specifier denotes the type of all entities declared in a type declaration statement. The INTEGER, REAL, COMPLEX, LOGICAL, and CHARACTER type specifiers can include a kind_selector, that specifies the kind type parameter.
For example, here are some common ways you can declare a 4-byte
integer:
- INTEGER(4)
- INTEGER(KIND=4)
- INTEGER, where the default integer size is set to 4 bytes.
TYPE(INTEGER(4))
TYPE(INTEGER(KIND=4))
TYPE(INTEGER),
where the default integer size is set to 4 bytes.
This document references 4-byte integers as INTEGER(4).
See Type Declaration for detailed information about type specifiers.


