`Consider the following declarations
`

integer(kind=1) :: i1 integer(kind=2) :: i2 integer(kind=4) :: i4 integer(kind=8) :: i8

`For example, on an Alpha 21264 processor, i1
can hold numbers between and ;
similarly, i2 can hold values between and ,
i3 between and , and
i4 between
and
;
on Alpha 21264 KIND=p means storing the integer on
p bytes; allowed values are p=1,2,4,8.
`

`Numerical constants of a specific kind can be specified by appending
an underscore and the kind number, for example
`

i1 = 39_1; i8 = 39876_8

`In order to make the code completely portable, and to work
with kind numbers transparently, we can specify
the range of integer values. The function
`

selected_int_kind(2)

integer, parameter :: short = selected_int_kind(2), & medium = selected_int_kind(3), & long = selected_int_kind(8), & huge = selected_int_kind(16) integer(kind=short) :: i1 integer(kind=medium) :: i2 integer(kind=long :: i4 integer(kind=huge) :: i8 i1 = 39_short; i8 = 39876_huge

`If there is no available kind that can accomodate the
required range , the function SELECTED_INT_KIND(p)
returns and we get an error at compile time.
`