<Example Program>
Program kind_example Character a Complex b Integer c Logical d Real e Print *, 'Default character kind is', Kind(a) Print *, 'Default complex kind is', Kind(b) Print *, 'Default integer kind is', Kind(c) Print *, 'Default logical kind is', Kind(d) Print *, 'Default real kind is', Kind(e) Call show_double Contains Subroutine show_double Double Precision :: kind = 1.5d0 Print *, 'Double precision kind is', kind%kind End Subroutine End Program
Execution Results
Default character kind is 1 Default complex kind is 1 Default integer kind is 3 Default logical kind is 3 Default real kind is 1 Double precision kind is 2With the −kind=byte option, the output will be:
Default character kind is 1 Default complex kind is 4 Default integer kind is 4 Default logical kind is 4 Default real kind is 4 Double precision kind is 8