31
33
34
35
36
37! *
if p and
the current processor ispmd colored a
common cell --> ispmd and p need to communicate
38
39
40
41
42
44
45
46
47#include "implicit_f.inc"
48#include "comlock.inc"
49
50
51
52#include "com04_c.inc"
53
54
55
56 INTEGER, INTENT(in) :: NIN
57 INTEGER, INTENT(in) :: ITIED
58 INTEGER, DIMENSION(NB_BOX_COARSE_GRID**3), INTENT(in) :: MAIN_COARSE_GRID
59 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM
60
61
62
63 LOGICAL :: KEEP_THIS_PROC,BREAK_
64 INTEGER :: I,J,IJK
65 INTEGER :: ID_PROC,DISPL
66
67
68
69 IF(.NOT.ALLOCATED(sort_comm(nin)%KEEP_PROC)) THEN
70 ALLOCATE(sort_comm(nin)%KEEP_PROC(sort_comm(nin)%PROC_NUMBER) )
71 ENDIF
72
73 DO i=1,sort_comm(nin)%PROC_NUMBER
74 id_proc = sort_comm(nin)%PROC_LIST(i)
75 displ = sort_comm(nin)%RCV_DISPLS_COARSE_CELL(i)
76 sort_comm(nin)%KEEP_PROC(i) = .false.
77 keep_this_proc = .false.
78 break_ = .false.
79 j = 1
80
81 IF(sort_comm(nin)%RCV_SIZE_COARSE_CELL(i)==0) break_ = .true.
82
83 IF(.NOT.break_) THEN
84 IF(sort_comm(nin)%GLOBAL_COARSE_CELL(displ+
nb_box_coarse_grid**3+1)==0) break_ = .true.
85 ENDIF
86
87 IF(.NOT.break_) THEN
88
90 ijk = sort_comm(nin)%GLOBAL_COARSE_CELL(displ+j)
91 IF(main_coarse_grid(ijk)==1) keep_this_proc = .true.
92 ENDDO
93 ENDIF
94 IF(itied/=0) keep_this_proc=.true.
95 IF(keep_this_proc) sort_comm(nin)%KEEP_PROC(i) = .true.
96 ENDDO
97
98 RETURN
subroutine check_coarse_grid(nin, main_coarse_grid, sort_comm, itied)
end diagonal values have been computed in the(sparse) matrix id.SOL
integer, parameter nb_box_coarse_grid