SPEED
GET_LOC_NODE_NUM.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine get_loc_node_num (nnz_loc, cs_loc, nn_loc, id)
 Computes number of local nodes.
 

Function/Subroutine Documentation

◆ get_loc_node_num()

subroutine get_loc_node_num ( integer*4  nnz_loc,
integer*4, dimension(0:nnz_loc), intent(in)  cs_loc,
integer*4, intent(out)  nn_loc,
integer*4  id 
)

Computes number of local nodes.

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]nnz_loclength of cs_loc
[in]cs_loclocal connectivity vector
[in]idnumber of mpi process
[out]nn_locnumber of local unknowns

Definition at line 29 of file GET_LOC_NODE_NUM.f90.

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
Quick-sort algorithm.
Definition MODULES.f90:612
recursive subroutine, public qsortc(a)
Definition MODULES.f90:621

References qsort_c_module::qsortc().

Here is the call graph for this function: