21 implicit real*8 (a-h,o-z)
23 integer(kind=kint ),
pointer :: wSI(:), wSE(:)
24 integer(kind=kint ),
pointer :: wiIa(:), wiEa(:), wiIb(:), wiEb(:)
25 integer(kind=kint ),
dimension(:),
allocatable :: IW1, IW2
27 type (hecmwST_local_mesh) :: hecMESH
34 allocate (hecmesh%adapt_iemb (hecmesh%n_adapt_edge), &
35 & hecmesh%adapt_mid_edge(hecmesh%n_adapt_edge))
36 hecmesh%adapt_iemb = 0
37 hecmesh%adapt_mid_edge= 0
39 allocate (hecmesh%rev_neighbor_pe(0:hecmesh%n_neighbor_pe))
41 hecmesh%rev_neighbor_pe(hecmesh%my_rank)= 0
42 do neib= 1, hecmesh%n_neighbor_pe
43 hecmesh%rev_neighbor_pe(hecmesh%neighbor_pe(neib))= neib
46 allocate (hecmesh%adapt_act_elem_341(hecmesh%n_adapt_elem_341))
47 allocate (hecmesh%adapt_act_elem_351(hecmesh%n_adapt_elem_351))
51 do icel= 1, hecmesh%n_elem
52 ityp= hecmesh%elem_type(icel)
56 if (hecmesh%adapt_type(icel).eq.0)
then
58 hecmesh%adapt_act_elem_341(icouta)= icel
64 if (hecmesh%adapt_type(icel).eq.0)
then
66 hecmesh%adapt_act_elem_351(icoupa)= icel
71 hecmesh%n_adapt_act_elem_341= icouta
72 hecmesh%n_adapt_act_elem_351= icoupa
80 do ie= 1, hecmesh%n_adapt_edge
81 if (hecmesh%adapt_edge_home(ie).eq.hecmesh%my_rank) nnn= nnn + 1
83 hecmesh%n_adapt_edge_global= hecmesh%n_adapt_act_edge
85 call hecmw_allreduce_i (hecmesh, hecmesh%n_adapt_edge_global, 1,
hecmw_sum)
96 neibpetot= hecmesh%n_neighbor_pe
98 allocate (iw1(hecmesh%n_neighbor_pe))
99 allocate (wse(0:hecmesh%n_neighbor_pe), wsi(0:hecmesh%n_neighbor_pe))
106 do ie= 1, hecmesh%n_adapt_edge
107 ih= hecmesh%adapt_edge_home(ie)
108 if (ih.ne.hecmesh%my_rank)
then
109 ihr = hecmesh%rev_neighbor_pe(ih)
110 wsi(ihr)= wsi(ihr) + 1
117 & ( hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, wsi, wse, &
118 & hecmesh%MPI_COMM, hecmesh%my_rank)
120 commtime= commtime + etime0 - stime0
124 do neib= 1, hecmesh%n_neighbor_pe
125 wsi(neib)= wsi(neib-1) + wsi(neib)
126 wse(neib)= wse(neib-1) + wse(neib)
131 allocate (wiia(wsi(hecmesh%n_neighbor_pe)*4))
132 allocate (wiea(wse(hecmesh%n_neighbor_pe)*4))
133 allocate (wiib(wsi(hecmesh%n_neighbor_pe) ))
134 allocate (wieb(wse(hecmesh%n_neighbor_pe) ))
141 do ie= 1, hecmesh%n_adapt_edge
142 ih= hecmesh%adapt_edge_home(ie)
144 if (ih.ne.hecmesh%my_rank)
then
145 ihr = hecmesh%rev_neighbor_pe(ih)
146 iw1(ihr ) = iw1(ihr) + 1
147 is = wsi(ihr-1)+iw1(ihr)
149 in1= hecmesh%adapt_edge_node(2*ie-1)
150 in2= hecmesh%adapt_edge_node(2*ie )
152 wiia(4*is-3)= hecmesh%node_ID(2*in1 )
153 wiia(4*is-2)= hecmesh%node_ID(2*in1-1)
154 wiia(4*is-1)= hecmesh%node_ID(2*in2 )
155 wiia(4*is )= hecmesh%node_ID(2*in2-1)
159 len= max(wsi(hecmesh%n_neighbor_pe),wse(hecmesh%n_neighbor_pe), &
160 & hecmesh%n_adapt_edge)
163 allocate (iw1(len*4), iw2(len*4))
168 & (len, hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, &
169 & wsi, wiia, wse, wiea, iw1, iw2, &
170 & hecmesh%MPI_COMM, hecmesh%my_rank, 4)
172 commtime= commtime + etime0 - stime0
174 deallocate (iw1, iw2)
186 do neib= 1, hecmesh%n_neighbor_pe
201 len= max(wsi(hecmesh%n_neighbor_pe),wse(hecmesh%n_neighbor_pe),iedgtot)
202 allocate (iw1(len), iw2(len))
208 & (len, hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, &
209 & wse, wieb, wsi, wiib, iw1, iw2, &
210 & hecmesh%MPI_COMM, hecmesh%my_rank, 1)
212 commtime= commtime + etime0 - stime0
218 allocate (iw1(hecmesh%n_neighbor_pe))
221 do ie= 1, hecmesh%n_adapt_edge
222 ih= hecmesh%adapt_edge_home(ie)
224 if (ih.ne.hecmesh%my_rank)
then
225 ihr = hecmesh%rev_neighbor_pe(ih)
226 iw1(ihr )= iw1(ihr) + 1
228 wiib(wsi(ihr-1)+iw1(ihr))= ie
234 allocate (hecmesh%adapt_import_edge_index(0:hecmesh%n_neighbor_pe))
235 allocate (hecmesh%adapt_export_edge_index(0:hecmesh%n_neighbor_pe))
237 do neib= 0, hecmesh%n_neighbor_pe
238 hecmesh%adapt_import_edge_index(neib)= wsi(neib)
239 hecmesh%adapt_export_edge_index(neib)= wse(neib)
242 maximport= wsi(hecmesh%n_neighbor_pe)
243 maxexport= wse(hecmesh%n_neighbor_pe)
245 allocate (hecmesh%adapt_import_edge_item(maximport))
246 allocate (hecmesh%adapt_export_edge_item(maxexport))
248 hecmesh%adapt_import_edge_item(k)= wiib(k)
251 hecmesh%adapt_export_edge_item(k)= wieb(k)
255 deallocate (wse,wsi,wiea,wieb,wiia,wiib)
260 do i= 1, hecmesh%n_node
261 if (hecmesh%node_ID(2*i) .eq.ip .and. &
262 & hecmesh%node_ID(2*i-1).eq.in)
then