The INT function converts a numeric argument to the INTEGER type.
SyntaxINT (a [, kind])
a is an INTENT(IN) scalar or array of type INTEGER, REAL, or COMPLEX.
kind is INTENT(IN) and determines the kind of the result. It must be a scalar INTEGER expression that can be evaluated at compile time. To maintain portability, this argument should be the result of a KIND Function or SELECTED_INT_KIND Function.
The result is of type INTEGER. It is the value of a without its fractional part.
If kind is present, the kind is that specified by kind.
If a is of type COMPLEX, the result is the value of the real part of a without its fractional part.
Exampleinteger :: i2=selected_int_kind(2) integer(selected_int_kind(4)) :: i4=3 real :: a=2.5 complex :: c=(1.5,2.5) write(*,*) i4,int(i4,i2) ! converts between integer kinds write(*,*) a,int(a) ! converts real to integer write(*,*) c,int(c) ! converts complex to integer