38
39
40
41
42
43
44
45
46
47
48 USE intbufdef_mod
49 USE multi_fvm_mod
52
53
54
55#include "implicit_f.inc"
56#include "comlock.inc"
57
58
59
60#include "com01_c.inc"
61#include "com04_c.inc"
62#include "param_c.inc"
63#include "task_c.inc"
64
65
66
67 INTEGER, INTENT(in) :: ITASK
68 INTEGER, INTENT(in) :: NB_INTER_SORTED
69 INTEGER, DIMENSION(NB_INTER_SORTED), INTENT(in) :: LIST_INTER_SORTED
70 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI
71 TYPE(INTBUF_STRUCT_),DIMENSION(NINTER), INTENT(in) :: INTBUF_TAB
72 my_real,
DIMENSION(3*NUMNOD),
INTENT(in) :: x
73 TYPE(inter_struct_type), DIMENSION(NINTER), INTENT(inout) :: INTER_STRUCT
74 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM
75
76
77
78 INTEGER :: KK,I,J
79 INTEGER :: NIN
80 INTEGER :: IX,IY,IZ
81 INTEGER :: SIZE_INDEX_CELL,TOTAL_NB_CELL
82 INTEGER :: NRTM,NRTM_T
83 INTEGER :: ADRESS,ESHIFT,SHIFT
84 INTEGER, DIMENSION(:), ALLOCATABLE :: INDEX_CELL
85 LOGICAL :: TYPE18
86 INTEGER :: NTY,INACTI
87 INTEGER :: VALUE
89
90 my_real :: tzinf,gapmin,gapmax,gap,drad
91
92
93
94
95 IF(itask==0) THEN
99 ENDIF
101
102
104 ALLOCATE(index_cell(size_index_cell))
106
107
108
109 DO kk=1,nb_inter_sorted
110 nin = list_inter_sorted(kk)
111 nrtm = ipari(4,nin)
112 nrtm_t = nrtm/nthread
113 eshift = itask*nrtm_t
114 adress = 1 + itask*(ipari(4,nin)/nthread)
115 IF(itask==nthread-1) nrtm_t= nrtm - adress + 1
117
118 tzinf = intbuf_tab(nin)%VARIABLES(tzinf_index)
119 gap =intbuf_tab(nin)%VARIABLES(gap_index)
120 gapmin=intbuf_tab(nin)%VARIABLES(gapmin_index)
121 gapmax=intbuf_tab(nin)%VARIABLES(gapmax_index)
122 drad = zero
123 IF(ipari(7,nin)==7) drad =intbuf_tab(nin)%VARIABLES(drad_index)
124 dgapload = intbuf_tab(nin)%VARIABLES(bgapemx_index)
125
126 nty = ipari(7,nin)
127 inacti = ipari(22,nin)
128 type18=.false.
129 IF(nty==7 .AND. inacti==7)type18=.true.
130
131 IF(itask==0) THEN
133 IF(sort_comm(nin)%PROC_NUMBER>nspmd/2) THEN
135 IF(.NOT.ALLOCATED(sort_comm(nin)%MAIN_COARSE_GRID) ) THEN
136 ALLOCATE(sort_comm(nin)%MAIN_COARSE_GRID(
138 ENDIF
139 sort_comm(nin)%MAIN_COARSE_GRID(:,:,:) = 0
140 ENDIF
141 ENDIF
142
144
145
146 CALL inter_cell_color( x,ipari(21,nin) ,nrtm_t ,intbuf_tab(nin)%STFM(1+eshift) ,
147 2 tzinf,inter_struct(nin)%CURV_MAX(adress),
148 3 gapmin ,gapmax,intbuf_tab(nin)%GAP_M(1+eshift) ,
149 4 intbuf_tab(nin)%IRECTM(1+4*eshift),gap,intbuf_tab(nin)%VARIABLES
151 6
coarse_grid,sort_comm(nin)%MAIN_COARSE_GRID,dgapload)
152
154
155
156 IF(itask==0) THEN
157 total_nb_cell = 0
158 DO i=1,nthread
160 ENDDO
161 sort_comm(nin)%SIZE_CELL_LIST(1) = total_nb_cell
162 sort_comm(nin)%SIZE_CELL_LIST(2) = 0
163 ALLOCATE( sort_comm(nin)%CELL_LIST(total_nb_cell) )
164 ENDIF
165
166
168
169 VALUE = index_cell(i)
170 iz = ( VALUE - mod(VALUE,1000000) ) / 1000000
171 VALUE = VALUE - iz * 1000000
172 iy = ( VALUE - mod(VALUE,1000) ) / 1000
173 VALUE = VALUE - iy * 1000
174 ix = VALUE
176 ENDDO
178
179
180
181
182 shift = 0
183 IF(itask>0) THEN
184 DO j=1,itask
186 ENDDO
187 ENDIF
189
191
192 ENDDO
193
195
196
197 IF(itask==0) THEN
200 ENDIF
201 DEALLOCATE(index_cell)
202
203 RETURN
subroutine inter_cell_color(x, igap, nrtm, stf, tzinf, curv_max, gapmin, gapmax, gap_m, irect, gap, bgapsmx, drad, nb_index_cell, size_index_cell, index_cell, needed, main_coarse_grid, dgapload)
integer, dimension(:), allocatable nb_local_cell
logical, dimension(:,:,:), allocatable cell_bool
integer, parameter nb_box_coarse_grid