OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
ddtools.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| ini_ifront ../starter/source/spmd/node/ddtools.F
25!||--- called by ------------------------------------------------------
26!|| lectur ../starter/source/starter/lectur.F
27!||--- uses -----------------------------------------------------
28!|| front_mod ../starter/share/modules1/front_mod.F
29!||====================================================================
30 SUBROUTINE ini_ifront()
31C-----------------------------------------------
32C M o d u l e s
33C-----------------------------------------------
34 USE front_mod
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38#include "implicit_f.inc"
39#include "com04_c.inc"
40C-----------------------------------------------
41C D u m m y A r g u m e n t s
42C-----------------------------------------------
43
44C-----------------------------------------------
45C L o c a l V a r i a b l e s
46C-----------------------------------------------
47 INTEGER I
48
49 DO i=1,numnod
50 ifront%IENTRY(i) = -1
51 ENDDO
52
53 DO i=1, sifront
54 ifront%P(1,i) = -1
55 ifront%P(2,i) = -1
56 END DO
57
58 ifront_end = numnod
59C
60 RETURN
61 END
62!||====================================================================
63!|| realloc_ifront ../starter/source/spmd/node/ddtools.F
64!||--- called by ------------------------------------------------------
65!|| ifrontplus ../starter/source/spmd/node/frontplus.F
66!||--- calls -----------------------------------------------------
67!|| ancmsg ../starter/source/output/message/message.F
68!||--- uses -----------------------------------------------------
69!|| front_mod ../starter/share/modules1/front_mod.F
70!|| message_mod ../starter/share/message_module/message_mod.F
71!||====================================================================
72 SUBROUTINE realloc_ifront()
73C-----------------------------------------------
74C M o d u l e s
75C-----------------------------------------------
76 USE message_mod
77 USE front_mod
78C-----------------------------------------------
79C I m p l i c i t T y p e s
80C-----------------------------------------------
81#include "implicit_f.inc"
82#include "com04_c.inc"
83C-----------------------------------------------
84C D u m m y A r g u m e n t s
85C-----------------------------------------------
86
87C-----------------------------------------------
88C L o c a l V a r i a b l e s
89C-----------------------------------------------
90 TYPE(my_front) :: IFRONT_SAVE
91 INTEGER I, STAT
92C-----------------------------------------------
93C S o u r c e L i n e s
94C-----------------------------------------------
95 ALLOCATE(ifront_save%P(2,sifront),stat=stat)
96 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
97 . msgtype=msgerror,
98 . c1='IFRONT_SAVE')
99
100c save IFRONT in IFRONT_SAVE
101 DO i=1,sifront
102 ifront_save%P(1,i) = ifront%P(1,i)
103 ifront_save%P(2,i) = ifront%P(2,i)
104 ENDDO
105
106c dealloc and realloc with bigger size (SIFRONT+NUMNOD)
107 DEALLOCATE(ifront%P)
108 ALLOCATE(ifront%P(2,sifront+numnod),stat=stat)
109 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
110 . msgtype=msgerror,
111 . c1='IFRONT REALLOC')
112
113 DO i=1,sifront
114 ifront%P(1,i) = ifront_save%P(1,i)
115 ifront%P(2,i) = ifront_save%P(2,i)
116 ENDDO
117 DO i=sifront+1,sifront+numnod
118 ifront%P(1,i) = -1
119 ifront%P(2,i) = -1
120 ENDDO
121
122 DEALLOCATE(ifront_save%P)
123
124c set new size of SIFRONT
125 sifront = sifront+numnod
126
127 RETURN
128 END
129!||====================================================================
130!|| plist_ifront ../starter/source/spmd/node/ddtools.f
131!||--- called by ------------------------------------------------------
132!|| c_irbe2 ../starter/source/restart/ddsplit/c_irbe2.F
133!|| domain_decomposition_pcyl ../starter/source/loads/general/load_pcyl/domain_decomposition_pcyl.F
134!|| get_size_numnod_local ../starter/source/spmd/get_size_tag.F
135!|| igrsurf_split ../starter/source/spmd/igrsurf_split.F
136!|| prepare_split_i21 ../starter/source/restart/ddsplit/inter_tools.F
137!|| print_joint ../starter/source/constraints/general/cyl_joint/split_joint.F
138!|| r2r_domdec ../starter/source/coupling/rad2rad/r2r_domdec.F
139!|| split_cand_i20 ../starter/source/restart/ddsplit/inter_tools.F
140!|| split_cand_i24 ../starter/source/restart/ddsplit/inter_tools.F
141!|| split_cand_i25 ../starter/source/restart/ddsplit/inter_tools.F
142!|| split_cand_i7 ../starter/source/restart/ddsplit/inter_tools.f
143!|| split_cfd_solide ../starter/source/spmd/split_cfd_solide.F
144!|| split_joint ../starter/source/constraints/general/cyl_joint/split_joint.F
145!|| split_rwall ../starter/source/constraints/general/rwall/split_rwall.F90
146!|| spmd_userwi_rest ../starter/source/user_interface/user_windows_tools.F
147!|| w_fi ../starter/source/restart/ddsplit/w_fi.F
148!|| w_front ../starter/source/restart/ddsplit/w_front.F
149!||--- uses -----------------------------------------------------
150!|| front_mod ../starter/share/modules1/front_mod.F
151!||====================================================================
152 SUBROUTINE plist_ifront(TAB,N,CPT)
153C returns in "TAB" list of SPMD domains on which node N is sticked
154C CPT is the number of SPMD domains on which node N is sticked
155C-----------------------------------------------
156C M o d u l e s
157C-----------------------------------------------
158 USE front_mod
159C-----------------------------------------------
160C I m p l i c i t T y p e s
161C-----------------------------------------------
162#include "implicit_f.inc"
163#include "com01_c.inc"
164C-----------------------------------------------
165C D u m m y A r g u m e n t s
166C-----------------------------------------------
167 INTEGER N,CPT,TAB(NSPMD)
168C-----------------------------------------------
169C L o c a l V a r i a b l e s
170C-----------------------------------------------
171 INTEGER IAD
172C-----------------------------------------------
173C S o u r c e L i n e s
174C-----------------------------------------------
175 tab(1:nspmd) = -1
176 cpt=0
177 iad=ifront%IENTRY(n)
178 IF(iad==-1) RETURN
179c if no proc set for this node
180c nothing to do as init has been done to -1
181
182c only one proc
183 IF(ifront%P(2,iad)==0)THEN
184 cpt = cpt+1
185 tab(cpt)=ifront%P(1,iad)
186 ELSE
187c list of procs for node N
188 DO WHILE(iad/=0)
189 cpt=cpt+1
190 tab(cpt)=ifront%P(1,iad)
191 iad=ifront%P(2,iad)
192 ENDDO
193 ENDIF
194
195 RETURN
196 END
197!||====================================================================
198!|| c_ifront ../starter/source/spmd/node/ddtools.F
199!||--- called by ------------------------------------------------------
200!|| c_front ../starter/source/restart/ddsplit/c_front.F
201!||--- uses -----------------------------------------------------
202!|| front_mod ../starter/share/modules1/front_mod.F
203!||====================================================================
204 SUBROUTINE c_ifront(N,CPT)
205c returns in CPT the number of procs on which node N is sticked
206C-----------------------------------------------
207C M o d u l e s
208C-----------------------------------------------
209 USE front_mod
210C-----------------------------------------------
211C I m p l i c i t T y p e s
212C-----------------------------------------------
213#include "implicit_f.inc"
214C-----------------------------------------------
215C D u m m y A r g u m e n t s
216C-----------------------------------------------
217 INTEGER N,CPT
218C-----------------------------------------------
219C L o c a l V a r i a b l e s
220C-----------------------------------------------
221 INTEGER IAD
222C-----------------------------------------------
223C S o u r c e L i n e s
224C-----------------------------------------------
225 cpt=0
226 iad=ifront%IENTRY(n)
227c no proc set for this node
228c nothing to do as init has been done to -1
229 IF(iad==-1)THEN
230 cpt = 0
231 RETURN
232 ENDIF
233
234 IF(ifront%P(2,iad)==0)THEN
235c only one proc
236 cpt = cpt+1
237 ELSE
238c list of procs for node N
239 DO WHILE(iad/=0)
240 cpt=cpt+1
241 iad=ifront%P(2,iad)
242 ENDDO
243 ENDIF
244
245 RETURN
246 END
247!||====================================================================
248!|| nlocal ../starter/source/spmd/node/ddtools.F
249!||--- called by ------------------------------------------------------
250!|| c_crkedge ../starter/source/restart/ddsplit/c_crkedge.F
251!|| c_dampvrel ../starter/source/restart/ddsplit/c_dampvrel.F
252!|| c_doms10 ../starter/source/spmd/domdec2.F
253!|| c_front ../starter/source/restart/ddsplit/c_front.F
254!|| c_fvbag ../starter/source/airbag/c_fvbag.f
255!|| c_fxbody2 ../starter/source/restart/ddsplit/c_fxbody.F
256!|| c_ibcscyc ../starter/source/restart/ddsplit/c_ibcscyc.F
257!|| c_ibft ../starter/source/restart/ddsplit/c_ibft.F
258!|| c_ibfv ../starter/source/restart/ddsplit/c_ibfv.F
259!|| c_ibvel ../starter/source/restart/ddsplit/c_ibvel.F
260!|| c_icfield ../starter/source/restart/ddsplit/c_icfield.F
261!|| c_icnds10 ../starter/source/restart/ddsplit/c_icnds10.F
262!|| c_iloadp ../starter/source/restart/ddsplit/c_iloadp.F
263!|| c_irbe2 ../starter/source/restart/ddsplit/c_irbe2.F
264!|| c_irbe3 ../starter/source/restart/ddsplit/c_irbe3.F
265!|| c_joint_sms ../starter/source/constraints/general/cyl_joint/write_count_joint_sms.F
266!|| c_llink ../starter/source/restart/ddsplit/c_llink.F
267!|| c_mad ../starter/source/restart/ddsplit/c_mad.F
268!|| c_poro ../starter/source/restart/ddsplit/c_poro.F
269!|| c_rbyk ../starter/source/restart/ddsplit/c_rbyk.F
270!|| c_rbymk ../starter/source/restart/ddsplit/c_rbymk.F
271!|| c_rwall ../starter/source/restart/ddsplit/c_rwall.F
272!|| c_seatbelts ../starter/source/restart/ddsplit/c_seatbelts.F
273!|| c_sectio ../starter/source/restart/ddsplit/c_sectio.F
274!|| c_vois ../starter/source/restart/ddsplit/c_vois.F
275!|| domdec1 ../starter/source/spmd/domain_decomposition/domdec1.F
276!|| domdec2 ../starter/source/spmd/domdec2.F
277!|| f_nodloc2 ../starter/source/restart/ddsplit/f_nodloc2.F
278!|| fillcne ../starter/source/spmd/domdec2.F
279!|| flowdec ../starter/source/fluid/flowdec.F
280!|| globvars ../starter/source/spmd/globvars.F
281!|| hierarchy_rbody_ddm ../starter/source/constraints/general/rbody/hierarchy_rbody.F90
282!|| hm_read_rbe2 ../starter/source/constraints/general/rbe2/hm_read_rbe2.F
283!|| hm_read_rivet ../starter/source/elements/reader/hm_read_rivet.F
284!|| i24setnodes ../starter/source/interfaces/inter3d1/i24setnodes.f
285!|| ini_seatbelt ../starter/source/tools/seatbelts/ini_seatbelt.F
286!|| iniend ../starter/source/interfaces/inter3d1/iniend.F
287!|| iniend2d ../starter/source/interfaces/inter3d1/iniend.F
288!|| inirbe3 ../starter/source/constraints/general/rbe3/hm_read_rbe3.F
289!|| ipari_l_ini ../starter/source/restart/ddsplit/ipari_l_ini.F
290!|| lectur ../starter/source/starter/lectur.F
291!|| pre_cndpon ../starter/source/elements/solid/solide10/dim_s10edg.F
292!|| prepare_split_cand_i21 ../starter/source/restart/ddsplit/inter_tools.F
293!|| prepare_split_i11 ../starter/source/restart/ddsplit/inter_tools.F
294!|| prepare_split_i17 ../starter/source/restart/ddsplit/inter_tools.F
295!|| prepare_split_i20 ../starter/source/restart/ddsplit/inter_tools.F
296!|| prepare_split_i21 ../starter/source/restart/ddsplit/inter_tools.F
297!|| prepare_split_i24 ../starter/source/restart/ddsplit/inter_tools.F
298!|| prepare_split_i25 ../starter/source/restart/ddsplit/inter_tools.F
299!|| prepare_split_i8 ../starter/source/restart/ddsplit/inter_tools.F
300!|| prepare_split_i9 ../starter/source/restart/ddsplit/inter_tools.F
301!|| print_joint ../starter/source/constraints/general/cyl_joint/split_joint.F
302!|| r2r_domdec ../starter/source/coupling/rad2rad/r2r_domdec.F
303!|| r2r_split ../starter/source/coupling/rad2rad/r2r_split.F
304!|| split_cand_i11 ../starter/source/restart/ddsplit/inter_tools.F
305!|| split_cand_i20 ../starter/source/restart/ddsplit/inter_tools.F
306!|| split_cand_i20_edge ../starter/source/restart/ddsplit/inter_tools.F
307!|| split_cand_i25 ../starter/source/restart/ddsplit/inter_tools.F
308!|| split_cand_i7 ../starter/source/restart/ddsplit/inter_tools.F
309!|| split_joint ../starter/source/constraints/general/cyl_joint/split_joint.F
310!|| split_remnode_i24 ../starter/source/restart/ddsplit/inter_tools.F
311!|| split_xsav ../starter/source/restart/ddsplit/inter_tools.f
312!|| spmd_userwi_rest ../starter/source/user_interface/user_windows_tools.F
313!|| spmdset ../starter/source/constraints/general/rbody/spmdset.F
314!|| thpinit ../starter/source/output/th/thpinit.F
315!|| w_dampvrel ../starter/source/restart/ddsplit/w_dampvrel.F
316!|| w_fbft ../starter/source/restart/ddsplit/w_fbft.F
317!|| w_fi ../starter/source/restart/ddsplit/w_fi.f
318!|| w_fixvel ../starter/source/restart/ddsplit/w_fixvel.F
319!|| w_frbe3 ../starter/source/restart/ddsplit/w_frbe3.F
320!|| w_front ../starter/source/restart/ddsplit/w_front.F
321!|| w_ibcscyc ../starter/source/restart/ddsplit/w_ibcscyc.F
322!|| w_ibft ../starter/source/restart/ddsplit/w_ibft.F
323!|| w_ibfv ../starter/source/restart/ddsplit/w_ibfv.F
324!|| w_ibvel ../starter/source/restart/ddsplit/w_ibvel.F
325!|| w_icfield ../starter/source/restart/ddsplit/w_icfield.F
326!|| w_icnds10 ../starter/source/restart/ddsplit/w_icnds10.F
327!|| w_irbe2 ../starter/source/restart/ddsplit/w_irbe2.F
328!|| w_irbe3 ../starter/source/restart/ddsplit/w_irbe3.F
329!|| w_irivet ../starter/source/restart/ddsplit/w_irivet.F
330!|| w_iskn ../starter/source/restart/ddsplit/w_iskn.F
331!|| w_joint_sms ../starter/source/constraints/general/cyl_joint/write_count_joint_sms.F
332!|| w_llink ../starter/source/restart/ddsplit/w_llink.F
333!|| w_mad ../starter/source/restart/ddsplit/w_mad.F
334!|| w_main_proc_weight ../starter/source/restart/ddsplit/w_master_proc_weight.F
335!|| w_pon ../starter/source/restart/ddsplit/w_pon.F
336!|| w_poro ../starter/source/restart/ddsplit/w_poro.F
337!|| w_rbyk ../starter/source/restart/ddsplit/w_rbyk.F
338!|| w_rbymk ../starter/source/restart/ddsplit/w_rbymk.F
339!|| w_rwall ../starter/source/restart/ddsplit/w_rwall.F
340!|| w_rwar ../starter/source/restart/ddsplit/w_rwar.F
341!|| w_seatbelts ../starter/source/restart/ddsplit/w_seatbelts.F
342!|| w_secbuf ../starter/source/restart/ddsplit/w_secbuf.F
343!|| w_sectio ../starter/source/restart/ddsplit/w_sectio.F
344!|| w_th ../starter/source/restart/ddsplit/w_th.F
345!|| wrweight_rm ../starter/source/restart/ddsplit/wrweight_rm.F
346!||--- uses -----------------------------------------------------
347!|| front_mod ../starter/share/modules1/front_mod.F
348!||====================================================================
349 INTEGER FUNCTION nlocal(N,P)
350C returns 1 if node N is sticked on SPMD domain P, else returns 0
351C-----------------------------------------------
352C M o d u l e s
353C-----------------------------------------------
354 USE front_mod
355C-----------------------------------------------
356C C o m m o n B l o c k s
357C-----------------------------------------------
358#include "implicit_f.inc"
359C-----------------------------------------------
360C L o c a l V a r i a b l e s
361C-----------------------------------------------
362 INTEGER n,p,iad
363 LOGICAL psearch
364C-----------------------------------------------
365C S o u r c e L i n e s
366C-----------------------------------------------
367 psearch = .true.
368 iad = ifront%IENTRY(n)
369 nlocal = 0
370
371 ! no SPMD domain attributed for this node
372 IF(iad==-1)THEN
373 nlocal = 0
374 RETURN
375 ENDIF
376
377 !test if first proc is tested one (most frequent case)
378 IF(ifront%P(1,iad)==p)THEN
379 nlocal = 1
380 RETURN
381 ENDIF
382
383 iad = ifront%P(2,iad)
384 IF (iad==0)RETURN
385
386 DO WHILE(psearch)
387 IF(ifront%P(1,iad)==p) THEN
388 nlocal = 1
389 psearch = .false.
390 ENDIF
391 IF(ifront%P(1,iad)>p) psearch = .false.
392 IF(ifront%P(2,iad)==0) psearch = .false.
393 iad = ifront%P(2,iad)
394 ENDDO
395
396 RETURN
397 END
398
399!||====================================================================
400!|| set_front8 ../starter/source/spmd/node/ddtools.F
401!||--- called by ------------------------------------------------------
402!|| lectur ../starter/source/starter/lectur.F
403!||--- uses -----------------------------------------------------
404!|| front_mod ../starter/share/modules1/front_mod.F
405!||====================================================================
406 SUBROUTINE set_front8(IPARI,INTERCEP,INTBUF_TAB,T8,NBT8,ITAB)
407C-----------------------------------------------
408C M o d u l e s
409C-----------------------------------------------
410 USE front_mod
411 USE intbufdef_mod
412 USE int8_mod
413C-----------------------------------------------
414C I m p l i c i t T y p e s
415C-----------------------------------------------
416#include "implicit_f.inc"
417C-----------------------------------------------
418C G l o b a l P a r a m e t e r s
419C-----------------------------------------------
420#include "param_c.inc"
421C-----------------------------------------------
422C C o m m o n B l o c k s
423C-----------------------------------------------
424#include "com01_c.inc"
425#include "com04_c.inc"
426C-----------------------------------------------
427C D u m m y A r g u m e n t s
428C-----------------------------------------------
429 INTEGER IPARI(NPARI,*)
430 TYPE(intersurfp) :: INTERCEP(3,NINTER)
431 TYPE(intbuf_struct_) INTBUF_TAB(*)
432 TYPE(int8_struct_) :: T8(NSPMD,NBT8)
433 INTEGER :: NBT8,ITAB(*)
434C-----------------------------------------------
435C L o c a l V a r i a b l e s
436C-----------------------------------------------
437 INTEGER NI,K,I,PROC,P,Q,NB
438 INTEGER N1,N2,N3,N4
439 INTEGER ITY,NMN,NRTM,NM_SHARED
440 INTEGER, DIMENSION(:,:), ALLOCATABLE :: TAG,INDEX_IN_COMM
441 INTEGER, DIMENSION(:), ALLOCATABLE :: INDEX_IN_FRONT
442 INTEGER :: S_FRONT8(NSPMD,NSPMD),IDX(NSPMD)
443 INTEGER :: LOCAL_ID,II,JJ,KK,NSN
444C--------------------------------------------------------------
445
446
447 nbt8 = 1
448 DO ni=1,ninter
449 !get generic values
450 ity = ipari(7,ni)
451 nmn = ipari(6,ni)
452 nrtm = ipari(4,ni)
453 nsn = ipari(5,ni)
454
455 local_id = 0
456 IF(ity == 8) THEN
457 ALLOCATE(index_in_front(nmn))
458 index_in_front(1:nmn) = 0
459 ALLOCATE(tag(nspmd,nmn))
460 ALLOCATE(index_in_comm(nspmd,nmn))
461 tag(1:nspmd,1:nmn) = 0
462 DO k=1,nrtm
463 n1 = intbuf_tab(ni)%IRECTM(4*(k-1)+1)
464 n2 = intbuf_tab(ni)%IRECTM(4*(k-1)+2)
465 n3 = intbuf_tab(ni)%IRECTM(4*(k-1)+3)
466 n4 = intbuf_tab(ni)%IRECTM(4*(k-1)+4)
467 proc = intercep(1,ni)%P(k)
468 tag(proc,n1) = 1
469 tag(proc,n2) = 1
470 tag(proc,n3) = 1
471 tag(proc,n4) = 1
472 ENDDO
473
474 ! Compute the number of main nodes shared between
475 ! each possible couple of proc (i,j) => S_FRONT8(i,j)
476 s_front8 = 0
477 DO p = 1,nspmd
478 DO q = p+1,nspmd
479 DO k = 1,nmn
480 IF(tag(p,k) == 1 .AND. tag(q,k) == 1) THEN
481 !The main is shared between procs P and Q
482 local_id = local_id + 1
483 s_front8(p,q) = s_front8(p,q) + 1
484 s_front8(q,p) = s_front8(q,p) + 1
485 ! the kth main node will have to be communucated
486 IF( index_in_front(k) == 0) THEN
487 index_in_front(k) = local_id
488 ENDIF
489 ENDIF
490 ENDDO
491 ENDDO
492 ENDDO
493 idx(1:nspmd) = 0
494 index_in_comm(1:nspmd,1:nmn) = 0
495 !INDEX_IN_COMM give an index to the communication structures
496 ! of each main node (or 0 if the main node is not shared)
497
498 DO k = 1,nmn
499 q = 0
500 DO p = 1,nspmd
501 q = q + tag(p,k)
502 ENDDO
503 IF(q > 1) THEN
504 DO p = 1,nspmd
505 IF(tag(p,k) /= 0) THEN
506 idx(p) = idx(p) + 1
507 index_in_comm(p,k)=idx(p)
508 ENDIF
509 ENDDO
510 ENDIF
511 ENDDO
512 ! symmetric allocation of arrays of size *nb main nodes in common*
513 ! between proc P and proc Q
514 DO p = 1,nspmd
515 DO q = p+1,nspmd
516 nm_shared = s_front8(p,q)
517 t8(p,nbt8)%BUFFER(q)%NBMAIN = 0! NM_SHARED
518 ALLOCATE(t8(p,nbt8)%BUFFER(q)%MAIN_ID(nm_shared))
519 ALLOCATE(t8(p,nbt8)%BUFFER(q)%MAIN_UID(nm_shared))
520 ALLOCATE(t8(p,nbt8)%BUFFER(q)%NBSECND(nm_shared))
521 t8(p,nbt8)%BUFFER(q)%NBSECND(1:nm_shared) = 0
522 t8(q,nbt8)%BUFFER(p)%NBMAIN = 0 !NM_SHARED
523 ALLOCATE(t8(q,nbt8)%BUFFER(p)%MAIN_ID(nm_shared))
524 ALLOCATE(t8(q,nbt8)%BUFFER(p)%MAIN_UID(nm_shared))
525 ALLOCATE(t8(q,nbt8)%BUFFER(p)%NBSECND(nm_shared))
526 t8(q,nbt8)%BUFFER(p)%NBSECND(1:nm_shared) = 0
527 ENDDO
528 ENDDO
529
530
531 !Compute the total number of main nodes to exchange per
532 ! proc P
533 DO p = 1,nspmd
534 k = idx(p)
535 t8(p,nbt8)%S_COMM = k
536 ALLOCATE(t8(p,nbt8)%SPMD_COMM_PATTERN(k))
537 DO q = 1,k
538 t8(p,nbt8)%SPMD_COMM_PATTERN(q)%NUMLOC = 0
539 t8(p,nbt8)%SPMD_COMM_PATTERN(q)%NBCOM = 0
540 ALLOCATE(t8(p,nbt8)%SPMD_COMM_PATTERN(q)%PROCLIST(nspmd))
541 t8(p,nbt8)%SPMD_COMM_PATTERN(q)%PROCLIST(1:nspmd) = 0
542 ALLOCATE(t8(p,nbt8)%SPMD_COMM_PATTERN(q)%BUF_INDEX(nspmd))
543 t8(p,nbt8)%SPMD_COMM_PATTERN(q)%BUF_INDEX(1:nspmd) = 0
544 ENDDO
545 ENDDO
546
547
548
549 ! Fill the part of the structure that depends only
550 ! on main nodes
551
552 ! To optimize the communication pattern in the engine,
553 ! The data dependencies are build in a symmetric fashion:
554 ! If procs P and Q share main K main nodes, then
555 ! T8(Q,NBT8)%BUFFER(P)%MAIN_UID(1:K) =
556 ! T8(P,NBT8)%BUFFER(Q)%MAIN_UID(1:K)
557 idx(1:nspmd) = 1
558 s_front8(1:nspmd,1:nspmd) = 0
559 DO p = 1,nspmd
560 DO k = 1,nmn
561 !If the node is has to be communicated by P
562 IF(index_in_comm(p,k) > 0) THEN
563 DO q = p+1,nspmd
564 IF(index_in_comm(q,k)/=0) THEN
565! Put the main node in the boundary of P with Q
566 local_id = index_in_comm(p,k)
567 nb = t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%NBCOM +1
568 t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%PROCLIST(nb) = q
569 ii = s_front8(p,q) + 1
570 t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%BUF_INDEX(nb) = ii
571 jj = t8(p,nbt8)%BUFFER(q)%NBMAIN+1
572 t8(p,nbt8)%BUFFER(q)%MAIN_ID(ii) = k
573 t8(p,nbt8)%BUFFER(q)%MAIN_UID(ii) =
574 . itab(intbuf_tab(ni)%MSR(k))
575
576 s_front8(p,q) = ii
577 t8(p,nbt8)%BUFFER(q)%NBMAIN = jj
578 t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%NBCOM=nb
579 t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%NUMLOC = k
580
581 ! SYMMETRIC : put the node in the boundary of Q with P
582 local_id = index_in_comm(q,k)
583 nb = t8(q,nbt8)%SPMD_COMM_PATTERN(local_id)%NBCOM +1
584 t8(q,nbt8)%SPMD_COMM_PATTERN(local_id)%PROCLIST(nb) = p
585 ii = s_front8(q,p) + 1
586 t8(q,nbt8)%SPMD_COMM_PATTERN(local_id)%BUF_INDEX(nb) = ii
587 jj = t8(q,nbt8)%BUFFER(p)%NBMAIN+1
588 t8(q,nbt8)%BUFFER(p)%MAIN_ID(ii) = k
589 t8(q,nbt8)%BUFFER(p)%MAIN_UID(ii) =
590 . itab(intbuf_tab(ni)%MSR(k))
591 s_front8(q,p) = ii
592 t8(q,nbt8)%BUFFER(p)%NBMAIN = jj
593 t8(q,nbt8)%SPMD_COMM_PATTERN(local_id)%NBCOM=nb
594 t8(q,nbt8)%SPMD_COMM_PATTERN(local_id)%NUMLOC = k
595 ENDIF
596 ENDDO
597 ENDIF
598 ENDDO
599 ENDDO ! NSPMD
600
601
602 DO p =1,nspmd
603 ! Count the number of actual secnds that have a main
604 ! shared between multiples procs
605 DO i = 1,nsn
606 IF(index_in_comm(p,intbuf_tab(ni)%ILOCS(i)) > 0) THEN
607 local_id = index_in_comm(p,intbuf_tab(ni)%ILOCS(i))
608 nb = t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%NBCOM
609 DO k =1,nb
610 ii = t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%BUF_INDEX(k)
611 q = t8(p,nbt8)%SPMD_COMM_PATTERN(local_id)%PROCLIST(k)
612 t8(p,nbt8)%BUFFER(q)%NBSECND(ii) =
613 . t8(p,nbt8)%BUFFER(q)%NBSECND(ii) + 1
614 t8(p,nbt8)%BUFFER(q)%NBSECND_TOT =
615 . t8(p,nbt8)%BUFFER(q)%NBSECND_TOT + 1
616 ENDDO
617 ENDIF
618 ENDDO !NSN
619 !DO Q = 1,NSPMD
620 ! IF(Q/=P) THEN
621 ! ! Total number of secnd node that have main nodes on processor
622 ! ! P shared with processor Q
623 ! II = T8(P,NBT8)%BUFFER(Q)%NBSECND_TOT
624 ! ALLOCATE(T8(P,NBT8)%BUFFER(Q)%SECND_ID(II))
625 ! ALLOCATE(T8(P,NBT8)%BUFFER(Q)%SECND_UID(II))
626 ! T8(P,NBT8)%BUFFER(Q)%SECND_ID(1:II) = 0
627 ! T8(P,NBT8)%BUFFER(Q)%SECND_UID(1:II) = 0
628 ! NB = T8(P,NBT8)%BUFFER(Q)%NBMAIN
629 ! IF(NB > 0) THEN
630 ! ! This array will keep pointers to secnd_id per main
631 ! ALLOCATE(T8(P,NBT8)%BUFFER(Q)%BUFI(NB))
632 ! T8(P,NBT8)%BUFFER(Q)%BUFI(1) = 1
633 ! DO I = 2,NB
634 ! T8(P,NBT8)%BUFFER(Q)%BUFI(I) =
635 . ! T8(P,NBT8)%BUFFER(Q)%BUFI(I-1) +
636 . ! T8(P,NBT8)%BUFFER(Q)%NBSECND(I-1)
637 ! ENDDO
638 ! ENDIF
639 ! ENDIF
640 !ENDDO !Q = 1,NSPMD
641 !DO I = 1,NSN
642 ! IF(INTBUF_TAB(NI)%ILOCS(I) > 0 ) THEN
643 ! ! If this secnd has a main shared by multiple proc
644 ! IF(INDEX_IN_COMM(P,INTBUF_TAB(NI)%ILOCS(I)) > 0) THEN
645 ! LOCAL_ID = INDEX_IN_COMM(P,INTBUF_TAB(NI)%ILOCS(I))
646 ! NB = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%NBCOM
647 ! DO K =1,NB
648 ! II = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%BUF_INDEX(K)
649 ! Q = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%PROCLIST(K)
650 ! JJ = T8(P,NBT8)%BUFFER(Q)%BUFI(II)
651 ! T8(P,NBT8)%BUFFER(Q)%SECND_ID(JJ) = I
652 ! T8(P,NBT8)%BUFFER(Q)%SECND_UID(JJ)= ITAB(INTBUF_TAB(NI)%NSV(I))
653 ! T8(P,NBT8)%BUFFER(Q)%BUFI(II) = JJ + 1
654 ! ENDDO
655 ! ENDIF
656 ! ENDIF
657 !ENDDO !I=1,NSN
658 ENDDO
659
660! USEFUL DEBUG PRINT
661! DO P = 1,NSPMD
662! WRITE(6,*) '============== Proc',P,'===',T8(P,NBT8)%S_COMM
663! DO LOCAL_ID=1,T8(P,NBT8)%S_COMM
664! NB = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%NBCOM
665! WRITE(6,*) 'NLOC=',T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%NUMLOC,'NB=',NB
666! DO K =1,NB
667! II = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%BUF_INDEX(K)
668! Q = T8(P,NBT8)%SPMD_COMM_PATTERN(LOCAL_ID)%PROCLIST(K)
669! WRITE(6,*) 'Q=',Q,T8(P,NBT8)%BUFFER(Q)%MAIN_UID(II)
670! ENDDO
671! ENDDO
672! ENDDO
673! DO P = 1,NSPMD
674! DO Q = 1,NSPMD
675! IF(P /= Q) THEN
676! DO II = 1,T8(P,NBT8)%BUFFER(Q)%NBMAIN
677! WRITE(6,*) "EXCH",P,Q,II,T8(P,NBT8)%BUFFER(Q)%MAIN_UID(II)
678! ENDDO
679! ENDIF
680! ENDDO
681! ENDDO
682! DO P = 1, NSPMD
683! DO K = 1,T8(P,NBT8)%S_COMM
684! WRITE(6,*) P,ITAB(
685! . INTBUF_TAB(NI)%MSR(T8(P,NBT8)%SPMD_COMM_PATTERN(K)%NUMLOC))
686! ENDDO
687! ENDDO
688
689
690
691 DEALLOCATE(tag)
692 DEALLOCATE(index_in_comm)
693 DEALLOCATE(index_in_front)
694 nbt8 = nbt8 + 1
695 ENDIF !ITY == 8
696 ENDDO
697
698
699
700 END
701
702!||====================================================================
703!|| set_intercep ../starter/source/spmd/node/ddtools.F
704!||--- called by ------------------------------------------------------
705!|| lectur ../starter/source/starter/lectur.F
706!||--- calls -----------------------------------------------------
707!|| intersurfl ../starter/source/spmd/node/ddtools.F
708!||--- uses -----------------------------------------------------
709!|| front_mod ../starter/share/modules1/front_mod.F
710!|| message_mod ../starter/share/message_module/message_mod.F
711!||====================================================================
712 SUBROUTINE set_intercep(IPARI,INTERCEP,FLAG,INTBUF_TAB,ITAB,CEP)
713C-----------------------------------------------
714C M o d u l e s
715C-----------------------------------------------
716 USE message_mod
717 USE front_mod
718 USE intbufdef_mod
719C-----------------------------------------------
720C I m p l i c i t T y p e s
721C-----------------------------------------------
722#include "implicit_f.inc"
723C-----------------------------------------------
724C G l o b a l P a r a m e t e r s
725C-----------------------------------------------
726#include "param_c.inc"
727C-----------------------------------------------
728C C o m m o n B l o c k s
729C-----------------------------------------------
730#include "com04_c.inc"
731C-----------------------------------------------
732C D u m m y A r g u m e n t s
733C-----------------------------------------------
734 INTEGER IPARI(NPARI,*),FLAG,ITAB(*),CEP(*)
735 TYPE(intersurfp) :: INTERCEP(3,NINTER)
736 TYPE(intbuf_struct_) INTBUF_TAB(*)
737C-----------------------------------------------
738C E x t e r n a l F u n c t i o n s
739C-----------------------------------------------
740 INTEGER INTERSURFL
741 EXTERNAL intersurfl
742C-----------------------------------------------
743C L o c a l V a r i a b l e s
744C-----------------------------------------------
745 INTEGER ITY,NRTM,N,N1,N2,N3,N4,NSN,
746 . NRTS,N1L,N2L,N3L,N4L,NLINM,NLINS
747 INTEGER NI,K,I,PROC,IE
748C--------------------------------------------------------------
749 DO ni=1,ninter
750
751 !get generic values
752 ity = ipari(7,ni)
753
754 IF ((flag==0.AND.(ity==24.OR.(ity==25.AND.ipari(100,ni) == 0))).OR.
755 . (flag==1.AND.(ity==7.OR.ity==10.OR.
756 . ity==22.OR.ity==23)) )THEN
757
758 nrtm = ipari(4,ni)
759
760C Allocate CEP INTERFACE
761 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
762 ALLOCATE(intercep(1,ni)%P(nrtm))
763 IF(ity==25) ALLOCATE(intercep(2,ni)%P(nrtm))
764 ENDIF
765 intercep(1,ni)%P(1:nrtm)=0
766 IF(ity==25) THEN
767 IF (.NOT.(ASSOCIATED(intercep(2,ni)%P)))THEN
768 ALLOCATE(intercep(2,ni)%P(nrtm))
769 ENDIF
770 intercep(2,ni)%P(1:nrtm) = 0
771 ENDIF
772
773 DO k=1,nrtm
774 n1=intbuf_tab(ni)%IRECTM(4*(k-1)+1)
775 n2=intbuf_tab(ni)%IRECTM(4*(k-1)+2)
776 n3=intbuf_tab(ni)%IRECTM(4*(k-1)+3)
777 n4=intbuf_tab(ni)%IRECTM(4*(k-1)+4)
778 IF(n1>numnod.OR.n2>numnod.OR.
779 . n3>numnod.OR.n4>numnod) THEN
780 intercep(1,ni)%P(k) = 1
781 ELSE
782 !find first SPMD domain on which the 4 nodes of the surface are
783 proc = intersurfl(n1,n2,n3,n4)
784 intercep(1,ni)%P(k) = proc
785 ENDIF
786 ENDDO
787 ELSEIF (flag==0.AND.ity==25.AND.ipari(100,ni) > 0)THEN ! in case of solid erosion : split interface according to element proc
788 nrtm = ipari(4,ni)
789C Allocate CEP INTERFACE
790 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
791 ALLOCATE(intercep(1,ni)%P(nrtm))
792 ENDIF
793 intercep(1,ni)%P(1:nrtm)=0
794 DO k=1,nrtm
795 ie = intbuf_tab(ni)%IELEM_M(2*(k-1)+1)
796 IF(ie > 0) THEN
797 intercep(1,ni)%P(k) = cep(ie) + 1
798 ENDIF
799 ENDDO
800 ELSEIF(ity==24.AND.flag==1.AND.ipari(86,ni) > 0) THEN
801
802C Allocate CEP INTERFACE
803 nrts = ipari(3,ni)
804
805 IF (.NOT.(ASSOCIATED(intercep(3,ni)%P)))THEN
806 ALLOCATE(intercep(3,ni)%P(nrts))
807 ENDIF
808 intercep(3,ni)%P(1:nrts)=0
809
810 DO k=1,nrts
811 ! SECND SEGMENT AND ELEMENT HAVE TO ON THE SAME MPI DOMAIN (only solids/ if other CEP(OFF+IE))
812 ie = intbuf_tab(ni)%IELNRTS(k)
813 IF(ie > 0) THEN
814 proc = cep(ie)
815 intercep(3,ni)%P(k) = proc + 1
816 ENDIF
817 ENDDO
818
819 !ENDIF INTER TYPE 7, 10, 22, 23, 24, 25
820 ELSEIF (ity==8) THEN
821 nrtm = ipari(4,ni)
822
823C Allocate CEP INTERFACE
824 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
825 ALLOCATE(intercep(1,ni)%P(nrtm))
826 ENDIF
827 intercep(1,ni)%P(1:nrtm)=0
828
829 DO k=1,nrtm
830 n1=intbuf_tab(ni)%IRECTM(4*(k-1)+1)
831 n2=intbuf_tab(ni)%IRECTM(4*(k-1)+2)
832 n3=intbuf_tab(ni)%IRECTM(4*(k-1)+3)
833 n4=intbuf_tab(ni)%IRECTM(4*(k-1)+4)
834 n1=intbuf_tab(ni)%MSR(n1)
835 n2=intbuf_tab(ni)%MSR(n2)
836 n3=intbuf_tab(ni)%MSR(n3)
837 n4=intbuf_tab(ni)%MSR(n4)
838
839 !find first SPMD domain on which the 4 nodes of the surface are
840 proc = intersurfl(n1,n2,n3,n4)
841 intercep(1,ni)%P(k) = proc
842 ENDDO
843
844 ELSEIF (ity==11) THEN
845
846 nrts = ipari(3,ni)
847 nrtm = ipari(4,ni)
848
849C Allocate CEP INTERFACE
850 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
851 ALLOCATE(intercep(1,ni)%P(nrtm))
852 ENDIF
853 IF (.NOT.(ASSOCIATED(intercep(2,ni)%P)))THEN
854 ALLOCATE(intercep(2,ni)%P(nrts))
855 ENDIF
856 intercep(1,ni)%P(1:nrtm)=0
857 intercep(2,ni)%P(1:nrts)=0
858
859 DO k=1,nrtm
860 n1 = intbuf_tab(ni)%IRECTM(2*(k-1)+1)
861 n2 = intbuf_tab(ni)%IRECTM(2*(k-1)+2)
862 !find first SPMD domain on which the 2 nodes of the surface are
863 !use same generic routine with N1=N2 and N3=N4
864 proc = intersurfl(n1,n1,n2,n2)
865 intercep(1,ni)%P(k) = proc
866 ENDDO
867
868 DO k=1,nrts
869 n1 = intbuf_tab(ni)%IRECTS(2*(k-1)+1)
870 n2 = intbuf_tab(ni)%IRECTS(2*(k-1)+2)
871 !find first SPMD domain on which the 2 nodes of the surface are
872 !use same generic routine with N1=N2 and N3=N4
873 proc = intersurfl(n1,n1,n2,n2)
874 intercep(2,ni)%P(k) = proc
875 ENDDO
876
877 !ENDIF INTER TYPE 11
878 ELSEIF (ity==20) THEN
879
880 nrtm = ipari(4,ni)
881 nlins = ipari(51,ni)
882 nlinm = ipari(52,ni)
883
884C Allocate CEP INTERFACE
885 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
886 ALLOCATE(intercep(1,ni)%P(nrtm))
887 ENDIF
888 IF (.NOT.(ASSOCIATED(intercep(2,ni)%P)))THEN
889 ALLOCATE(intercep(2,ni)%P(nlinm))
890 ENDIF
891 IF (.NOT.(ASSOCIATED(intercep(3,ni)%P)))THEN
892 ALLOCATE(intercep(3,ni)%P(nlins))
893 ENDIF
894 intercep(1,ni)%P(1:nrtm) =0
895 intercep(2,ni)%P(1:nlinm)=0
896 intercep(3,ni)%P(1:nlins)=0
897
898 DO k=1,nrtm
899 n1l = intbuf_tab(ni)%IRECTM(4*(k-1)+1)
900 n2l = intbuf_tab(ni)%IRECTM(4*(k-1)+2)
901 n3l = intbuf_tab(ni)%IRECTM(4*(k-1)+3)
902 n4l = intbuf_tab(ni)%IRECTM(4*(k-1)+4)
903 n1 = intbuf_tab(ni)%NLG(n1l)
904 n2 = intbuf_tab(ni)%NLG(n2l)
905 n3 = intbuf_tab(ni)%NLG(n3l)
906 n4 = intbuf_tab(ni)%NLG(n4l)
907 !find first SPMD domain on which the 4 nodes of the surface are
908 proc = intersurfl(n1,n2,n3,n4)
909 intercep(1,ni)%P(k) = proc
910 ENDDO
911
912 DO k=1,nlinm
913 n1l = intbuf_tab(ni)%IXLINM(2*(k-1)+1)
914 n2l = intbuf_tab(ni)%IXLINM(2*(k-1)+2)
915 n1 = intbuf_tab(ni)%NLG(n1l)
916 n2 = intbuf_tab(ni)%NLG(n2l)
917 !find first SPMD domain on which the 2 nodes of the surface are
918 !use same generic routine with N1=N2 and N3=N4
919 proc = intersurfl(n1,n1,n2,n2)
920 intercep(2,ni)%P(k) = proc
921 ENDDO
922
923 DO k=1,nlins
924 n1l = intbuf_tab(ni)%IXLINS(2*(k-1)+1)
925 n2l = intbuf_tab(ni)%IXLINS(2*(k-1)+2)
926 n1 = intbuf_tab(ni)%NLG(n1l)
927 n2 = intbuf_tab(ni)%NLG(n2l)
928 !find first SPMD domain on which the 2 nodes of the surface are
929 !use same generic routine with N1=N2 and N3=N4
930 proc = intersurfl(n1,n1,n2,n2)
931 intercep(3,ni)%P(k) = proc
932 ENDDO
933
934 !ENDIF INTER TYPE 11
935 ELSEIF (ity==21) THEN
936
937 nrts = ipari(3,ni)
938
939C Allocate CEP INTERFACE
940 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
941 ALLOCATE(intercep(1,ni)%P(nrts))
942 ENDIF
943 intercep(1,ni)%P(1:nrts) =0
944
945 DO k=1,nrts
946 n1 = intbuf_tab(ni)%IRECTS(4*(k-1)+1)
947 n2 = intbuf_tab(ni)%IRECTS(4*(k-1)+2)
948 n3 = intbuf_tab(ni)%IRECTS(4*(k-1)+3)
949 n4 = intbuf_tab(ni)%IRECTS(4*(k-1)+4)
950 !find first SPMD domain on which the 4 nodes of the surface are
951 proc = intersurfl(n1,n2,n3,n4)
952 intercep(1,ni)%P(k) = proc
953 ENDDO
954
955 ENDIF !ENDIF INTER TYPE 21
956
957
958 ENDDO !ENDDO 1,NINTER
959
960 END
961
962!||====================================================================
963!|| fill_intercep ../starter/source/spmd/node/ddtools.F
964!||--- called by ------------------------------------------------------
965!|| lectur ../starter/source/starter/lectur.F
966!||--- calls -----------------------------------------------------
967!|| intersurfl ../starter/source/spmd/node/ddtools.F
968!||--- uses -----------------------------------------------------
969!|| front_mod ../starter/share/modules1/front_mod.F
970!|| message_mod ../starter/share/message_module/message_mod.F
971!||====================================================================
972 SUBROUTINE fill_intercep(IPARI,INTBUF_TAB,INTERCEP)
973C new routine called right after domdec1 to be used by interface sorting
974C-----------------------------------------------
975C M o d u l e s
976C-----------------------------------------------
977 USE message_mod
978 USE front_mod
979 USE intbufdef_mod
980C-----------------------------------------------
981C I m p l i c i t T y p e s
982C-----------------------------------------------
983#include "implicit_f.inc"
984C-----------------------------------------------
985C G l o b a l P a r a m e t e r s
986C-----------------------------------------------
987#include "param_c.inc"
988C-----------------------------------------------
989C C o m m o n B l o c k s
990C-----------------------------------------------
991#include "com04_c.inc"
992C-----------------------------------------------
993C D u m m y A r g u m e n t s
994C-----------------------------------------------
995 INTEGER IPARI(NPARI,*)
996 TYPE(intersurfp) :: INTERCEP(3,NINTER)
997 TYPE(intbuf_struct_) INTBUF_TAB(*)
998C-----------------------------------------------
999C E x t e r n a l F u n c t i o n s
1000C-----------------------------------------------
1001 INTEGER INTERSURFL
1002 EXTERNAL intersurfl
1003C-----------------------------------------------
1004C L o c a l V a r i a b l e s
1005C-----------------------------------------------
1006 INTEGER ITY,NRTM,N,N1,N2,N3,N4,NSN,
1007 . NRTS,N1L,N2L,N3L,N4L,NLINM,NLINS
1008 INTEGER NI,K,I,PROC
1009C--------------------------------------------------------------
1010 DO ni=1,ninter
1011
1012 !get generic values
1013 ity = ipari(7,ni)
1014
1015 IF (ity==7)THEN
1016
1017 nrtm = ipari(4,ni)
1018C Allocate CEP INTERFACE
1019 IF (.NOT.(ASSOCIATED(intercep(1,ni)%P)))THEN
1020 ALLOCATE(intercep(1,ni)%P(nrtm))
1021 ENDIF
1022 intercep(1,ni)%P(1:nrtm)=0
1023
1024 DO k=1,nrtm
1025 n1=intbuf_tab(ni)%IRECTM(4*(k-1)+1)
1026 n2=intbuf_tab(ni)%IRECTM(4*(k-1)+2)
1027 n3=intbuf_tab(ni)%IRECTM(4*(k-1)+3)
1028 n4=intbuf_tab(ni)%IRECTM(4*(k-1)+4)
1029 !find first SPMD domain on which the 4 nodes of the surface are
1030 IF(n1>numnod.OR.n2>numnod.OR.
1031 . n3>numnod.OR.n4>numnod) THEN
1032 intercep(1,ni)%P(k) = 1
1033 ELSE
1034 proc = intersurfl(n1,n2,n3,n4)
1035 intercep(1,ni)%P(k) = proc
1036 ENDIF
1037 ENDDO
1038
1039 ENDIF
1040
1041 ENDDO !ENDDO 1,NINTER
1042
1043 END
1044
1045!||====================================================================
1046!|| intersurfl ../starter/source/spmd/node/ddtools.f
1047!||--- called by ------------------------------------------------------
1048!|| fill_intercep ../starter/source/spmd/node/ddtools.F
1049!|| i24setnodes ../starter/source/interfaces/inter3d1/i24setnodes.F
1050!|| set_intercep ../starter/source/spmd/node/ddtools.F
1051!||--- uses -----------------------------------------------------
1052!|| front_mod ../starter/share/modules1/front_mod.F
1053!||====================================================================
1054 INTEGER FUNCTION intersurfl(N1,N2,N3,N4)
1055C-----------------------------------------------
1056C M o d u l e s
1057C-----------------------------------------------
1058 USE front_mod
1059C-----------------------------------------------
1060C C o m m o n B l o c k s
1061C-----------------------------------------------
1062#include "implicit_f.inc"
1063C-----------------------------------------------
1064C D u m m y A r g u m e n t s
1065C-----------------------------------------------
1066 INTEGER n1,n2,n3,n4
1067C-----------------------------------------------
1068C L o c a l V a r i a b l e s
1069C-----------------------------------------------
1070 INTEGER iad1,iad2,iad3,iad4,
1071 . p1,p2,p3,p4,pmax
1072 INTEGER tab(4),nn
1073 LOGICAL search
1074C-----------------------------------------------
1075C S o u r c e L i n e s
1076C-----------------------------------------------
1077 intersurfl = -1
1078 search = .true.
1079
1080 iad1 = ifront%IENTRY(n1)
1081 iad2 = ifront%IENTRY(n2)
1082 iad3 = ifront%IENTRY(n3)
1083 iad4 = ifront%IENTRY(n4)
1084
1085 DO WHILE(search)
1086 p1 = ifront%P(1,iad1)
1087 p2 = ifront%P(1,iad2)
1088 p3 = ifront%P(1,iad3)
1089 p4 = ifront%P(1,iad4)
1090 IF(p1==p2.AND.p2==p3.AND.p3==p4)THEN
1091 intersurfl = p1
1092 search = .false.
1093 ELSE
1094 pmax = max(p1,p2,p3,p4)
1095 IF(p1<pmax) iad1 = ifront%P(2,iad1)
1096 IF(p2<pmax) iad2 = ifront%P(2,iad2)
1097 IF(p3<pmax) iad3 = ifront%P(2,iad3)
1098 IF(p4<pmax) iad4 = ifront%P(2,iad4)
1099 ENDIF
1100 ENDDO
1101! IF(INTERSURFL > 4) THEN
1102! WRITE(6,*) __FILE__,__LINE__,IAD1,IAD2,IAD3,IAD4
1103! ENDIF
1104
1105 RETURN
1106 END
1107!||====================================================================
1108!|| ini_iddconnect ../starter/source/spmd/node/ddtools.F
1109!||--- called by ------------------------------------------------------
1110!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
1111!||--- uses -----------------------------------------------------
1112!|| front_mod ../starter/share/modules1/front_mod.F
1113!||====================================================================
1114 SUBROUTINE ini_iddconnect(NELEM)
1115C-----------------------------------------------
1116C M o d u l e s
1117C-----------------------------------------------
1118 USE front_mod
1119C-----------------------------------------------
1120C I m p l i c i t T y p e s
1121C-----------------------------------------------
1122#include "implicit_f.inc"
1123C-----------------------------------------------
1124C D u m m y A r g u m e n t s
1125C-----------------------------------------------
1126 INTEGER NELEM
1127C-----------------------------------------------
1128C L o c a l V a r i a b l e s
1129C-----------------------------------------------
1130 INTEGER I
1131
1132 DO i=1,nelem
1133 iddconnect%IENTRYDOM(1,i) = -1
1134 iddconnect%IENTRYDOM(2,i) = 0
1135 ENDDO
1136
1137 DO i=1, siddconnect
1138 iddconnect%PDOM(1,i) = -1
1139 iddconnect%PDOM(2,i) = -1
1140 END DO
1141
1142 iddconnect_end = nelem
1143C
1144 RETURN
1145 END
1146!||====================================================================
1147!|| realloc_iddconnect ../starter/source/spmd/node/ddtools.F
1148!||--- called by ------------------------------------------------------
1149!|| iddconnectplus ../starter/source/spmd/node/frontplus.F
1150!||--- calls -----------------------------------------------------
1151!|| ancmsg ../starter/source/output/message/message.F
1152!||--- uses -----------------------------------------------------
1153!|| front_mod ../starter/share/modules1/front_mod.F
1154!|| message_mod ../starter/share/message_module/message_mod.F
1155!||====================================================================
1156 SUBROUTINE realloc_iddconnect(NELEM)
1157C-----------------------------------------------
1158C M o d u l e s
1159C-----------------------------------------------
1160 USE message_mod
1161 USE front_mod
1162C-----------------------------------------------
1163C I m p l i c i t T y p e s
1164C-----------------------------------------------
1165#include "implicit_f.inc"
1166C-----------------------------------------------
1167C D u m m y A r g u m e n t s
1168C-----------------------------------------------
1169 INTEGER NELEM
1170C-----------------------------------------------
1171C L o c a l V a r i a b l e s
1172C-----------------------------------------------
1173 INTEGER,DIMENSION(:,:),ALLOCATABLE :: IDDCONNECT_SAVE
1174 INTEGER I, STAT
1175C-----------------------------------------------
1176C S o u r c e L i n e s
1177C-----------------------------------------------
1178 stat = 0
1179 ALLOCATE(iddconnect_save(2,siddconnect+nelem),stat=stat)
1180 IF (stat /= 0) CALL ancmsg(msgid=268,anmode=aninfo,
1181 . msgtype=msgerror,
1182 . c1='IDDCONNECT_SAVE')
1183
1184! save IDDCONNECT in IFRONT_SAVEDOM
1185 DO i=1,siddconnect
1186 iddconnect_save(1,i) = iddconnect%PDOM(1,i)
1187 iddconnect_save(2,i) = iddconnect%PDOM(2,i)
1188 ENDDO
1189 DO i=siddconnect+1,siddconnect+nelem
1190 iddconnect_save(1,i) = -1
1191 iddconnect_save(2,i) = -1
1192 ENDDO
1193
1194 CALL move_alloc(iddconnect_save, iddconnect%PDOM)
1195 siddconnect = siddconnect+nelem
1196
1197 RETURN
1198 END
1199!||====================================================================
1200!|| c_iddconnect ../starter/source/spmd/node/ddtools.F
1201!||--- called by ------------------------------------------------------
1202!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
1203!|| plist_bfs ../starter/source/spmd/node/ddtools.F
1204!||--- uses -----------------------------------------------------
1205!|| front_mod ../starter/share/modules1/front_mod.F
1206!||====================================================================
1207 SUBROUTINE c_iddconnect(N,CPT)
1208C returns in CPT the number of connected nodes
1209C-----------------------------------------------
1210C M o d u l e s
1211C-----------------------------------------------
1212 USE front_mod
1213C-----------------------------------------------
1214C I m p l i c i t T y p e s
1215C-----------------------------------------------
1216#include "implicit_f.inc"
1217C-----------------------------------------------
1218C D u m m y A r g u m e n t s
1219C-----------------------------------------------
1220 INTEGER N,CPT
1221C-----------------------------------------------
1222C L o c a l V a r i a b l e s
1223C-----------------------------------------------
1224 INTEGER IAD
1225C-----------------------------------------------
1226C S o u r c e L i n e s
1227C-----------------------------------------------
1228 cpt=0
1229 iad=iddconnect%IENTRYDOM(1,n)
1230! if no connected node
1231! nothing to do as init has been done to -1
1232 IF(iad==-1)THEN
1233 cpt = 0
1234 RETURN
1235 ENDIF
1236
1237 IF(iddconnect%PDOM(2,iad)==0)THEN
1238! only one connected node
1239 cpt = cpt+1
1240 ELSE
1241! list of connected nodes for node N
1242 DO WHILE(iad/=0)
1243 cpt=cpt+1
1244 iad=iddconnect%PDOM(2,iad)
1245 ENDDO
1246 ENDIF
1247
1248 RETURN
1249 END
1250!||====================================================================
1251!|| plist_iddconnect ../starter/source/spmd/node/ddtools.F
1252!||--- called by ------------------------------------------------------
1253!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
1254!||--- uses -----------------------------------------------------
1255!|| front_mod ../starter/share/modules1/front_mod.F
1256!||====================================================================
1257 SUBROUTINE plist_iddconnect(ADJNCY,XADJ,N)
1258C returns in "ADJNCY" nodes connected to node N
1259C CPT is the number of nodes
1260C-----------------------------------------------
1261C M o d u l e s
1262C-----------------------------------------------
1263 USE front_mod
1264C-----------------------------------------------
1265C I m p l i c i t T y p e s
1266C-----------------------------------------------
1267#include "implicit_f.inc"
1268C-----------------------------------------------
1269C D u m m y A r g u m e n t s
1270C-----------------------------------------------
1271 INTEGER TAILLE
1272 INTEGER N,ADJNCY(*),XADJ(*)
1273C-----------------------------------------------
1274C L o c a l V a r i a b l e s
1275C-----------------------------------------------
1276 INTEGER CPT,IAD
1277C-----------------------------------------------
1278C S o u r c e L i n e s
1279C-----------------------------------------------
1280 cpt=xadj(n)-1
1281 iad=iddconnect%IENTRYDOM(1,n)
1282
1283! if no connected node
1284! nothing to do as init has been done to -1
1285
1286! only one connected node
1287 IF(iddconnect%PDOM(2,iad)==0)THEN
1288 cpt = cpt+1
1289 adjncy(cpt)=iddconnect%PDOM(1,iad)
1290 ELSE
1291! list of connected nodes for node N
1292 DO WHILE(iad/=0)
1293 cpt=cpt+1
1294 adjncy(cpt)=iddconnect%PDOM(1,iad)
1295 iad=iddconnect%PDOM(2,iad)
1296 ENDDO
1297 ENDIF
1298
1299 RETURN
1300 END
1301!||====================================================================
1302!|| plist_bfs ../starter/source/spmd/node/ddtools.F
1303!||--- called by ------------------------------------------------------
1304!|| dometis ../starter/source/spmd/domain_decomposition/grid2mat.F
1305!||--- calls -----------------------------------------------------
1306!|| c_iddconnect ../starter/source/spmd/node/ddtools.F
1307!||--- uses -----------------------------------------------------
1308!|| front_mod ../starter/share/modules1/front_mod.F
1309!||====================================================================
1310 SUBROUTINE plist_bfs(NELEM,NCONNX,COLORS,ROOTS)
1311C-----------------------------------------------
1312C MODULES
1313C-----------------------------------------------
1314 USE front_mod
1315C-----------------------------------------------
1316C I m p l i c i t T y p e s
1317C-----------------------------------------------
1318#include "implicit_f.inc"
1319C-----------------------------------------------
1320C D u m m y A r g u m e n t s
1321C-----------------------------------------------
1322 INTEGER NELEM, NCONNX,
1323 . COLORS(NELEM), ROOTS(NELEM)
1324C-----------------------------------------------
1325C L o c a l V a r i a b l e s
1326C-----------------------------------------------
1327 INTEGER NVISIT, N, I
1328 INTEGER, DIMENSION(:), ALLOCATABLE :: FILE_V
1329 INTEGER, DIMENSION(:), ALLOCATABLE :: XADJ
1330 INTEGER :: FILE_NEXT, ROOT, CURRENT, LEN
1331 INTEGER :: CPT,IAD
1332C-----------------------------------------------
1333
1334 ALLOCATE(file_v(nelem))
1335 ALLOCATE(xadj(nelem+1))
1336 xadj(1:nelem+1)=0
1337 xadj(1) = 1
1338 DO i=1,nelem
1339 CALL c_iddconnect(i,len)
1340 xadj(i+1) = xadj(i) + len
1341 ENDDO
1342
1343 DO n = 1, nelem
1344 colors(n)=0
1345 END DO
1346 nvisit=0
1347 root=1 ! first element of the graph == first vertex available
1348 nconnx=0
1349
1350 DO WHILE (nvisit < nelem) ! loop until all vertices are visited
1351 nconnx = nconnx+1
1352 DO WHILE ((root <= nelem) .AND. (colors(root) /= 0))
1353 root = root + 1
1354 END DO
1355 roots(nconnx)=root ! record roots for fatest treatments
1356 file_v(1)=root
1357 file_next=2 ! new file initialized with root
1358 colors(root)=nconnx ! root marked
1359 nvisit=nvisit+1
1360 DO WHILE (file_next > 1) ! test file not nill
1361 current = file_v(file_next-1)
1362 file_next = file_next-1
1363
1364 cpt=xadj(current)-1
1365 iad=iddconnect%IENTRYDOM(1,current)
1366
1367 DO n = xadj(current), xadj(current+1)-1
1368C I = ADJNCY(N)
1369 cpt = cpt+1
1370 i=iddconnect%PDOM(1,iad)
1371 iad=iddconnect%PDOM(2,iad)
1372C
1373
1374 IF(colors(i) == 0) THEN ! vertex not treated before
1375 file_v(file_next)=i
1376 file_next = file_next+1
1377 colors(i) = nconnx
1378 nvisit=nvisit+1
1379 END IF
1380 END DO
1381 END DO
1382 END DO
1383
1384 DEALLOCATE(file_v)
1385 RETURN
1386 END
1387
subroutine c_fvbag(monvol, nodlocal, ixs, proc, nb_node, fvmain)
Definition c_fvbag.F:34
subroutine ddsplit(p, cep, cel, igeo, mat_elem, ipm, icode, iskew, iskn, insel, ibcslag, ipart, iparts, ipartq, ipartc, ipartt, ipartp, ipartr, iparttg, detonators, ipartx, npc, ixtg, group_param_tab, ixtg6, ixs, ixs10, ixs20, ixs16, ixq, ixc, ixt, ixp, ixr, itab, itabm1, gjbufi, nale, ale_connectivity, kxx, ixx, ibcl, ibfv, las, laccelm, nnlink, lllink, iparg, igrav, lgrav, ibvel, lbvel, iactiv, factiv, kinet, ipari, nprw, lprw, iexmad, npby, lpby, ixri, nstrf, ljoint, pornod, monvol, icontact, lagbuf, fr_iad, x, d, v, vr, dr, thke, dampr, damp, ms, in, tf, pm, skew, xframe, geo, eani, bufmat, bufgeo, bufsf, brmpc, gjbufr, w, veul, fill, dfill, wb, dsav, asav, msnf, spbuf, fac, vel, fsav, fzero, xlas, accelm, fbvel, gravfac, fr_wave, failwave, parts0, elbuf, rwl, rwsav, rby, rivet, secbuf, rvolu, rconx, nloc_dmg, fvmain, libagale, lenthg, lbufmat, lbufgeo, lbufsf, lenxlas, lnom_opt, lenlas, lenvolu, npts, cne, lcne, addcne, cni2, lcni2g, addcni2, cepi2, celi2, i2nsnt, probint, ddstat, pm1shf, dd_iad, kxsp, ixsp, nod2sp, cepsp, nthwa, nairwa, nmnt, l_mul_lag1, l_mul_lag, lwaspio, ipartsp, ispcond, pm1sph, wma, eigipm, eigibuf, eigrpm, iflow, rflow, memflow, iexlnk, fasolfr, iparth, fxbipm, fxbrpm, fxbnod, fxbmod, fxbglm, fxbcpm, fxbcps, fxblm, fxbfls, fxbdls, fxbdep, fxbvit, fxbacc, fxbelm, fxbsig, fxbgrvi, fxbgrvr, iadll, lll, ibmpc, lambda, lrbagale, iskwp, nskwp, isensp, nsensp, iaccp, naccp, ipart_state, mcp, temp, unitab, intstamp, iframe, clusters, partsav, ibft, fbft, ibcv, fconv, irbe3, lrbe3, frbe3, front_rm, rbym, irbym, lcrbym, inoise, fnoise, ms0, admsms, nom_sect, ispsym, sh4tree, sh3tree, ipadmesh, ibfflux, fbfflux, sh4trim, sh3trim, padmesh, msc, mstg, inc, intg, ptg, mcpc, mcptg, rcontact, acontact, pcontact, mscnd, incnd, mssa, mstr, msp, msrt, ibcr, fradia, dmelc, dmeltg, dmels, dmeltr, dmelp, dmelrt, res_sms, isphio, lprtsph, lonfsph, vsphio, sphveln, alph, ifill, ims, irbe2, lrbe2, ms_ply, zi_ply, inod_pxfem, iel_pxfem, icodply, iskwply, addcne_pxfem, cne_pxfem, cel_pxfem, ithvar, xdp, table, celsph, icfield, lcfield, cfield, msz2, itask, diag_sms, iloadp, lloadp, loadp, inod_crkxfem, iel_crkxfem, addcne_crkxfem, cne_crkxfem, cel_crkxfem, ibufssg_io, intercep, ibordnode, iedgesh, ibordedge, linale, nodedge, iedge, cep_crkxfem, iedge_tmp, crknodiad, elbuf_tab, nom_opt, lgauge, gauge, igaup, ngaup, nodlevxf, frontb_r2r, dflow, vflow, wflow, sph2sol, sol2sph, irst, elcutc, nodenr, kxfenod2elc, enrtag, intbuf_tab, i11flag, xfem_tab, lenthgr, rthbuf, ixig3d, kxig3d, knot, ipartig3d, wige, ncrkpart, indx_crk, crklvset, crkshell, crksky, crkavx, crkedge, sensors, stack, xfem_phantom, t8, tab_ump, poin_ump, sol2sph_typ, addcsrect, csrect, drape, loads, itagnd, icnds10, addcncnd, cepcnd, celcnd, cncnd, nativ_sms, i24maxnsne, multi_fvm, segquadfr, intbuf_fric_tab, subset, igrnod, igrbric, igrquad, igrsh4n, igrsh3n, igrtruss, igrbeam, igrspring, igrpart, igrsurf, igrslin, poin_part_shell, poin_part_tri, poin_part_sol, mid_pid_shell, mid_pid_tri, mid_pid_sol, tag_nm, nindx_nm, indx_nm, tag_scratch, nindx_scrt, indx_scrt, flag_24_25, numnod_l, tag_skn, multiple_skew, igrsurf_proc, knotlocpc, knotlocel, ale_elm, size_ale_elm, pinch_data, tag_skins6, ibcscyc, lbcscyc, t_monvol, indx_s, indx_q, indx_tg, face_elm_s, face_elm_q, face_elm_tg, nbr_th_monvol, ebcs_tab, kloadpinter, loadpinter, dgaploadint, s_loadpinter, len_cep, dynain_data, drapeg, user_windows, output, interfaces, number_load_cyl, loads_per_proc, python, dpl0cld, vel0cld, names_and_titles, bcs_per_proc, constraint_struct, glob_therm, pblast, rwstif_pen, sln_pen)
Definition ddsplit.F:337
subroutine c_iddconnect(n, cpt)
Definition ddtools.F:1208
subroutine plist_bfs(nelem, nconnx, colors, roots)
Definition ddtools.F:1311
subroutine realloc_iddconnect(nelem)
Definition ddtools.F:1157
subroutine plist_iddconnect(adjncy, xadj, n)
Definition ddtools.F:1258
subroutine plist_ifront(tab, n, cpt)
Definition ddtools.F:153
subroutine ini_ifront()
Definition ddtools.F:31
subroutine fill_intercep(ipari, intbuf_tab, intercep)
Definition ddtools.F:973
subroutine set_intercep(ipari, intercep, flag, intbuf_tab, itab, cep)
Definition ddtools.F:713
subroutine set_front8(ipari, intercep, intbuf_tab, t8, nbt8, itab)
Definition ddtools.F:407
subroutine realloc_ifront()
Definition ddtools.F:73
subroutine c_ifront(n, cpt)
Definition ddtools.F:205
integer function nlocal(n, p)
Definition ddtools.F:350
subroutine ini_iddconnect(nelem)
Definition ddtools.F:1115
integer function intersurfl(n1, n2, n3, n4)
Definition ddtools.F:1055
subroutine i24setnodes(ipari, intbuf_tab, intercep, itab, i24maxnsne)
Definition i24setnodes.F:38
subroutine split_cand_i7(proc, intbuf_tab, nsn, nsn_l, tag_segm2, ii_stok, multimp, ncont, noint, inacti, tag_scratch, ii_stok_l, ityp, nindx_scrt, indx_scrt, nodlocal, numnod_l, numnod, numels, len_cep, cep, type18_law151)
subroutine split_xsav(intbuf_tab, numnod_l, nsn, nsn_l, nmn, nmn_l, tag_scratch, tag_node_msr, tag_nm, nodlocal, proc, ni, i710xsav, nindx_scrt, indx_scrt)
#define max(a, b)
Definition macros.h:21
integer iddconnect_end
Definition front_mod.F:102
type(my_front) ifront
Definition front_mod.F:93
integer siddconnect
Definition front_mod.F:102
integer sifront
Definition front_mod.F:107
type(my_connectdom) iddconnect
Definition front_mod.F:101
integer ifront_end
Definition front_mod.F:107
subroutine ancmsg(msgid, msgtype, anmode, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, r1, r2, r3, r4, r5, r6, r7, r8, r9, c1, c2, c3, c4, c5, c6, c7, c8, c9, prmode)
Definition message.F:895
program starter
Definition starter.F:39
subroutine w_fi(ipari, proc, len_ia, intercep, intbuf_tab, itab, multi_fvm, tag, nindx_tag, indx_tag, nodlocal, numnod_l, len_cep, cep)
Definition w_fi.F:38