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), 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
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(i))
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
173 x0 = fourth*(x1+x2+x3+x4)
174 y0 = fourth*(y1+y2+y3+y4)
175 z0 = fourth*(z1+z2+z3+z4)
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.
187 . ymin <= yi.AND.
ymax >= yi.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 . X1,X2,X3,X4,Y1,Y2,Y3,Y4,Z1,Z2,Z3,Z4,
464 . XMINS,XMAXS,YMINS,YMAXS,ZMINS,ZMAXS,
465 . XMINM,XMAXM,YMINM,YMAXM,ZMINM,ZMAXM
469 INTEGER LIST(MVSIZ), LISTI(MVSIZ)
470 INTEGER IS,JS,LS,NLS,NLT,NSEG,NLF,II,NLS2
471 INTEGER N1L(MVSIZ),N2L(MVSIZ),(MVSIZ),M2L(MVSIZ)
472 INTEGER SG, FIRST, LAST,COUNT_CAND,CT
477 first = 1 + i_stok*itask / nthread
478 last = i_stok*(itask+1) / nthread
480 DO sg = first,last,mseg
481 nseg =
min(mseg,last-js)
491 IF(cand_s(i)<=nlinsa)
THEN
508 gapv(is)=gap_s(cand_s(i))+gap_m(cand_m(i))
509 gapv(is)=
max(gapv(is),gap)
522 gapv(is)=gap_s(cand_s(i))+gap_m(cand_m(i))
523 gapv(is)=
max(gapv(is),gap)
536 IF (stfs(l)/=zero)
THEN
542 IF (stfm(l)/=zero)
THEN
548 zmins =
min(z1,z2)-gapv(is)
549 zmaxs =
max(z1,z2)+gapv(is)
550 zminm =
min(z3,z4)-gapv(is)
551 zmaxm =
max(z3,z4)+gapv(is)
552 IF (zmaxs>=zminm.AND.zmaxm>=zmins)
THEN
575 ymins =
min(y1,y2)-gapv(is)
576 ymaxs =
max(y1,y2)+gapv(is)
577 yminm =
min(y3,y4)-gapv(is)
578 ymaxm =
max(y3,y4)+gapv(is)
579 IF (ymaxs>=yminm.AND.ymaxm>=ymins)
THEN
598 xmins =
min(x1,x2)-gapv(is)
599 xmaxs =
max(x1,x2)+gapv(is)
600 xminm =
min(x3,x4)-gapv(is)
601 xmaxm =
max(x3,x4)+gapv(is)
602 IF (xmaxs>=xminm.AND.xmaxm>=xmins)
THEN
603 cand_s(i) = -cand_s(i)
604 count_cand = count_cand+1
620 gapv(is)=
gapfie(nin)%P(cand_s(i)-nlinsa)+gap_m(cand_m(i))
621 gapv(is)=
max(gapv(is),gap)
630 ii = cand_s(i)-nlinsa
631 IF (
stifie(nin)%P(ii)/=zero)
THEN
634 z1=
xfie(nin)%P(3,nn1)
635 z2=
xfie(nin)%P(3,nn2)
637 IF (stfm(l)/=zero)
THEN
642 zmins =
min(z1,z2)-gapv(is)
643 zmaxs =
max(z1,z2)+gapv(is)
644 zminm =
min(z3,z4)-gapv(is)
645 zmaxm =
max(z3,z4)+gapv(is)
646 IF (zmaxs>=zminm.AND.zmaxm>=zmins)
THEN
660 ii = cand_s(i)-nlinsa
663 y1=
xfie(nin)%P(2,nn1)
664 y2=
xfie(nin)%P(2,nn2)
670 ymins =
min(y1,y2)-gapv(is)
671 ymaxs =
max(y1,y2)+gapv(is)
672 yminm =
min(y3,y4)-gapv(is)
673 ymaxm =
max(y3,y4)+gapv(is)
674 IF (ymaxs>=yminm.AND.ymaxm>=ymins)
THEN
683 ii = cand_s(i)-nlinsa
686 x1=
xfie(nin)%P(1,nn1)
687 x2=
xfie(nin)%P(1,nn2)
693 xmins =
min(x1,x2)-gapv(is)
694 xmaxs =
max(x1,x2)+gapv(is)
695 xminm =
min(x3,x4)-gapv(is)
696 xmaxm =
max(x3,x4)+gapv(is)
697 IF (xmaxs>=xminm.AND.xmaxm>=xmins)
THEN
698 cand_s(i) = -cand_s(i)
699 count_cand = count_cand+1
709 lskyi_count=lskyi_count+count_cand*5
710 count_remslve(nin) = count_remslve(nin) + ct
711#include "lockoff.inc"
subroutine i20optcde(cand_m, cand_s, xa, i_stok, ixlins, ixlinm, gap, nin, v, gap_s, gap_m, igap, stfs, itask, nlinsa, stfm, count_remslve)
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)