Lahey/Fujitsu Fortran

KIND Function

Description

The KIND function returns the kind type parameter for arguments of any intrinsic type.

Syntax

KIND (x)

Arguments

x is an INTENT(IN) scalar or array of any intrinsic type.

If x has the POINTER or ALLOCATABLE attribute, it does not have to be allocated, associated, or defined.

Result

The result is a scalar INTEGER. Its value is equal to the compiler dependent kind type parameter value of x.

The actual values returned by the KIND function are not necessarily portable to other compiling platforms.

Example

! display default kinds integer :: i real :: r double precision :: d complex :: q logical :: l character :: c write(*,*) "Default integer kind : ",kind(i) ! 4 write(*,*) "Default real kind : ",kind(r) ! 4 write(*,*) "Default dp real kind : ",kind(d) ! 8 write(*,*) "Default complex kind : ",kind(q) ! 4 write(*,*) "Default logical kind : ",kind(l) ! 4 write(*,*) "Default character kind: ",kind(c) ! 1