hdiff output

r33456/congrad.f90 2017-11-09 22:30:18.109031258 +0000 r33455/congrad.f90 2017-11-09 22:30:18.553037157 +0000
471:    G2INT(1:3)=G2INT(1:3)/DINT471:    G2INT(1:3)=G2INT(1:3)/DINT
472: ENDIF472: ENDIF
473: 473: 
474: ! PRINT '(A,3G12.5,L5)','D2,D1,DINT,NOINT=',D2,D1,DINT,NOINT474: ! PRINT '(A,3G12.5,L5)','D2,D1,DINT,NOINT=',D2,D1,DINT,NOINT
475: 475: 
476: END SUBROUTINE MINMAXD2476: END SUBROUTINE MINMAXD2
477: 477: 
478: SUBROUTINE MINMAXD2R(R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ, &478: SUBROUTINE MINMAXD2R(R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ, &
479:   &                 D2,D1,DINT,DSQ2,DSQ1,DSQI,G1,G2,G1INT,G2INT,NOINT,DEBUG,INTCONSTRAINREPCUT)479:   &                 D2,D1,DINT,DSQ2,DSQ1,DSQI,G1,G2,G1INT,G2INT,NOINT,DEBUG,INTCONSTRAINREPCUT)
480: IMPLICIT NONE480: IMPLICIT NONE
481: DOUBLE PRECISION R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ,D2,D1,DINT, DUMMY2481: DOUBLE PRECISION R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ,D2,D1,DINT
482: DOUBLE PRECISION G1(3),G2(3),G1INT(3),G2INT(3),INTCONSTRAINREPCUT482: DOUBLE PRECISION G1(3),G2(3),G1INT(3),G2INT(3),INTCONSTRAINREPCUT
483: DOUBLE PRECISION DSQ2, DSQ1, DSQI, r1apr2bmr2amr1bsq, r1amr1bsq, r2amr2bsq483: DOUBLE PRECISION DSQ2, DSQ1, DSQI, r1apr2bmr2amr1bsq, r1amr1bsq, r2amr2bsq
484: DOUBLE PRECISION r1amr1bdr2amr2b, r1amr1bdr2amr2bsq, DUMMY484: DOUBLE PRECISION r1amr1bdr2amr2b, r1amr1bdr2amr2bsq, DUMMY
485: LOGICAL NOINT, DEBUG485: LOGICAL NOINT, DEBUG
486:  
487: G1(1)=r1ax - r1bx 
488: G1(2)=r1ay - r1by 
489: G1(3)=r1az - r1bz 
490: G2(1)=r2ax - r2bx 
491: G2(2)=r2ay - r2by 
492: G2(3)=r2az - r2bz 
493: r1amr1bdr2amr2b=G1(1)*G2(1)+G1(2)*G2(2)+G1(3)*G2(3) 
494: !486: !
495: ! Squared distance between atoms A and B for theta=0 - distance in image 2487: ! Squared distance between atoms A and B for theta=0 - distance in image 2
496: !488: !
497: DSQ2=G2(1)**2 + G2(2)**2 + G2(3)**2489: DSQ2=r2ax**2 + r2ay**2 + r2az**2 + r2bx**2 + r2by**2 + r2bz**2 - 2*(r2ax*r2bx + r2ay*r2by + r2az*r2bz)
498: !490: !
499: ! Squared distance between atoms A and B for theta=Pi/2 - distance in image 1491: ! Squared distance between atoms A and B for theta=Pi/2 - distance in image 1
500: !492: !
501: DSQ1=G1(1)**2 + G1(2)**2 + G1(3)**2493: DSQ1=r1ax**2 + r1ay**2 + r1az**2 + r1bx**2 + r1by**2 + r1bz**2 - 2*(r1ax*r1bx + r1ay*r1by + r1az*r1bz)
502: !494: !
503: ! Is there an internal extremum?495: ! Is there an internal extremum?
504: !496: !
505: r1apr2bmr2amr1bsq=DSQ1+DSQ2-2.0D0*r1amr1bdr2amr2b497: r1apr2bmr2amr1bsq=(r1ax-r1bx-r2ax+r2bx)**2+(r1ay-r1by-r2ay+r2by)**2+(r1az-r1bz-r2az+r2bz)**2
 498: ! PRINT '(A,G20.10)','r1apr2bmr2amr1bsq=',r1apr2bmr2amr1bsq
506: IF (r1apr2bmr2amr1bsq.EQ.0.0D0) THEN499: IF (r1apr2bmr2amr1bsq.EQ.0.0D0) THEN
507:    DUMMY=2.0D0 ! just to skip the internal solution500:    DUMMY=2.0D0 ! just to skip the internal solution
508:    WRITE(*, '(A,G20.10)') 'r1apr2bmr2amr1bsq=',r1apr2bmr2amr1bsq501:    WRITE(*, '(A,G20.10)') 'r1apr2bmr2amr1bsq=',r1apr2bmr2amr1bsq
509:    WRITE(*, '(A,3G20.10)') 'R1AX,R1AY,R1AZ=',R1AX,R1AY,R1AZ502:    WRITE(*, '(A,3G20.10)') 'R1AX,R1AY,R1AZ=',R1AX,R1AY,R1AZ
510:    WRITE(*, '(A,3G20.10)') 'R2AX,R2AY,R2AZ=',R2AX,R2AY,R2AZ503:    WRITE(*, '(A,3G20.10)') 'R2AX,R2AY,R2AZ=',R2AX,R2AY,R2AZ
511:    WRITE(*, '(A,3G20.10)') 'R1BX,R1BY,R1BZ=',R1BX,R1BY,R1BZ504:    WRITE(*, '(A,3G20.10)') 'R1BX,R1BY,R1BZ=',R1BX,R1BY,R1BZ
512:    WRITE(*, '(A,3G20.10)') 'R2BX,R2BY,R2BZ=',R2BX,R2BY,R2BZ505:    WRITE(*, '(A,3G20.10)') 'R2BX,R2BY,R2BZ=',R2BX,R2BY,R2BZ
513: ELSE506: ELSE
514:    DUMMY=(DSQ1-r1amr1bdr2amr2b)/r1apr2bmr2amr1bsq507:    DUMMY=((r1ax-r1bx)*(r1ax-r1bx-r2ax+r2bx)+(r1ay-r1by)*(r1ay-r1by-r2ay+r2by)+(r1az-r1bz)*(r1az-r1bz-r2az+r2bz))/r1apr2bmr2amr1bsq
515: ENDIF508: ENDIF
516: NOINT=.TRUE.509: NOINT=.TRUE.
517: IF ((DUMMY.GT.0.0D0).AND.(DUMMY.LT.1.0D0)) NOINT=.FALSE.510: IF ((DUMMY.GT.0.0D0).AND.(DUMMY.LT.1.0D0)) NOINT=.FALSE.
 511: G2(1:3)=0.0D0
 512: G1(1:3)=0.0D0
518: G1INT(1:3)=0.0D0513: G1INT(1:3)=0.0D0
519: G2INT(1:3)=0.0D0514: G2INT(1:3)=0.0D0
520: D2=SQRT(DSQ2)515: D2=SQRT(DSQ2)
521: D1=SQRT(DSQ1)516: D1=SQRT(DSQ1)
 517: G2(1)=r2ax - r2bx
 518: G2(2)=r2ay - r2by
 519: G2(3)=r2az - r2bz
 520: G1(1)=r1ax - r1bx
 521: G1(2)=r1ay - r1by
 522: G1(3)=r1az - r1bz
522: DSQI=1.0D10523: DSQI=1.0D10
523: DINT=1.0D10524: DINT=1.0D10
524: IF (.NOT.NOINT) THEN525: IF (.NOT.NOINT) THEN
 526:    r1amr1bdr2amr2b=(r1ax-r1bx)*(r2ax-r2bx)+(r1ay-r1by)*(r2ay-r2by)+(r1az-r1bz)*(r2az-r2bz)
525:    r1amr1bdr2amr2bsq=r1amr1bdr2amr2b**2527:    r1amr1bdr2amr2bsq=r1amr1bdr2amr2b**2
526:    DSQI=MAX((-r1amr1bdr2amr2bsq + DSQ1*DSQ2)/r1apr2bmr2amr1bsq,0.0D0)528:    r1amr1bsq=(r1ax - r1bx)**2 + (r1ay - r1by)**2 + (r1az - r1bz)**2
 529:    r2amr2bsq=(r2ax - r2bx)**2 + (r2ay - r2by)**2 + (r2az - r2bz)**2
 530:    DSQI=MAX((-r1amr1bdr2amr2bsq + r1amr1bsq*r2amr2bsq)/r1apr2bmr2amr1bsq,0.0D0)
527:    DUMMY=r1apr2bmr2amr1bsq**2531:    DUMMY=r1apr2bmr2amr1bsq**2
528:    DINT=SQRT(DSQI)532:    DINT=SQRT(DSQI)
529:    IF (DINT.LE.0.0D0) THEN533:    IF (DINT.LE.0.0D0) THEN
530:       NOINT=.TRUE.534:       NOINT=.TRUE.
531:    ELSEIF (DINT.LE.INTCONSTRAINREPCUT) THEN ! skip otherwise535:    ELSEIF (DINT.LE.INTCONSTRAINREPCUT) THEN ! skip otherwise
532:       DUMMY2=r1amr1bdr2amr2bsq - DSQ1*DSQ2536:       G1INT(1)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r1ax - r1bx - r2ax + r2bx) + &
533:       G1INT(1:3)= (DUMMY2*(G1(1:3) - G2(1:3)) + r1apr2bmr2amr1bsq*(G1(1:3)*DSQ2 -G2(1:3)*r1amr1bdr2amr2b))/DUMMY537:  &    r1apr2bmr2amr1bsq*((r1ax - r1bx)*r2amr2bsq + r1amr1bdr2amr2b*(-r2ax + r2bx))))/DUMMY
534:       G2INT(1:3)= (DUMMY2*(G2(1:3) - G1(1:3)) + r1apr2bmr2amr1bsq*(G2(1:3)*DSQ1 -G1(1:3)*r1amr1bdr2amr2b))/DUMMY538:       G1INT(2)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r1ay - r1by - r2ay + r2by) + &
 539:  &    r1apr2bmr2amr1bsq*((r1ay - r1by)*r2amr2bsq + r1amr1bdr2amr2b*(-r2ay + r2by))))/DUMMY
 540:       G1INT(3)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r1az - r1bz - r2az + r2bz) + &
 541:  &    r1apr2bmr2amr1bsq*((r1az - r1bz)*r2amr2bsq + r1amr1bdr2amr2b*(-r2az + r2bz))))/DUMMY
 542: 
 543:       G2INT(1)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r2ax - r2bx - r1ax + r1bx) + &
 544:  &    r1apr2bmr2amr1bsq*((r2ax - r2bx)*r1amr1bsq + r1amr1bdr2amr2b*(-r1ax + r1bx))))/DUMMY
 545:       G2INT(2)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r2ay - r2by - r1ay + r1by) + &
 546:  &    r1apr2bmr2amr1bsq*((r2ay - r2by)*r1amr1bsq + r1amr1bdr2amr2b*(-r1ay + r1by))))/DUMMY
 547:       G2INT(3)= (((r1amr1bdr2amr2bsq - r1amr1bsq*r2amr2bsq)*(r2az - r2bz - r1az + r1bz) + &
 548:  &    r1apr2bmr2amr1bsq*((r2az - r2bz)*r1amr1bsq + r1amr1bdr2amr2b*(-r1az + r1bz))))/DUMMY
535:    ENDIF549:    ENDIF
536: ENDIF550: ENDIF
537: !551: !
538: ! Convert derivatives of distance^2 to derivative of distance.552: ! Convert derivatives of distance^2 to derivative of distance.
539: ! We have cancelled a factor of two above and below!553: ! We have cancelled a factor of two above and below!
540: !554: !
541: IF (r1apr2bmr2amr1bsq.EQ.0.0D0) THEN555: IF (r1apr2bmr2amr1bsq.EQ.0.0D0) THEN
542:    WRITE(*, '(A,3G20.10)') 'D2,D1,DINT=',D2,D1,DINT556:    WRITE(*, '(A,3G20.10)') 'D2,D1,DINT=',D2,D1,DINT
543:    STOP557:    STOP
544: ENDIF558: ENDIF
545: G2(1:3)=G2(1:3)/D2559: G2(1:3)=G2(1:3)/D2
546: G1(1:3)=G1(1:3)/D1560: G1(1:3)=G1(1:3)/D1
547: IF (.NOT.NOINT) THEN561: IF (.NOT.NOINT) THEN
548: !  IF (DINT.EQ.0.0D0) THEN562: !  IF (DINT.EQ.0.0D0) THEN
549: !     PRINT '(A,G20.10)','minmaxd2r> ERROR *** DINT=',DINT563: !     PRINT '(A,G20.10)','minmaxd2r> ERROR *** DINT=',DINT
550: !     PRINT *,'original dummy=',((r1ax-r1bx)*(r1ax-r1bx-r2ax+r2bx)+ &564: !     PRINT *,'original dummy=',((r1ax-r1bx)*(r1ax-r1bx-r2ax+r2bx)+ &
551: ! &        (r1ay-r1by)*(r1ay-r1by-r2ay+r2by)+(r1az-r1bz)*(r1az-r1bz-r2az+r2bz))/r1apr2bmr2amr1bsq565: ! &        (r1ay-r1by)*(r1ay-r1by-r2ay+r2by)+(r1az-r1bz)*(r1az-r1bz-r2az+r2bz))/r1apr2bmr2amr1bsq
552: !     PRINT *,'r1amr1bdr2amr2b=',r1amr1bdr2amr2b566: !     PRINT *,'r1amr1bdr2amr2b=',r1amr1bdr2amr2b
553: !     PRINT *,'r1amr1bdr2amr2bsq=',r1amr1bdr2amr2bsq567: !     PRINT *,'r1amr1bdr2amr2bsq=',r1amr1bdr2amr2bsq
554: !     PRINT *,'DSQ1=',DSQ1568: !     PRINT *,'r1amr1bsq=',r1amr1bsq
555: !     PRINT *,'DSQ2=',DSQ2569: !     PRINT *,'r2amr2bsq=',r2amr2bsq
556: !     PRINT *,'DSQI=',DSQI570: !     PRINT *,'DSQI=',DSQI
557: !     PRINT *,'DUMMY=',DUMMY571: !     PRINT *,'DUMMY=',DUMMY
558: !     PRINT *,'G1INT=',G1INT(1:3)572: !     PRINT *,'G1INT=',G1INT(1:3)
559: !     PRINT *,'G2INT=',G2INT(1:3)573: !     PRINT *,'G2INT=',G2INT(1:3)
560: !     PRINT *,'R1AX,R1AY,R1AZ=',R1AX,R1AY,R1AZ574: !     PRINT *,'R1AX,R1AY,R1AZ=',R1AX,R1AY,R1AZ
561: !     PRINT *,'R2AX,R2AY,R2AZ=',R2AX,R2AY,R2AZ575: !     PRINT *,'R2AX,R2AY,R2AZ=',R2AX,R2AY,R2AZ
562: !     PRINT *,'R1BX,R1BY,R1BZ=',R1BX,R1BY,R1BZ576: !     PRINT *,'R1BX,R1BY,R1BZ=',R1BX,R1BY,R1BZ
563: !     PRINT *,'R2BX,R2BY,R2BZ=',R2BX,R2BY,R2BZ577: !     PRINT *,'R2BX,R2BY,R2BZ=',R2BX,R2BY,R2BZ
564: !     STOP578: !     STOP
565: !  ENDIF579: !  ENDIF


r33456/lopermdist.f90 2017-11-09 22:30:18.329034180 +0000 r33455/lopermdist.f90 2017-11-09 22:30:18.769040028 +0000
 32: SUBROUTINE LOPERMDIST(COORDSB,COORDSA,NATOMS,DEBUG,BOXLX,BOXLY,BOXLZ,BULKT,TWOD,DISTANCE,DIST2,RIGID,RMATBEST,DOGROUP,NMOVE,NEWPERM) 32: SUBROUTINE LOPERMDIST(COORDSB,COORDSA,NATOMS,DEBUG,BOXLX,BOXLY,BOXLZ,BULKT,TWOD,DISTANCE,DIST2,RIGID,RMATBEST,DOGROUP,NMOVE,NEWPERM)
 33:  33: 
 34: USE KEY,ONLY : NPERMGROUP, NPERMSIZE, PERMGROUP, NSETS, SETS, GEOMDIFFTOL, & 34: USE KEY,ONLY : NPERMGROUP, NPERMSIZE, PERMGROUP, NSETS, SETS, GEOMDIFFTOL, &
 35:   &            NFREEZE, RBAAT, ANGLEAXIS2, BESTPERM, LOCALPERMDIST, NTSITES, & 35:   &            NFREEZE, RBAAT, ANGLEAXIS2, BESTPERM, LOCALPERMDIST, NTSITES, &
 36:   &            LOCALPERMCUT, STOCKT, GMAX, CONVR, EDIFFTOL, INTCONSTRAINTT, & 36:   &            LOCALPERMCUT, STOCKT, GMAX, CONVR, EDIFFTOL, INTCONSTRAINTT, &
 37:   &            LOCALPERMNEIGH, LOCALPERMCUT2, ATOMACTIVE 37:   &            LOCALPERMNEIGH, LOCALPERMCUT2, ATOMACTIVE
 38: USE MODCHARMM,ONLY : CHRMMT 38: USE MODCHARMM,ONLY : CHRMMT
 39: IMPLICIT NONE 39: IMPLICIT NONE
 40:  40: 
 41: INTEGER, PARAMETER :: MAXIMUMTRIES=10 41: INTEGER, PARAMETER :: MAXIMUMTRIES=10
 42: INTEGER NATOMS, NPERM, PATOMS, NRB, OPNUM,  NORBIT1, NORBIT2, NCHOOSE2, NCHOOSE1, NTRIES, NORBITB1, NORBITB2, NMOVE, NDMEAN 42: INTEGER NATOMS, NPERM, PATOMS, NRB, OPNUM,  NORBIT1, NORBIT2, NCHOOSE2, NCHOOSE1, NTRIES, NORBITB1, NORBITB2, NMOVE
 43: INTEGER J3, J4, NDUMMY, LPERM(NATOMS), J1, J2, NOTHER, LPERMBEST(NATOMS), NCHOOSEB1, NCHOOSEB2, & 43: INTEGER J3, J4, NDUMMY, LPERM(NATOMS), J1, J2, NOTHER, LPERMBEST(NATOMS), NCHOOSEB1, NCHOOSEB2, &
 44:         LPERMBESTATOM(NATOMS) 44:         LPERMBESTATOM(NATOMS)
 45: DOUBLE PRECISION DIST2, COORDSA(3*NATOMS), COORDSB(3*NATOMS), DISTANCE, DUMMYA(3*NATOMS), & 45: DOUBLE PRECISION DIST2, COORDSA(3*NATOMS), COORDSB(3*NATOMS), DISTANCE, DUMMYA(3*NATOMS), &
 46:   &              BESTA(3*NATOMS), DUMMYB(3*NATOMS), DUMMY(3*NATOMS), DIST, DSUM 46:   &              BESTA(3*NATOMS), DUMMYB(3*NATOMS), DUMMY(3*NATOMS), DIST, DSUM
 47: DOUBLE PRECISION BOXLX,BOXLY,BOXLZ,WORSTRAD,RMAT(3,3),ENERGY, VNEW(3*NATOMS), DX, DY, DZ, RMS, DBEST, XBEST(3*NATOMS) 47: DOUBLE PRECISION BOXLX,BOXLY,BOXLZ,WORSTRAD,RMAT(3,3),ENERGY, VNEW(3*NATOMS), DX, DY, DZ, RMS, DBEST, XBEST(3*NATOMS)
 48: DOUBLE PRECISION CMXA, CMXB, CMXC, QBEST(4), SITESA(3*NTSITES), SITESB(3*NTSITES) 48: DOUBLE PRECISION CMXA, CMXB, CMXC, QBEST(4), SITESA(3*NTSITES), SITESB(3*NTSITES)
 49: DOUBLE PRECISION ROTA(3,3), ROTINVA(3,3), ROTB(3,3), ROTINVB(3,3), RMATBEST(3,3), TMAT(3,3) 49: DOUBLE PRECISION ROTA(3,3), ROTINVA(3,3), ROTB(3,3), ROTINVB(3,3), RMATBEST(3,3), TMAT(3,3)
 50: DOUBLE PRECISION PVEC(3), RTEMP1(3,3), RTEMP2(3,3) 50: DOUBLE PRECISION PVEC(3), RTEMP1(3,3), RTEMP2(3,3)
 51: LOGICAL DEBUG, TWOD, RIGID, BULKT, PITEST, AOK, BOK, ADDED, PERMUTABLE(NATOMS), USEATOM 51: LOGICAL DEBUG, TWOD, RIGID, BULKT, PITEST, AOK, BOK, ADDED, PERMUTABLE(NATOMS), USEATOM
 52: DOUBLE PRECISION PDUMMYA(3*NATOMS), PDUMMYB(3*NATOMS), LDISTANCE, DUMMYC(3*NATOMS), XDUMMY, DUMMYD(3*NATOMS), & 52: DOUBLE PRECISION PDUMMYA(3*NATOMS), PDUMMYB(3*NATOMS), LDISTANCE, DUMMYC(3*NATOMS), XDUMMY, DUMMYD(3*NATOMS), &
153: !153: !
154: ! TRIED(J2) is 0 if atom J2 is eligible to be a neighbour, but has not154: ! TRIED(J2) is 0 if atom J2 is eligible to be a neighbour, but has not
155: ! yet been tried. It is -1 if it is ineligible, or has been tried and155: ! yet been tried. It is -1 if it is ineligible, or has been tried and
156: ! broke the alignment. It is +1 if it has been tried and did not break156: ! broke the alignment. It is +1 if it has been tried and did not break
157: ! the alignment. It is -1 for atoms already in the set of permutable157: ! the alignment. It is -1 for atoms already in the set of permutable
158: ! atoms in question. We add neighbours one at a time in order of 158: ! atoms in question. We add neighbours one at a time in order of 
159: ! increasing distance from primary permutable set159: ! increasing distance from primary permutable set
160: ! and test whether they break the alignment.160: ! and test whether they break the alignment.
161: !161: !
162:    DMEAN(1:NATOMS)=1.0D10162:    DMEAN(1:NATOMS)=1.0D10
163:    NDMEAN=0 
164: !163: !
165: ! Make a sorted list of distance from the permuting atoms.164: ! Make a sorted list of distance from the permuting atoms.
166: ! DMEAN, SORTLIST, TRIED, PERMUTABLE, and DLIST entries refer to original165: ! DMEAN, SORTLIST, TRIED, PERMUTABLE, and DLIST entries refer to original
167: ! atom labels. Use NEWPERM to find where they are in coordinate lists.166: ! atom labels. Use NEWPERM to find where they are in coordinate lists.
168: !167: !
169:    outer1: DO J2=1,NATOMS168:    outer1: DO J2=1,NATOMS
170:       USEATOM=.TRUE.169:       USEATOM=.TRUE.
171:       IF (DOGROUP.GT.0) THEN170:       IF (DOGROUP.GT.0) THEN
172:          IF (.NOT.ATOMACTIVE(J2)) USEATOM=.FALSE. ! must not attempt to access atomactive unless DOGROUP.GT.0 - not allocated!171:          IF (.NOT.ATOMACTIVE(J2)) USEATOM=.FALSE. ! must not attempt to access atomactive unless DOGROUP.GT.0 - not allocated!
173:       ENDIF172:       ENDIF
174: !173: !
175: ! Don't allow members of the same permutational group 174: ! Don't allow members of the same permutational group 
176: ! to appear as reference neighbours.175: ! to appear as reference neighbours.
177: !176: !
178:       IF (TRIED(J2).EQ.-1) THEN177:       IF (TRIED(J2).EQ.-1) THEN
179:          XDUMMY=1.0D9178:          XDUMMY=1.0D9
180:          CYCLE outer1 
181:       ELSE179:       ELSE
182:          IF (.NOT.USEATOM) THEN ! only use active atoms for QCI single group180:          IF (.NOT.USEATOM) THEN ! only use active atoms for QCI single group
183:             XDUMMY=1.0D9181:             XDUMMY=1.0D9
184:          ELSE182:          ELSE
185:             DA=(XA-DUMMYA(3*(NEWPERM(J2)-1)+1))**2 &183:             DA=(XA-DUMMYA(3*(NEWPERM(J2)-1)+1))**2 &
186:   &           +(YA-DUMMYA(3*(NEWPERM(J2)-1)+2))**2 &184:   &           +(YA-DUMMYA(3*(NEWPERM(J2)-1)+2))**2 &
187:   &           +(ZA-DUMMYA(3*(NEWPERM(J2)-1)+3))**2185:   &           +(ZA-DUMMYA(3*(NEWPERM(J2)-1)+3))**2
188: !           DB=(XB-DUMMYB(3*(NEWPERM(J2)-1)+1))**2 &186: !           DB=(XB-DUMMYB(3*(NEWPERM(J2)-1)+1))**2 &
189: ! &           +(YB-DUMMYB(3*(NEWPERM(J2)-1)+2))**2 &187: ! &           +(YB-DUMMYB(3*(NEWPERM(J2)-1)+2))**2 &
190: ! &           +(ZB-DUMMYB(3*(NEWPERM(J2)-1)+3))**2188: ! &           +(ZB-DUMMYB(3*(NEWPERM(J2)-1)+3))**2
191:             DB=(XB-DUMMYB(3*(J2-1)+1))**2 &189:             DB=(XB-DUMMYB(3*(J2-1)+1))**2 &
192:   &           +(YB-DUMMYB(3*(J2-1)+2))**2 &190:   &           +(YB-DUMMYB(3*(J2-1)+2))**2 &
193:   &           +(ZB-DUMMYB(3*(J2-1)+3))**2191:   &           +(ZB-DUMMYB(3*(J2-1)+3))**2
194:             XDUMMY=(SQRT(DA)+SQRT(DB))/2.0D0192:             XDUMMY=(SQRT(DA)+SQRT(DB))/2.0D0
195:             IF (XDUMMY.GT.LOCALPERMCUT2) CYCLE outer1 
196:          ENDIF193:          ENDIF
197:       ENDIF194:       ENDIF
198: 195:       loop1: DO J3=1,J2
199:       NDMEAN=NDMEAN+1 
200:       loop1: DO J3=1,NDMEAN ! J2 
201:          IF (XDUMMY.LT.DMEAN(J3)) THEN196:          IF (XDUMMY.LT.DMEAN(J3)) THEN
202: !197: !
203: ! Move the rest down.198: ! Move the rest down.
204: !199: !
205:             DO J4=NDMEAN,J3+1,-1   !    J2,J3+1,-1200:             DO J4=J2,J3+1,-1
206:                DMEAN(J4)=DMEAN(J4-1)201:                DMEAN(J4)=DMEAN(J4-1)
207:                SORTLIST(J4)=SORTLIST(J4-1)202:                SORTLIST(J4)=SORTLIST(J4-1)
208:             ENDDO203:             ENDDO
209:             DMEAN(J3)=XDUMMY204:             DMEAN(J3)=XDUMMY
210:             SORTLIST(J3)=J2205:             SORTLIST(J3)=J2
211:             EXIT loop1206:             EXIT loop1
212:          ENDIF207:          ENDIF
213:       ENDDO loop1208:       ENDDO loop1
214:    ENDDO outer1209:    ENDDO outer1
215: 210: 


legend
Lines Added 
Lines changed
 Lines Removed

hdiff - version: 2.1.0