SPEED
CHECK_MPI.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine check_mpi (n, v, ind, tt, pos)
 Checks if a an element is present on a vector and give its position.
 

Function/Subroutine Documentation

◆ check_mpi()

subroutine check_mpi ( integer*4, intent(in)  n,
integer*4, dimension(0:n), intent(in)  v,
integer*4, intent(in)  ind,
integer*4, intent(out)  tt,
integer*4, intent(out)  pos 
)

Checks if a an element is present on a vector and give its position.

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

Definition at line 29 of file CHECK_MPI.f90.

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

Referenced by compute_energy_error(), and setup_mpi_jump().

Here is the caller graph for this function: