24 implicit real*8 (a-h,o-z)
25 integer(kind=kint),
dimension(:),
allocatable :: WR, WS
28 integer(kind=kint),
pointer :: ADAPT_nodLEVmax (:), ADAPT_LEVcur(:)
30 type (hecmwST_local_mesh) :: hecMESH
34 allocate (adapt_nodlevmax(hecmesh%nn_array))
35 allocate (adapt_levcur(hecmesh%ne_array))
50 do icel0= 1, hecmesh%n_adapt_act_elem_341
51 icel= hecmesh%adapt_act_elem_341(icel0)
52 is= hecmesh%elem_node_index(icel-1)
53 n1= hecmesh%elem_node_item (is+1)
54 n2= hecmesh%elem_node_item (is+2)
55 n3= hecmesh%elem_node_item (is+3)
56 n4= hecmesh%elem_node_item (is+4)
72 if ( hecmesh%adapt_iemb(ie1).gt.0 ) ndiv(1)= 1
73 if ( hecmesh%adapt_iemb(ie2).gt.0 ) ndiv(2)= 1
74 if ( hecmesh%adapt_iemb(ie3).gt.0 ) ndiv(3)= 1
75 if ( hecmesh%adapt_iemb(ie4).gt.0 ) ndiv(4)= 1
76 if ( hecmesh%adapt_iemb(ie5).gt.0 ) ndiv(5)= 1
77 if ( hecmesh%adapt_iemb(ie6).gt.0 ) ndiv(6)= 1
79 ndivsum= ndiv(1)+ndiv(2)+ndiv(3)+ndiv(4)+ndiv(5)+ndiv(6)
81 if (ndivsum.eq.0) nlev_add= 0
82 if (ndivsum.eq.1 .or. ndivsum.eq.3) nlev_add= 1
83 if (ndivsum.eq.6) nlev_add= 2
85 nl= hecmesh%adapt_level(icel) + nlev_add
87 adapt_levcur(icel)= nl
89 m1= adapt_nodlevmax(n1)
90 m2= adapt_nodlevmax(n2)
91 m3= adapt_nodlevmax(n3)
92 m4= adapt_nodlevmax(n4)
94 adapt_nodlevmax(n1)= max(nl, m1)
95 adapt_nodlevmax(n2)= max(nl, m2)
96 adapt_nodlevmax(n3)= max(nl, m3)
97 adapt_nodlevmax(n4)= max(nl, m4)
103 do icel0= 1, hecmesh%n_adapt_act_elem_351
104 icel= hecmesh%adapt_act_elem_351(icel0)
105 is= hecmesh%elem_node_index(icel-1)
106 n1= hecmesh%elem_node_item (is+1)
107 n2= hecmesh%elem_node_item (is+2)
108 n3= hecmesh%elem_node_item (is+3)
109 n4= hecmesh%elem_node_item (is+4)
110 n5= hecmesh%elem_node_item (is+5)
111 n6= hecmesh%elem_node_item (is+6)
127 if ( hecmesh%adapt_iemb(ie1).gt.0 ) ndiv(1)= 1
128 if ( hecmesh%adapt_iemb(ie2).gt.0 ) ndiv(2)= 1
129 if ( hecmesh%adapt_iemb(ie3).gt.0 ) ndiv(3)= 1
130 if ( hecmesh%adapt_iemb(ie4).gt.0 ) ndiv(4)= 1
131 if ( hecmesh%adapt_iemb(ie5).gt.0 ) ndiv(5)= 1
132 if ( hecmesh%adapt_iemb(ie6).gt.0 ) ndiv(6)= 1
134 ndivsum= ndiv(1)+ndiv(2)+ndiv(3)+ndiv(4)+ndiv(5)+ndiv(6)
136 if (ndivsum.eq.0) nlev_add= 0
137 if (ndivsum.eq.2) nlev_add= 1
138 if (ndivsum.eq.6) nlev_add= 2
140 nl= hecmesh%adapt_level(icel) + nlev_add
142 adapt_levcur(icel)= nl
144 m1= adapt_nodlevmax(n1)
145 m2= adapt_nodlevmax(n2)
146 m3= adapt_nodlevmax(n3)
147 m4= adapt_nodlevmax(n4)
148 m5= adapt_nodlevmax(n5)
149 m6= adapt_nodlevmax(n6)
151 adapt_nodlevmax(n1)= max(nl, m1)
152 adapt_nodlevmax(n2)= max(nl, m2)
153 adapt_nodlevmax(n3)= max(nl, m3)
154 adapt_nodlevmax(n4)= max(nl, m4)
155 adapt_nodlevmax(n5)= max(nl, m5)
156 adapt_nodlevmax(n6)= max(nl, m6)
161 if (hecmesh%PETOT.ne.1)
then
165 n1= hecmesh%import_index(hecmesh%n_neighbor_pe)
166 n2= hecmesh%export_index(hecmesh%n_neighbor_pe)
169 allocate (ws(m), wr(m))
174 & ( n, hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, &
175 & hecmesh%import_index, hecmesh%import_item, &
176 & hecmesh%export_index, hecmesh%export_item, &
177 & ws, wr, adapt_nodlevmax, hecmesh%MPI_COMM, hecmesh%my_rank, &
190 do icel0= 1, hecmesh%n_adapt_act_elem_341
191 icel= hecmesh%adapt_act_elem_341(icel0)
192 is= hecmesh%elem_node_index(icel-1)
193 n1= hecmesh%elem_node_item (is+1)
194 n2= hecmesh%elem_node_item (is+2)
195 n3= hecmesh%elem_node_item (is+3)
196 n4= hecmesh%elem_node_item (is+4)
198 nl= adapt_levcur(icel)
200 m1= adapt_nodlevmax(n1)
201 m2= adapt_nodlevmax(n2)
202 m3= adapt_nodlevmax(n3)
203 m4= adapt_nodlevmax(n4)
205 if (((m1-nl).gt.2).or.((m2-nl).gt.2).or.((m3-nl).gt.2).or. &
206 & ((m4-nl).gt.2 ))
then
215 hecmesh%adapt_iemb(ie1)= 1
216 hecmesh%adapt_iemb(ie2)= 1
217 hecmesh%adapt_iemb(ie3)= 1
218 hecmesh%adapt_iemb(ie4)= 1
219 hecmesh%adapt_iemb(ie5)= 1
220 hecmesh%adapt_iemb(ie6)= 1
228 do icel0= 1, hecmesh%n_adapt_act_elem_351
229 icel= hecmesh%adapt_act_elem_351(icel0)
230 is= hecmesh%elem_node_index(icel-1)
231 n1= hecmesh%elem_node_item (is+1)
232 n2= hecmesh%elem_node_item (is+2)
233 n3= hecmesh%elem_node_item (is+3)
234 n4= hecmesh%elem_node_item (is+4)
235 n5= hecmesh%elem_node_item (is+5)
236 n6= hecmesh%elem_node_item (is+6)
238 nl= adapt_levcur(icel)
240 m1= adapt_nodlevmax(n1)
241 m2= adapt_nodlevmax(n2)
242 m3= adapt_nodlevmax(n3)
243 m4= adapt_nodlevmax(n4)
244 m5= adapt_nodlevmax(n5)
245 m6= adapt_nodlevmax(n6)
247 if (((m1-nl).gt.2).or.((m2-nl).gt.2).or.((m3-nl).gt.2).or. &
248 & ((m4-nl).gt.2).or.((m5-nl).gt.2).or.((m6-nl).gt.2))
then
257 hecmesh%adapt_iemb(ie1)= 1
258 hecmesh%adapt_iemb(ie2)= 1
259 hecmesh%adapt_iemb(ie3)= 1
260 hecmesh%adapt_iemb(ie4)= 1
261 hecmesh%adapt_iemb(ie5)= 1
262 hecmesh%adapt_iemb(ie6)= 1
271 n1= hecmesh%adapt_import_edge_index(hecmesh%n_neighbor_pe)
272 n2= hecmesh%adapt_export_edge_index(hecmesh%n_neighbor_pe)
274 allocate (ws(m), wr(m))
279 & ( hecmesh%n_adapt_edge, &
280 & hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, &
281 & hecmesh%adapt_import_edge_index, &
282 & hecmesh%adapt_import_edge_item , &
283 & hecmesh%adapt_export_edge_index, &
284 & hecmesh%adapt_export_edge_item , &
285 & ws, wr, hecmesh%adapt_iemb, hecmesh%MPI_COMM, &
286 & hecmesh%my_rank, 1, m)
291 & ( hecmesh%n_adapt_edge, &
292 & hecmesh%n_neighbor_pe, hecmesh%neighbor_pe, &
293 & hecmesh%adapt_import_edge_index, &
294 & hecmesh%adapt_import_edge_item , &
295 & hecmesh%adapt_export_edge_index, &
296 & hecmesh%adapt_export_edge_item , &
297 & ws, wr, hecmesh%adapt_iemb, hecmesh%MPI_COMM, &
298 & hecmesh%my_rank, 1, m)
301 deallocate (adapt_nodlevmax, adapt_levcur)