SPEED
GET_NEIGHBOUR_ELEM.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
31
32 subroutine get_neighbour_elem(omega_m, npt, n, id_mpi, n_qp)
33
34 implicit none
35
36 integer*4 :: i, lett, j
37 integer*4, intent(in) :: npt, id_mpi, n_qp
38 integer*4, intent(out) :: n
39
40 integer*4, dimension(n_qp) :: omega_m_copy
41 integer*4, dimension(n_qp,0:3), intent(inout) :: omega_m
42
43
44 n = 0
45 i = 1
46 omega_m_copy = omega_m(:,1)
47 do while (i .le. npt)
48 lett = omega_m_copy(i)
49
50 if(lett .ne. 0) then
51 n = n + 1
52 omega_m(i,3) = n
53 endif
54
55 do j = i + 1, npt
56
57 if (omega_m(j,1) .eq. lett) then
58 omega_m(j,3) = n
59 omega_m_copy(j) = 0
60 endif
61
62 enddo
63
64 i = i + 1
65
66 enddo
67
68
69
70
71
72 end subroutine get_neighbour_elem
subroutine get_neighbour_elem(omega_m, npt, n, id_mpi, n_qp)
Computes neighbouring element.