SPEED
CHECK_VECTOR.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine check_vector (n, v, ind, tt)
 Checks if an element is present in a vector.
 

Function/Subroutine Documentation

◆ check_vector()

subroutine check_vector ( integer*4, intent(in)  n,
integer*4, dimension(n), intent(in)  v,
integer*4, intent(in)  ind,
integer*4, intent(out)  tt 
)

Checks if an element is present in a vector.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]ndimension of v
[in]vvector
[in]indindex to find
[out]tt1 if ind is in v, 0 otherwise

Definition at line 28 of file CHECK_VECTOR.f90.

29
30 implicit none
31
32 integer*4 :: i
33
34 integer*4, intent(in) ::n,ind
35 integer*4, dimension(n), intent(in) :: v
36 integer*4, intent(out) :: tt
37
38 tt = 0
39 i = 1
40
41 do while (i.le.n)
42 if (v(i) .eq. ind) then
43 tt = 1
44 return
45 endif
46 i=i+1
47 enddo
48

Referenced by setup_mpi_jump().

Here is the caller graph for this function: