34
35
36
37
38
39
40
41
42
44
45
46
47#include "implicit_f.inc"
48
49
50
51#include "com04_c.inc"
52
53
54
55 TYPE (CLUSTER_) ,DIMENSION(NCLUSTER) :: CLUSTER
56
57
58
59 INTEGER I, J,K, IEL, NEL,NELG,
60 INTEGER II,IFAIL,ITY,ID,RL,IL
61 INTEGER ILCLUSTER(NCLUSTER),RLCLUSTER(NCLUSTER)
62 INTEGER RLCLUSTER_MAX,ILCLUSTER_MAX
64 . DIMENSION(:), ALLOCATABLE :: rcltab
65 INTEGER, DIMENSION(:), ALLOCATABLE :: ICLTAB
66
67
68 IF(ncluster > 0) THEN
69 ilcluster(1:ncluster) = 0
70 rlcluster(1:ncluster) = zero
71 ENDIF
72 rlcluster_max = 0
73 ilcluster_max = 0
74
75 DO i = 1, ncluster
76 ity = cluster(i)%TYPE
77 nel = cluster(i)%NEL
78 nnod = cluster(i)%NNOD
79 ifail = cluster(i)%IFAIL
80 ilcluster(i) = 8 + 2 * (nel + nnod)
81 rlcluster(i) = 1
82 IF (ifail > 0) rlcluster(i) = rlcluster(i) + 4
83 IF (ifail == 3) rlcluster(i) = rlcluster(i) + 8
84 IF ( rlcluster_max < rlcluster(i) ) THEN
85 rlcluster_max = rlcluster(i)
86 ENDIF
87 IF ( ilcluster_max < ilcluster(i) ) THEN
88 ilcluster_max = ilcluster(i)
89 ENDIF
90 ENDDO
91
92 IF(ncluster > 0) THEN
95 ALLOCATE (icltab(ilcluster_max))
96 ALLOCATE (rcltab(rlcluster_max))
97 ENDIF
98
99 DO i = 1, ncluster
100 icltab(1:ilcluster(i)) = 0
101 rcltab(1:rlcluster(i)) = zero
102 il = 0
103 rl = 0
104 icltab(il+1) = cluster(i)%ID
105 icltab(il+2) = cluster(i)%TYPE
106 icltab(il+3) = cluster(i)%IFAIL
107 icltab(il+4) = cluster(i)%IGR
108 icltab(il+5) = cluster(i)%NEL
109 icltab(il+6) = cluster(i)%NNOD
110 icltab(il+7) = cluster(i)%SKEW
111 icltab(il+8) = cluster(i)%OFF
112 il = il + 8
113 rcltab(rl+1) = cluster(i)%FAIL
114 rl = rl + 1
115 nel = cluster(i)%NEL
116 nnod = cluster(i)%NNOD
117
118 DO j = 1,nel
119 id = cluster(i)%ELEM(j)
120 icltab(il + j) = cluster(i)%NG(j)
121 icltab(il + j+nel) =
id
122 ENDDO
123
124 il = il + nel*2
125 DO j = 1,nnod
126 icltab(il + j) = cluster(i)%NOD1(j)
127 icltab(il + j+nnod) = cluster(i)%NOD2(j)
128 ENDDO
129
130 il = il + nnod*2
131 IF (cluster(i)%IFAIL > 0) THEN
132 rcltab(rl + 1) = cluster(i)%FMAX(1)
133 rcltab(rl + 2) = cluster(i)%FMAX(2)
134 rcltab(rl + 3) = cluster(i)%MMAX(1)
135 rcltab(rl + 4) = cluster(i)%MMAX(2)
136 rl = rl + 4
137 ENDIF
138
139 IF (cluster(i)%IFAIL == 3) THEN
140 rcltab(rl + 1) = cluster(i)%AX(1)
141 rcltab(rl + 2) = cluster(i)%AX(2)
142 rcltab(rl + 3) = cluster(i)%AX(3)
143 rcltab(rl + 4) = cluster(i)%AX(4)
144 rcltab(rl + 5) = cluster(i)%NX(1)
145 rcltab(rl + 6) = cluster(i)%NX(2)
146 rcltab(rl + 7) = cluster(i)%NX(3)
147 rcltab(rl + 8) = cluster(i)%NX(4)
148 ENDIF
149
152
153 ENDDO
154
155 IF(ncluster > 0) THEN
156 DEALLOCATE (rcltab)
157 DEALLOCATE (icltab)
158 ENDIF
159
160
161
162 RETURN
subroutine write_db(a, n)
void write_i_c(int *w, int *len)