113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
137
138
139
140#include "implicit_f.inc"
141
142
143
144
145#include "com04_c.inc"
146
147
148
149 INTEGER JCLAUSE
150 LOGICAL :: IS_AVAILABLE
151 INTEGER, INTENT(IN), DIMENSION(NSUBS,2) :: ISUBSM
152
153 TYPE (SET_) :: CLAUSE
154 TYPE(SUBMODEL_DATA),INTENT(IN):: LSUBMODEL(*)
155 TYPE () , DIMENSION(NSUBS) :: SUBSET
156
157
158
159 INTEGER ,IDS,NINDX,LIST_SIZE,IDS_MAX,SUBSM,PARTM,ISET,IP
160 INTEGER IWORK(70000)
161
162 INTEGER, ALLOCATABLE, DIMENSION(:) :: SUBS_READ_TMP,SORTED_SUBS,INDEXS,
163 . ,SORTED_PARTS,INDEXP
164
165 INTEGER SET_USRTOS
167
168
170
171 ALLOCATE(subs_read_tmp(ids_max))
172 ALLOCATE(sorted_subs(ids_max))
173
174 ALLOCATE(part_read_tmp(npart))
175 ALLOCATE(sorted_parts(npart))
176
177 ALLOCATE(indexs(2*ids_max))
178 indexs = 0
179
180 ALLOCATE(indexp(2*npart))
181 indexp = 0
182
183 nindx = 0
184 list_size = 0
185
186
187
188 DO i=1,ids_max
190
192 IF(subsm == 0)THEN
193
194 CALL ancmsg(msgid=1902,anmode=aninfo,
195 . msgtype=msgwarning,
196 . i1 = clause%SET_ID,
197 . i2=ids,
198 . c1=trim(clause%TITLE),
199 . c2='SUBSET')
200 ELSE
201
202 subsm=isubsm(subsm,2)
203
204 nindx=nindx+1
205 subs_read_tmp(nindx) = subsm
206 ENDIF
207
208 ENDDO
209
210
211
212
213
214 iwork(:) = 0
215 DO i=1,nindx
216 indexs(i) = i
217 ENDDO
218 CALL my_orders(0,iwork,subs_read_tmp,indexs,nindx,1)
219
220 DO i=1,nindx
221 sorted_subs(i) = subs_read_tmp(indexs(i))
222 ENDDO
223
224 CALL remove_duplicates(sorted_subs,nindx,list_size)
225
226
227
228
229
230 nindx = 0
231 DO i=1,list_size
232 iset = sorted_subs(i)
233 DO ip=1,subset(iset)%NTPART
234
235 partm = subset(iset)%TPART(ip)
236
237 nindx=nindx+1
238 part_read_tmp(nindx) = partm
239 ENDDO
240 ENDDO
241
242
243
244
245
246 iwork(:) = 0
247 DO i=1,nindx
248 indexp(i) = i
249 ENDDO
250 CALL my_orders(0,iwork,part_read_tmp,indexp,nindx,1)
251
252 DO i=1,nindx
253 sorted_parts(i) = part_read_tmp(indexp(i))
254 ENDDO
255
256 list_size = 0
257 CALL remove_duplicates(sorted_parts,nindx,list_size)
258
259
260
261
262 clause%NB_PART = list_size
263 ALLOCATE( clause%PART( list_size ) )
264
265 DO i=1,list_size
266 clause%PART(i) = sorted_parts(i)
267 ENDDO
268
269
270
271 DEALLOCATE(subs_read_tmp)
272 DEALLOCATE(sorted_subs)
273 DEALLOCATE(indexs)
274 DEALLOCATE(part_read_tmp)
275 DEALLOCATE(sorted_parts)
276 DEALLOCATE(indexp)
277
278 RETURN
subroutine hm_get_int_array_2indexes(name, ival, index1, index2, is_available, lsubmodel)
subroutine hm_get_int_array_index(name, ival, index, is_available, lsubmodel)
integer function set_usrtos(iu, ipartm1, npart)
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
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)