36
37
38
40 USE intbufdef_mod
43
44
45
46#include "implicit_f.inc"
47
48
49
50#include "assert.inc"
51#include "param_c.inc"
52#include "com04_c.inc"
53
54
55
56 INTEGER, INTENT(IN) :: NSPMD
57 INTEGER, INTENT(IN) :: IPARI(NPARI,*)
58 TYPE(INTERSURFP), INTENT(IN) :: INTERCEP(3,NINTER)
59 TYPE(INTBUF_STRUCT_),INTENT(INOUT) :: INTBUF_TAB(*)
60
61
62
63 INTEGER :: IEDGE
64 INTEGER :: ISPMD
65 INTEGER ::
66 INTEGER :: NIN
67 INTEGER :: I,J,K, NRTM, NTY, CS,CM
68 INTEGER :: SH_EDGE,SOL_EDGE
69 INTEGER, DIMENSION(:), ALLOCATABLE :: CEP_EDGE,CEPM
70 INTEGER, DIMENSION(:), ALLOCATABLE :: LOCAL_ID_EDG
71 INTEGER, DIMENSION(:), ALLOCATABLE :: LOCAL_ID_SEG
72 INTEGER, DIMENSION(:), ALLOCATABLE :: LOCAL_ID
73
74 INTEGER :: nbCand, nbCandE2E, nbCandE2S, sizeM
75 INTEGER, DIMENSION(:), ALLOCATABLE :: CANDS,CANDM
76 INTEGER, DIMENSION(:), ALLOCATABLE :: localIdx
77 INTEGER, DIMENSION(:,:), ALLOCATABLE :: secondaryRemoteCount
78 INTEGER :: LOCAL_CAND_COUNT(NSPMD)
79
82
83 DO nin = 1,ninter
84 nty=ipari(7,nin)
85 iedge = ipari(58,nin)
86 sol_edge =iedge/10
87 sh_edge =iedge-10*sol_edge
88
89 IF(nty/=25 .OR. iedge==0) cycle
90 nedge = ipari(68,nin)
91 nrtm = ipari(4,nin)
92 ALLOCATE(cep_edge(nedge))
93 ALLOCATE(local_id_edg(nedge))
94 ALLOCATE(local_id_seg(nrtm))
96 . intbuf_tab(nin)%LEDGE,
97 . intercep(1,nin)%P,
98 . local_id_seg,
99 . cep_edge,
100 . local_id_edg)
101
102 nbcande2e = intbuf_tab(nin)%I_STOK_E(1)
103 nbcande2s = intbuf_tab(nin)%I_STOK_E(2)
104
105
106 nbcand = nbcande2e + nbcande2s
107 ALLOCATE(localidx(nbcand))
108 ALLOCATE(secondaryremotecount(nspmd,nspmd))
109 ALLOCATE(candm(nbcand))
110 ALLOCATE(cands(nbcand))
111 ALLOCATE(cepm(nedge+nrtm))
112 ALLOCATE(local_id(nedge+nrtm))
113 local_id(1:nedge) = local_id_edg(1:nedge)
114 local_id(nedge+1:nedge+nrtm) = local_id_seg(1:nrtm)
115
116 sizem = nedge + nrtm
117 candm(1:nbcande2e) = intbuf_tab(nin)%CANDM_E2E(1:nbcande2e)
118 cands(1:nbcande2e) = intbuf_tab(nin)%CANDS_E2E(1:nbcande2e)
119 candm(nbcande2e+1:nbcand) = nedge + intbuf_tab(nin)%CANDM_E2S(1:nbcande2s)
120 cands(nbcande2e+1:nbcand) = intbuf_tab(nin)%CANDS_E2S(1:nbcande2s)
121 cepm(1:nedge) = cep_edge(1:nedge)
122 cepm(nedge+1:nedge+nrtm) = intercep(1,nin)%P(1:nrtm) - 1
123
125 . sizem,
126 . cepm,
127 . local_id,
128 . candm,
129 . nedge,
130 . cep_edge,
131 . local_id_edg,
132 . cands,
133 . nspmd,
134 . secondaryremotecount,
135 . localidx)
136
137 DO i = 1,nspmd
139 ALLOCATE(
i25_fie(nin,i)%NEDGE(nspmd))
140 i25_fie(nin,i)%NEDGE(1:nspmd) = 0
141 DO j = 1,nspmd
142 i25_fie(nin,i)%NEDGE(j) =
i25_fie(nin,i)%NEDGE(j) + secondaryremotecount(j,i)
143 i25_fie(nin,i)%NEDGE_TOT =
i25_fie(nin,i)%NEDGE_TOT + secondaryremotecount(j,i)
144 ENDDO
147
148 ENDDO
149
150 local_cand_count(1:nspmd) = 0
151 DO i = 1, nbcande2e
152 cm = cepm(intbuf_tab(nin)%CANDM_E2E(i)) + 1
153 local_cand_count(cm) = 1 + local_cand_count(cm)
154 ENDDO
155 DO i = 1, nspmd
157
161 local_cand_count(i) = 0
162 ENDDO
163 DO i = 1, nbcande2e
164 j = cepm(intbuf_tab(nin)%CANDM_E2E(i)) + 1
165 local_cand_count(j) = 1 + local_cand_count(j)
166 k = local_cand_count(j)
168 assert(candm(i) > 0)
171 IF(cands(i) < 0) THEN
172 i25_fie(nin,j)%ID(abs(cands(i))) = localidx(i)
173 assert(localidx(i) > 0)
174 ENDIF
175
176
177 ENDDO
178
179
180 local_cand_count(1:nspmd) = 0
181 DO i = 1, nbcande2s
182 cm = cepm(intbuf_tab(nin)%CANDM_E2S(i) + nedge ) + 1
183 local_cand_count(cm) = 1 + local_cand_count(cm)
184 ENDDO
185 DO i = 1, nspmd
190 local_cand_count(i) = 0
191 ENDDO
192 DO i = 1, nbcande2s
193 j = cepm(intbuf_tab(nin)%CANDM_E2S(i) + nedge) + 1
194 local_cand_count(j) = 1 + local_cand_count(j)
195 k = local_cand_count(j)
196
200 IF(cands(i+nbcande2e) < 0) THEN
201 i25_fie(nin,j)%ID(abs(cands(i+nbcande2e))) = localidx(i+nbcande2e)
202 assert(localidx(i+nbcande2e) > 0 )
203 ENDIF
204
205
206 ENDDO
207
208
209
210
211
212
213
214
215
216 DEALLOCATE(candm)
217 DEALLOCATE(cands)
218 DEALLOCATE(localidx)
219 DEALLOCATE(secondaryremotecount)
220 DEALLOCATE(cepm)
221 DEALLOCATE(cep_edge)
222 DEALLOCATE(local_id_seg)
223 DEALLOCATE(local_id_edg)
224 DEALLOCATE(local_id)
225
226 ENDDO
type(i25_fie_), dimension(:,:), allocatable i25_fie
type(i25_cand_), dimension(:,:), allocatable i25_split_cand
subroutine local_edge_numbering(nedge, nrtm, nspmd, ledge, cep_seg, local_id_seg, cep_edge, local_id_edg)