SPEED
MAKE_REN_LOC_NODE.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
30
31 subroutine make_ren_loc_node(nnz_loc, cs_loc, nn_loc, id, loc_n_num)
32
33
35
36 implicit none
37
38 integer*4 :: nnz_loc
39 integer*4 :: ie, ne, i, j, ind_nd, id, ic
40
41 integer*4, intent(in) :: nn_loc
42
43 integer*4, dimension(0:nnz_loc), intent(in) :: cs_loc
44 integer*4, dimension(nn_loc), intent(inout) :: loc_n_num
45 integer*4, dimension(0:nnz_loc) :: cs_loc_copy
46
47
48
49 cs_loc_copy = cs_loc
50 ne = cs_loc_copy(0) - 1
51
52
53 do ie = 1,ne
54 cs_loc_copy(cs_loc_copy(ie-1)) = 0
55 enddo
56
57 !QUICKSORT FOR REORDING
58 !------------------------------------------------------------
59 do ie = 0, cs_loc_copy(0)
60 cs_loc_copy(ie) = 0
61 enddo
62
63 call qsortc(cs_loc_copy)
64
65
66 ic = 0
67 do i = 1, nnz_loc
68 if (cs_loc_copy(i) .ne. 0) then
69 if(cs_loc_copy(i) .ne. cs_loc_copy(i-1)) then
70 ic = ic + 1
71 loc_n_num(ic) = cs_loc_copy(i)
72 endif
73 endif
74 enddo
75
76
77
78 end subroutine make_ren_loc_node
subroutine make_ren_loc_node(nnz_loc, cs_loc, nn_loc, id, loc_n_nu
Renumerates the grid nodes.
Quick-sort algorithm.
Definition MODULES.f90:612
recursive subroutine, public qsortc(a)
Definition MODULES.f90:621