Logical Data Types

Logical data types can be specified as follows:

LOGICAL
LOGICAL([KIND=]n)
LOGICAL*n

n
Is kind 1, 2, 4, or 8.

If a kind parameter is specified, the logical constant has the kind specified. If no kind parameter is specified, the kind of the constant is default logical.

For more information on logical data types, see Logical Constants.

Examples

The following examples show how logical variables can be declared.
An entity-oriented example is:

 LOGICAL, ALLOCATABLE :: flag1, flag2
 LOGICAL (KIND = byte), SAVE :: doit, dont

An attribute-oriented example is:

 LOGICAL flag1, flag2
 LOGICAL (KIND = byte) doit, dont
 ALLOCATABLE flag1, flag2
 SAVE doit, dont