next up previous contents
Next: More Intrinsics Up: Parameterised Intrinsic Types Previous: Expression Evaluation

gif

Logical KIND SelectionReturn to corresponding overview page

LOGICAL objects follow exactly the same principle as for numeric data types. Even though a LOGICAL variable can only hold one of two values it can still be represented in a number of different ways. For example,

    LOGICAL(KIND=4) :: yorn = .TRUE._4
    LOGICAL(KIND=1), DIMENSION(10) :: mask
    IF (yorn .EQ. LOGICAL(mask(1),KIND(yorn))) ....

KIND=1 could mean that only one byte is used to store each element of mask which would conserve space. Must refer to the compiler manual.

  figure10039
Figure 28: Possible Sizes of Different Logical Kind Variables

There is no SELECTED_LOGICAL_KIND intrinsic, however, the KIND intrinsic can be used to inquire about the representation and, as demonstrated above, the LOGICAL intrinsic, which has an optional KIND= argument, can be used to convert between representations.

Return to corresponding overview page gif


next up previous contents
Next: More Intrinsics Up: Parameterised Intrinsic Types Previous: Expression Evaluation

©University of Liverpool, 1997
Wed May 28 20:20:27 BST 1997
Not for commercial use.