SPEED
GET_LOC_NODE_NUM.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
19
28
29 subroutine get_loc_node_num(nnz_loc, cs_loc, nn_loc, id)
30
32
33 implicit none
34
35 integer*4 :: nnz_loc
36 integer*4 :: ie, ne, i, j, ind_nd, id
37
38 integer*4, intent(out) :: nn_loc
39
40 integer*4, dimension(0:nnz_loc), intent(in) :: cs_loc
41 integer*4, dimension(0:nnz_loc) :: cs_loc_copy
42
43
44 cs_loc_copy = cs_loc
45 ne = cs_loc_copy(0) - 1
46
47
48 do ie = 1,ne
49 cs_loc_copy(cs_loc_copy(ie-1)) = 0
50 enddo
51
52 !QUICKSORT FOR REORDING
53 !------------------------------------------------------------
54 nn_loc = 0
55 do ie = 0, cs_loc_copy(0)
56 cs_loc_copy(ie) = 0
57 enddo
58
59 call qsortc(cs_loc_copy)
60
61
62 do i = 1, nnz_loc
63 if (cs_loc_copy(i) .ne. 0) then
64 if(cs_loc_copy(i) .ne. cs_loc_copy(i-1)) then
65 nn_loc = nn_loc + 1
66 endif
67 endif
68 enddo
69
70 !-------------------------------------------------------------
71
72 !--------------------------------------------------------------
73! do i = cs_loc_copy(0) + 1, nnz_loc
74! ind_nd = cs_loc_copy(i)
75!
76! do j = i + 1, nnz_loc
77! if (ind_nd .eq. cs_loc_copy(j)) cs_loc_copy(j) = 0
78! enddo
79! enddo
80!
81! do ie = 0, cs_loc_copy(0)
82! cs_loc_copy(ie) = 0
83! enddo
84!
85!
86! nn_loc = 0
87! do i = 0, nnz_loc - 1
88! if(cs_loc_copy(i) .ne. 0) nn_loc = nn_loc + 1
89! enddo
90 !-------------------------------------------------------------
91
92
93 end subroutine get_loc_node_num
subroutine get_loc_node_num(nnz_loc, cs_loc, nn_loc, id)
Computes number of local nodes.
Quick-sort algorithm.
Definition MODULES.f90:612
recursive subroutine, public qsortc(a)
Definition MODULES.f90:621