Logical
The following
table shows the values that XL Fortran can represent
using the logical data type:
| Kind parameter | Values | Internal (hex) Representation |
|---|---|---|
| 1 | .TRUE. |
01 |
| 2 | .TRUE. |
0001 |
| 4 | .TRUE. |
00000001 |
| 8 | .TRUE. |
0000000000000001 |
XL Fortran sets the default kind type parameter to 4. The kind type parameter is equivalent to the byte size for logical values. Use the -qintsize compiler option to change the default logical size to 2, 4, or 8 bytes. Note that the -qintsize option similarly affects the default integer size. Use –qintlog to mix integer and logical data entities in expressions and statements.
The -qport=clogicals option
allows you to instruct the compiler to treat all nonzero integers
used in logical expressions as TRUE. In order to use the -qport=clogicals option,
you must also specify the -qintlog option. 
The logical type specifier must include the LOGICAL keyword. See LOGICAL for details on declaring entities of type logical.
- kind_param
- is either a digit-string or a scalar-int-constant-name
A logical constant can have a logical value of either true or false.
You
can also use the abbreviations T and F (without the periods) for .TRUE.
and .FALSE., respectively, but only in formatted input, or as initial
values in DATA statements, STATIC statements,
or type declaration statements. A kind type parameter cannot be specified
for the abbreviated form. If T or F has
been defined as a named constant, it is treated as that named constant
rather than the logical literal constant. 
.FALSE._4
.TRUE.



