trailz returns the number of trailing zero bits of an integer.
Fortran 2008 and later
result = trailz(i)
i - Shall be of type integer.The type of the return value is the default integer. If all the bits of i are zero, the result value is bit_size(i).
program test_trailz
write (*,*) trailz(8) ! prints 3
end program
bit_size, popcnt, poppar, leadz