32 SUBROUTINE i20optcd(NSV ,CAND_E ,CAND_N ,XA ,I_STOK ,
33 2 IRECT ,GAP ,GAP_S ,GAP_M ,IGAP ,
34 3 STFA ,ITASK ,STF ,IFQ ,IFPEN ,
35 4 CAND_FX,CAND_FY,CAND_FZ,NIN ,NSN ,
36 5 GAPMAX ,ICURV ,COUNT_REMSLV )
44#include "implicit_f.inc"
60 INTEGER IRECT(4,*), NSV(*), CAND_E(*), CAND_N(*), IFPEN(*),
61 . I_STOK,NIN,IGAP ,ITASK, NSN, IFQ,ICURV,COUNT_REMSLV(*)
63 . XA(3,*),GAP,GAP_S(*),GAP_M(*),STFA(*),STF(*),
64 . cand_fx(*),cand_fy(*),cand_fz(*),
69 INTEGER I,L,IS,JS,LS,NLS,NLT,NSEG,NLS2,SG,FIRST,LAST,MSEG,NLF,II
70 INTEGER LIST(MVSIZ),IG(MVSIZ),IX1(MVSIZ),IX2(MVSIZ),IX3(MVSIZ),
71 . IX4(MVSIZ), LISTI(MVSIZ),IL(MVSIZ),COUNT_CAND,CT
73 . xi,x1,x2,x3,x4,yi,y1,y2,y3,y4,zi,z1,z2,z3,z4,
74 . xmin,xmax,ymin,
ymax,zmin,zmax,v12,v22,v32,v42
78 . x0,y0,z0,xxx,yyy,zzz,curv_max
83 first = 1 + i_stok*itask / nthread
84 last = i_stok*(itask+1) / nthread
86 DO sg = first,last,mseg
87 nseg =
min(mseg,last-js)
97 IF(cand_n(i)<=nsn)
THEN
114 gapv(is)=gap_s(cand_n(i))+gap_m(cand_e(i))
115 IF(gapmax/=zero)gapv(is)=
min(gapv(is),gapmax)
116 gapv(is)=
max(gapv(is),gap)
129 gapv(is)=gap_s(cand_n(i))+gap_m(cand_e
130 IF(gapmax/=zero)gapv(is)=
min(gapv(is),gapmax)
131 gapv(is)=
max(gapv(is),gap)
141#include "vectorize.inc"
146 IF(stf(l)/=zero.AND.stfa(nsv(cand_n(i)))/=zero)
THEN
152 il(is) = nsv(cand_n(i))
173 x0 = fourth*(x1+x2+x3+x4)
174 y0 = fourth*(y1+y2+y3+y4)
175 z0 = fourth*(z1+z2+z3+z4)
176 xxx=
max(x1,x2,x3,x4)-
min(x1,x2,x3,x4)
177 yyy=
max(y1,y2,y3,y4)-
min(y1,y2,y3,y4)
178 zzz=
max(z1,z2,z3,z4)-
min(z1,z2,z3,z4)
179 curv_max = half *
max(xxx,yyy,zzz)
180 xmin = x0-curv_max-gapv(is)
181 ymin = y0-curv_max-gapv(is)
182 zmin = z0-curv_max-gapv(is)
183 xmax = x0+curv_max+gapv(is)
184 ymax = y0+curv_max+gapv(is)
185 zmax = z0+curv_max+gapv(is)
186 IF (xmin <= xi.AND.xmax >= xi.AND.
188 . zmin <= zi.AND.zmax >= zi) cand_n(i) = -cand_n(i)
197 IF(stf(l)/=zero.AND.stfa(nsv(cand_n(i)))/=zero)
THEN
198 il(is) = nsv(cand_n(i))
209 zmin =
min(z1,z2,z3,z4)-gapv(is)
210 zmax =
max(z1,z2,z3,z4)+gapv(is)
211 IF (zmin<=zi.AND.zmax>=zi)
THEN
229 ymin =
min(y1,y2,y3,y4)-gapv(is)
230 ymax =
max(y1,y2,y3,y4)+gapv(is)
231 IF (ymin<=yi.AND.
ymax>=yi)
THEN
246 xmin =
min(x1,x2,x3,x4)-gapv(is)
247 xmax =
max(x1,x2,x3,x4)+gapv(is)
248 IF (xmin<=xi.AND.xmax>=xi)
THEN
250 cand_n(i) = -cand_n(i)
251 count_cand = count_cand+1
268 gapv(is)=
gapfi(nin)%P(cand_n(i)-nsn)+gap_m(cand_e(i))
269 gapv(is)=
min(gapv(is),gapmax)
270 gapv(is)=
max(gapv(is),gap)
276 gapv(is)=
gapfi(nin)%P(cand_n(i)-nsn)+gap_m(cand_e(i))
277 gapv(is)=
max(gapv(is),gap)
287 IF(stf(l)/=zero.AND.
stifi(nin)%P(ii)/=zero)
THEN
288 xi =
xfi(nin)%P(1,ii)
289 yi =
xfi(nin)%P(2,ii)
290 zi =
xfi(nin)%P(3,ii)
307 x0 = fourth*(x1+x2+x3+x4)
308 y0 = fourth*(y1+y2+y3+y4)
309 z0 = fourth*(z1+z2+z3+z4)
310 xxx=
max(x1,x2,x3,x4)-
min(x1,x2,x3,x4)
311 yyy=
max(y1,y2,y3,y4)-
min(y1,y2,y3,y4)
312 zzz=
max(z1,z2,z3,z4)-
min(z1,z2,z3,z4)
313 curv_max = half *
max(xxx,yyy,zzz)
314 xmin = x0-curv_max-gapv(is)
315 ymin = y0-curv_max-gapv(is)
316 zmin = z0-curv_max-gapv(is)
317 xmax = x0+curv_max+gapv(is)
318 ymax = y0+curv_max+gapv(is)
319 zmax = z0+curv_max+gapv(is)
320 IF (xmin <= xi.AND.xmax >= xi.AND.
321 . ymin <= yi.AND.
ymax >= yi.AND.
322 . zmin <= zi.AND.zmax >= zi)
THEN
323 cand_n(i) = -cand_n(i)
324 count_cand = count_cand+1
337 IF(stf(l)/=zero.AND.
stifi(nin)%P(ii)/=zero)
THEN
338 zi =
xfi(nin)%P(3,ii)
347 zmin =
min(z1,z2,z3,z4)-gapv(is)
348 zmax =
max(z1,z2,z3,z4)+gapv(is)
349 IF (zmin<=zi.AND.zmax>=zi)
THEN
368 ymin =
min(y1,y2,y3,y4)-gapv(is)
369 ymax =
max(y1,y2,y3,y4)+gapv(is)
370 IF (ymin<=yi.AND.
ymax>=yi)
THEN
380 xi =
xfi(nin)%P(1,ii)
385 xmin =
min(x1,x2,x3,x4)-gapv(is)
386 xmax =
max(x1,x2,x3,x4)+gapv(is)
387 IF (xmin<=xi.AND.xmax>=xi)
THEN
388 cand_n(i) = -cand_n(i)
389 count_cand = count_cand+1
399 IF (itask == 0 .AND. ifq > 0)
THEN
401 IF (ifpen(i) == 0)
THEN
411 lskyi_count=lskyi_count+count_cand*5
412 count_remslv(nin) = count_remslv(nin)+ct
413#include "lockoff.inc"
427 2 IXLINS ,IXLINM ,GAP ,NIN ,
428 3 V ,GAP_S ,GAP_M ,IGAP ,
429 4 STFS ,ITASK ,NLINSA ,STFM ,
438#include "implicit_f.inc"
439#include "comlock.inc"
443#include "mvsiz_p.inc"
447 INTEGER IXLINS(2,*),IXLINM(2,*), CAND_M(*), CAND_S(*),
448 . I_STOK, NIN,IGAP ,ITASK, NLINSA,COUNT_REMSLVE(*)
450 . XA(3,*),GAP,GAP_S(*),GAP_M(*),V(3,*),STFS(*), STFM(*)
455#include "com01_c.inc"
456#include "param_c.inc"
457#include "parit_c.inc"
461 INTEGER I , L, NN1, NN2
463 . XI,X1,X2,,X4,YI,Y1,Y2,Y3,Y4,ZI,Z1,Z2,Z3,Z4,
464 . XMINS,XMAXS,,YMAXS,ZMINS,ZMAXS,
465 . XMINM,XMAXM,YMINM,YMAXM,ZMINM,,
469 . gapv(mvsiz),dtti(mvsiz)
470 INTEGER LIST(MVSIZ), LISTI(MVSIZ)
471 INTEGER IS,JS,LS,NLS,NLT,NSEG,NLF,II,NLS2
472 INTEGER N1L(MVSIZ),N2L(MVSIZ),M1L(MVSIZ),M2L(MVSIZ)
473 INTEGER SG, FIRST, LAST
478 first = 1 + i_stok*itask / nthread
479 last = i_stok*(itask+1) / nthread
481 DO sg = first,last,mseg
482 nseg =
min(mseg,last-js)
492 IF(cand_s(i)<=nlinsa)
THEN
509 gapv(is)=gap_s(cand_s(i))+gap_m(cand_m(i))
510 gapv(is)=
max(gapv(is),gap)
523 gapv(is)=gap_s(cand_s(i))+gap_m(cand_m(i))
524 gapv(is)=
max(gapv(is),gap)
537 IF (stfs(l)/=zero)
THEN
543 IF (stfm(l)/=zero)
THEN
549 zmins =
min(z1,z2)-gapv(is)
550 zmaxs =
max(z1,z2)+gapv(is)
551 zminm =
min(z3,z4)-gapv(is)
552 zmaxm =
max(z3,z4)+gapv(is)
553 IF (zmaxs>=zminm.AND.zmaxm>=zmins)
THEN
576 ymins =
min(y1,y2)-gapv(is)
577 ymaxs =
max(y1,y2)+gapv(is)
578 yminm =
min(y3,y4)-gapv(is)
579 ymaxm =
max(y3,y4)+gapv(is)
580 IF (ymaxs>=yminm.AND.ymaxm>=ymins)
THEN
599 xmins =
min(x1,x2)-gapv(is)
600 xmaxs =
max(x1,x2)+gapv(is)
601 xminm =
min(x3,x4)-gapv(is)
602 xmaxm =
max(x3,x4)+gapv(is)
603 IF (xmaxs>=xminm.AND.xmaxm>=xmins)
THEN
604 cand_s(i) = -cand_s(i)
605 count_cand = count_cand+1
621 gapv(is)=
gapfie(nin)%P(cand_s(i)-nlinsa)+gap_m(cand_m(i))
622 gapv(is)=
max(gapv(is),gap)
631 ii = cand_s(i)-nlinsa
632 IF (
stifie(nin)%P(ii)/=zero)
THEN
636 z2=
xfie(nin)%P(3,nn2)
638 IF (stfm(l)/=zero)
THEN
643 zmins =
min(z1,z2)-gapv(is)
644 zmaxs =
max(z1,z2)+gapv(is)
645 zminm =
min(z3,z4)-gapv(is)
646 zmaxm =
max(z3,z4)+gapv(is)
647 IF (zmaxs>=zminm.AND.zmaxm>=zmins)
THEN
661 ii = cand_s(i)-nlinsa
664 y1=
xfie(nin)%P(2,nn1)
665 y2=
xfie(nin)%P(2,nn2)
671 ymins =
min(y1,y2)-gapv(is)
672 ymaxs =
max(y1,y2)+gapv(is)
673 yminm =
min(y3,y4)-gapv(is)
674 ymaxm =
max(y3,y4)+gapv(is)
675 IF (ymaxs>=yminm.AND.ymaxm>=ymins)
THEN
684 ii = cand_s(i)-nlinsa
687 x1=
xfie(nin)%P(1,nn1)
688 x2=
xfie(nin)%P(1,nn2)
694 xmins =
min(x1,x2)-gapv(is)
695 xmaxs =
max(x1,x2)+gapv(is)
696 xminm =
min(x3,x4)-gapv(is)
697 xmaxm =
max(x3,x4)+gapv(is)
698 IF (xmaxs>=xminm.AND.xmaxm>=xmins)
THEN
699 cand_s(i) = -cand_s(i)
700 count_cand = count_cand+1
710 lskyi_count=lskyi_count+count_cand*5
711 count_remslve(nin) = count_remslve(nin) + ct
712#include "lockoff.inc"
subroutine i20optcd(nsv, cand_e, cand_n, xa, i_stok, irect, gap, gap_s, gap_m, igap, stfa, itask, stf, ifq, ifpen, cand_fx, cand_fy, cand_fz, nin, nsn, gapmax, icurv, count_remslv)