hdiff output

r33423/congrad.f90 2017-10-27 12:31:39.739755293 +0100 r33422/congrad.f90 2017-10-27 12:31:39.959758221 +0100
 15: SUBROUTINE CONGRAD(NMAXINT,NMININT,ETOTAL,XYZ,GGG,EEE,IMGFREEZE,RMS) 15: SUBROUTINE CONGRAD(NMAXINT,NMININT,ETOTAL,XYZ,GGG,EEE,IMGFREEZE,RMS)
 16: USE KEY, ONLY: FROZEN, FREEZE, NREPI, NREPJ, NNREPULSIVE, & 16: USE KEY, ONLY: FROZEN, FREEZE, NREPI, NREPJ, NNREPULSIVE, &
 17:   &            NCONSTRAINT, CONI, CONJ, INTCONSTRAINTDEL, CONDISTREF, INTCONSTRAINTREP, CONDISTREFLOCAL, & 17:   &            NCONSTRAINT, CONI, CONJ, INTCONSTRAINTDEL, CONDISTREF, INTCONSTRAINTREP, CONDISTREFLOCAL, &
 18:   &            CONACTIVE, INTCONSTRAINREPCUT, NREPCUT,INTIMAGE, KINT, IMSEPMAX, ATOMACTIVE, & 18:   &            CONACTIVE, INTCONSTRAINREPCUT, NREPCUT,INTIMAGE, KINT, IMSEPMAX, ATOMACTIVE, &
 19:   &            INTFREEZET, INTFROZEN, CONCUTLOCAL, CONCUT, CONCUTABST, CONCUTABS, CONCUTFRACT, CONCUTFRAC, & 19:   &            INTFREEZET, INTFROZEN, CONCUTLOCAL, CONCUT, CONCUTABST, CONCUTABS, CONCUTFRACT, CONCUTFRAC, &
 20:   &  FREEZENODEST, INTSPRINGACTIVET, INTMINFAC 20:   &  FREEZENODEST, INTSPRINGACTIVET, INTMINFAC
 21: USE COMMONS, ONLY: NATOMS, NOPT, DEBUG 21: USE COMMONS, ONLY: NATOMS, NOPT, DEBUG
 22: USE PORFUNCS 22: USE PORFUNCS
 23: IMPLICIT NONE 23: IMPLICIT NONE
 24:             24:            
 25: INTEGER :: J1,J2,NI2,NI1,NJ2,NJ1,NMAXINT,NMININT,NREPINT(INTIMAGE+2),ISTAT,NINTMIN,NINTMIN2,MYUNIT,JMAX,IMAX 25: INTEGER :: J1,J2,NI2,NI1,NJ2,NJ1,NMAXINT,NMININT,NREPINT(INTIMAGE+2),ISTAT,NINTMIN,NINTMIN2,MYUNIT
 26: DOUBLE PRECISION :: ECON, EREP, ETOTAL, RMS, EMAX 26: DOUBLE PRECISION :: ECON, EREP, ETOTAL, RMS
 27: INTEGER JJMAX(INTIMAGE+2) 
 28: DOUBLE PRECISION  EEMAX(INTIMAGE+2) 
 29: DOUBLE PRECISION R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ,D2,D1 27: DOUBLE PRECISION R1AX,R1AY,R1AZ,R2AX,R2AY,R2AZ,R1BX,R1BY,R1BZ,R2BX,R2BY,R2BZ,D2,D1
 30: DOUBLE PRECISION G1(3),G2(3),DINT,G1INT(3),G2INT(3) 28: DOUBLE PRECISION G1(3),G2(3),DINT,G1INT(3),G2INT(3)
 31: DOUBLE PRECISION DUMMY, REPGRAD(3), INTCONST, D12, DSQ2, DSQ1, DSQI 29: DOUBLE PRECISION DUMMY, REPGRAD(3), INTCONST, D12, DSQ2, DSQ1, DSQI
 32: DOUBLE PRECISION CONE(INTIMAGE+2), REPE(INTIMAGE+2),MAXINT,MININT,REPEINT(INTIMAGE+2),RMSIM(INTIMAGE+2) 30: DOUBLE PRECISION CONE(INTIMAGE+2), REPE(INTIMAGE+2),MAXINT,MININT,REPEINT(INTIMAGE+2),RMSIM(INTIMAGE+2)
 33: LOGICAL NOINT 31: LOGICAL NOINT
 34: DOUBLE PRECISION XYZ((3*NATOMS)*(INTIMAGE+2)), GGG((3*NATOMS)*(INTIMAGE+2)), EEE(INTIMAGE+2), CCLOCAL 32: DOUBLE PRECISION XYZ((3*NATOMS)*(INTIMAGE+2)), GGG((3*NATOMS)*(INTIMAGE+2)), EEE(INTIMAGE+2), CCLOCAL
 35: LOGICAL IMGFREEZE(INTIMAGE) 33: LOGICAL IMGFREEZE(INTIMAGE)
 36: DOUBLE PRECISION DPLUS, ESPRING, SPGRAD(3) 34: DOUBLE PRECISION DPLUS, ESPRING, SPGRAD(3)
 37:  35: 
 38: EEE(1:INTIMAGE+2)=0.0D0 36: EEE(1:INTIMAGE+2)=0.0D0
 39: CONE(1:INTIMAGE+2)=0.0D0 37: CONE(1:INTIMAGE+2)=0.0D0
 40: REPE(1:INTIMAGE+2)=0.0D0 38: REPE(1:INTIMAGE+2)=0.0D0
 41: REPEINT(1:INTIMAGE+2)=0.0D0 39: REPEINT(1:INTIMAGE+2)=0.0D0
 42: NREPINT(1:INTIMAGE+2)=0 40: NREPINT(1:INTIMAGE+2)=0
 43: GGG(1:(3*NATOMS)*(INTIMAGE+2))=0.0D0 41: GGG(1:(3*NATOMS)*(INTIMAGE+2))=0.0D0
 44: ECON=0.0D0; EREP=0.0D0 42: ECON=0.0D0; EREP=0.0D0
 45: NINTMIN=0 43: NINTMIN=0
 46: NINTMIN2=0 44: NINTMIN2=0
 47: MYUNIT=6 45: MYUNIT=6
 48:  46: 
 49: EMAX=-1.0D200 
 50: EEMAX(1:INTIMAGE+2)=-1.0D200 
 51: JJMAX(1:INTIMAGE+2)=-1 
 52: JMAX=-1 
 53: IMAX=-1 
 54:  
 55: ! 47: !
 56: !  Constraint energy and forces. 48: !  Constraint energy and forces.
 57: ! 49: !
 58: DO J2=1,NCONSTRAINT 50: DO J2=1,NCONSTRAINT
 59:    IF (.NOT.CONACTIVE(J2)) CYCLE 51:    IF (.NOT.CONACTIVE(J2)) CYCLE
 60:       CCLOCAL=CONCUTLOCAL(J2) 52:       CCLOCAL=CONCUTLOCAL(J2)
 61:       IF (CONCUTABST) CCLOCAL=CCLOCAL+CONCUTABS 53:       IF (CONCUTABST) CCLOCAL=CCLOCAL+CONCUTABS
 62:       IF (CONCUTFRACT) CCLOCAL=CCLOCAL+CONCUTFRAC*CONDISTREFLOCAL(J2) 54:       IF (CONCUTFRACT) CCLOCAL=CCLOCAL+CONCUTFRAC*CONDISTREFLOCAL(J2)
 63: ! 55: !
 64: ! For J1 we consider the line segment between image J1-1 and J1. 56: ! For J1 we consider the line segment between image J1-1 and J1.
 75:       D2=SQRT((R2AX-R2BX)**2+(R2AY-R2BY)**2+(R2AZ-R2BZ)**2) 67:       D2=SQRT((R2AX-R2BX)**2+(R2AY-R2BY)**2+(R2AZ-R2BZ)**2)
 76:       IF (ABS(D2-CONDISTREFLOCAL(J2)).GT.CCLOCAL) THEN  68:       IF (ABS(D2-CONDISTREFLOCAL(J2)).GT.CCLOCAL) THEN 
 77:          DUMMY=D2-CONDISTREFLOCAL(J2)   69:          DUMMY=D2-CONDISTREFLOCAL(J2)  
 78:          G2(1)=(R2AX-R2BX)/D2 70:          G2(1)=(R2AX-R2BX)/D2
 79:          G2(2)=(R2AY-R2BY)/D2 71:          G2(2)=(R2AY-R2BY)/D2
 80:          G2(3)=(R2AZ-R2BZ)/D2 72:          G2(3)=(R2AZ-R2BZ)/D2
 81:          REPGRAD(1:3)=2*INTCONSTRAINTDEL*((DUMMY/CCLOCAL)**2-1.0D0)*DUMMY*G2(1:3) 73:          REPGRAD(1:3)=2*INTCONSTRAINTDEL*((DUMMY/CCLOCAL)**2-1.0D0)*DUMMY*G2(1:3)
 82:          DUMMY=INTCONSTRAINTDEL*(DUMMY**2-CCLOCAL**2)**2/(2.0D0*CCLOCAL**2) 74:          DUMMY=INTCONSTRAINTDEL*(DUMMY**2-CCLOCAL**2)**2/(2.0D0*CCLOCAL**2)
 83:          EEE(J1)=EEE(J1)  +DUMMY 75:          EEE(J1)=EEE(J1)  +DUMMY
 84:          ECON=ECON        +DUMMY 76:          ECON=ECON        +DUMMY
 85:          IF (DUMMY.GT.EMAX) THEN 
 86:              IMAX=J1 
 87:              JMAX=J2 
 88:              EMAX=DUMMY 
 89:          ENDIF 
 90:          IF (DUMMY.GT.EEMAX(J1)) THEN 
 91:             JJMAX(J1)=J2 
 92:             EEMAX(J1)=DUMMY 
 93:          ENDIF 
 94:          CONE(J1)=CONE(J1)+DUMMY 77:          CONE(J1)=CONE(J1)+DUMMY
 95:          GGG(NI1+1:NI1+3)=GGG(NI1+1:NI1+3)+REPGRAD(1:3) 78:          GGG(NI1+1:NI1+3)=GGG(NI1+1:NI1+3)+REPGRAD(1:3)
 96:          GGG(NJ1+1:NJ1+3)=GGG(NJ1+1:NJ1+3)-REPGRAD(1:3) 79:          GGG(NJ1+1:NJ1+3)=GGG(NJ1+1:NJ1+3)-REPGRAD(1:3)
 97:       ENDIF 80:       ENDIF
 98: !     WRITE(MYUNIT,'(A,2I6,5G20.10)') 'J1,J2,D2,CONDISTREFLOCAL,CCLOCAL,EEE,CONE=',J1,J2,D2,CONDISTREFLOCAL(J2),CCLOCAL,EEE(J1),CONE(J1) 81: !     WRITE(MYUNIT,'(A,2I6,5G20.10)') 'J1,J2,D2,CONDISTREFLOCAL,CCLOCAL,EEE,CONE=',J1,J2,D2,CONDISTREFLOCAL(J2),CCLOCAL,EEE(J1),CONE(J1)
 99:    ENDDO 82:    ENDDO
100: ENDDO 83: ENDDO
101: IF (JMAX.GT.0) THEN 
102:    WRITE(*,'(A,I6,A,I6,A,2I8)') ' congrad> Highest constraint contribution for any image in image ',IMAX, & 
103:  & ' constraint ',JMAX, & 
104:  &                              ' atoms ',CONI(JMAX),CONJ(JMAX) 
105: ENDIF 
106:  
107:  84: 
108: GGG(1:(3*NATOMS))=0.0D0                            ! can delete when loop range above changes 85: GGG(1:(3*NATOMS))=0.0D0                            ! can delete when loop range above changes
109: GGG((3*NATOMS)*(INTIMAGE+1)+1:(3*NATOMS)*(INTIMAGE+2))=0.0D0 ! can delete when loop range above changes 86: GGG((3*NATOMS)*(INTIMAGE+1)+1:(3*NATOMS)*(INTIMAGE+2))=0.0D0 ! can delete when loop range above changes
110:  87: 
111: ! INTCONST=INTCONSTRAINREPCUT**13 88: ! INTCONST=INTCONSTRAINREPCUT**13
112:  89: 
113: EMAX=-1.0D200 
114: EEMAX(1:INTIMAGE+2)=-1.0D200 
115: JJMAX(1:INTIMAGE+2)=-1 
116: JMAX=-1 
117: IMAX=-1 
118:  
119: DO J2=1,NNREPULSIVE 90: DO J2=1,NNREPULSIVE
120: !  INTCONST=NREPCUT(J2)**13 91: !  INTCONST=NREPCUT(J2)**13
121:    INTCONST=NREPCUT(J2)**3 92:    INTCONST=NREPCUT(J2)**3
122:    DO J1=2,INTIMAGE+2 93:    DO J1=2,INTIMAGE+2
123: !  DO J1=1,INTIMAGE+2 ! can change when zero energies are confirmed for end images 94: !  DO J1=1,INTIMAGE+2 ! can change when zero energies are confirmed for end images
124:       IF (FREEZENODEST) THEN 95:       IF (FREEZENODEST) THEN
125:          IF (J1.EQ.2) THEN 96:          IF (J1.EQ.2) THEN
126:             IF (IMGFREEZE(1)) CYCLE 97:             IF (IMGFREEZE(1)) CYCLE
127:          ELSE IF (J1.EQ.INTIMAGE+2) THEN 98:          ELSE IF (J1.EQ.INTIMAGE+2) THEN
128:             IF (IMGFREEZE(INTIMAGE)) CYCLE 99:             IF (IMGFREEZE(INTIMAGE)) CYCLE
141:       R2BX=XYZ(NJ2+1); R2BY=XYZ(NJ2+2); R2BZ=XYZ(NJ2+3)112:       R2BX=XYZ(NJ2+1); R2BY=XYZ(NJ2+2); R2BZ=XYZ(NJ2+3)
142:       D2=SQRT((R2AX-R2BX)**2+(R2AY-R2BY)**2+(R2AZ-R2BZ)**2)113:       D2=SQRT((R2AX-R2BX)**2+(R2AY-R2BY)**2+(R2AZ-R2BZ)**2)
143:       IF (D2.LT.NREPCUT(J2)) THEN ! term for image J1114:       IF (D2.LT.NREPCUT(J2)) THEN ! term for image J1
144: !        D12=D2**12115: !        D12=D2**12
145:          D12=D2**2116:          D12=D2**2
146: !        DUMMY=INTCONSTRAINTREP*(1.0D0/D12+(12.0D0*D2-13.0D0*NREPCUT(J2))/INTCONST)117: !        DUMMY=INTCONSTRAINTREP*(1.0D0/D12+(12.0D0*D2-13.0D0*NREPCUT(J2))/INTCONST)
147:          DUMMY=INTCONSTRAINTREP*(1.0D0/D12+(2.0D0*D2-3.0D0*NREPCUT(J2))/INTCONST)118:          DUMMY=INTCONSTRAINTREP*(1.0D0/D12+(2.0D0*D2-3.0D0*NREPCUT(J2))/INTCONST)
148:          EEE(J1)=EEE(J1)+DUMMY119:          EEE(J1)=EEE(J1)+DUMMY
149:          REPE(J1)=REPE(J1)+DUMMY120:          REPE(J1)=REPE(J1)+DUMMY
150:          EREP=EREP+DUMMY121:          EREP=EREP+DUMMY
151:          IF (DUMMY.GT.EMAX) THEN 
152:             IMAX=J1 
153:             JMAX=J2 
154:             EMAX=DUMMY 
155:          ENDIF 
156:          IF (DUMMY.GT.EEMAX(J1)) THEN 
157:             JJMAX(J1)=J2 
158:             EEMAX(J1)=DUMMY 
159:          ENDIF 
160:  
161: !        DUMMY=-12.0D0*INTCONSTRAINTREP*(1.0D0/(D2*D12)-1.0D0/INTCONST)122: !        DUMMY=-12.0D0*INTCONSTRAINTREP*(1.0D0/(D2*D12)-1.0D0/INTCONST)
162:          DUMMY=-2.0D0*INTCONSTRAINTREP*(1.0D0/(D2*D12)-1.0D0/INTCONST)123:          DUMMY=-2.0D0*INTCONSTRAINTREP*(1.0D0/(D2*D12)-1.0D0/INTCONST)
163:          G2(1)=(R2AX-R2BX)/D2124:          G2(1)=(R2AX-R2BX)/D2
164:          G2(2)=(R2AY-R2BY)/D2125:          G2(2)=(R2AY-R2BY)/D2
165:          G2(3)=(R2AZ-R2BZ)/D2126:          G2(3)=(R2AZ-R2BZ)/D2
166:          REPGRAD(1:3)=DUMMY*G2(1:3)127:          REPGRAD(1:3)=DUMMY*G2(1:3)
167:          GGG(NI2+1:NI2+3)=GGG(NI2+1:NI2+3)+REPGRAD(1:3)128:          GGG(NI2+1:NI2+3)=GGG(NI2+1:NI2+3)+REPGRAD(1:3)
168:          GGG(NJ2+1:NJ2+3)=GGG(NJ2+1:NJ2+3)-REPGRAD(1:3)129:          GGG(NJ2+1:NJ2+3)=GGG(NJ2+1:NJ2+3)-REPGRAD(1:3)
169:       ENDIF130:       ENDIF
170: !     WRITE(MYUNIT,'(A,2I6,4G20.10)') 'J1,J2,D2,NREPCUT,EEE,REPE=',J1,J2,D2,NREPCUT(J2),EEE(J1),REPE(J1)131: !     WRITE(MYUNIT,'(A,2I6,4G20.10)') 'J1,J2,D2,NREPCUT,EEE,REPE=',J1,J2,D2,NREPCUT(J2),EEE(J1),REPE(J1)
213:             REPEINT(J1)=REPEINT(J1)+DUMMY/2.0D0174:             REPEINT(J1)=REPEINT(J1)+DUMMY/2.0D0
214:             REPEINT(J1-1)=REPEINT(J1-1)+DUMMY/2.0D0175:             REPEINT(J1-1)=REPEINT(J1-1)+DUMMY/2.0D0
215:             NREPINT(J1)=NREPINT(J1)+1176:             NREPINT(J1)=NREPINT(J1)+1
216:             NREPINT(J1-1)=NREPINT(J1-1)+1177:             NREPINT(J1-1)=NREPINT(J1-1)+1
217:          ELSE IF (J1.EQ.INTIMAGE+2) THEN178:          ELSE IF (J1.EQ.INTIMAGE+2) THEN
218:             EEE(J1-1)=EEE(J1-1)+DUMMY179:             EEE(J1-1)=EEE(J1-1)+DUMMY
219:             REPEINT(J1-1)=REPEINT(J1-1)+DUMMY180:             REPEINT(J1-1)=REPEINT(J1-1)+DUMMY
220:             NREPINT(J1-1)=NREPINT(J1-1)+1181:             NREPINT(J1-1)=NREPINT(J1-1)+1
221:          ENDIF182:          ENDIF
222:          EREP=EREP+DUMMY183:          EREP=EREP+DUMMY
223:          IF (DUMMY.GT.EMAX) THEN 
224:             IMAX=J1 
225:             JMAX=J2 
226:             EMAX=DUMMY 
227:          ENDIF 
228:          IF (DUMMY.GT.EEMAX(J1)) THEN 
229:             JJMAX(J1)=J2 
230:             EEMAX(J1)=DUMMY 
231:          ENDIF 
232: !        DUMMY=-12.0D0*INTCONSTRAINTREP*(1.0D0/(DINT*D12)-1.0D0/INTCONST)184: !        DUMMY=-12.0D0*INTCONSTRAINTREP*(1.0D0/(DINT*D12)-1.0D0/INTCONST)
233:          DUMMY=-2.0D0*INTCONSTRAINTREP*(1.0D0/(DINT*D12)-1.0D0/INTCONST)185:          DUMMY=-2.0D0*INTCONSTRAINTREP*(1.0D0/(DINT*D12)-1.0D0/INTCONST)
234:          REPGRAD(1:3)=INTMINFAC*DUMMY*G1INT(1:3)186:          REPGRAD(1:3)=INTMINFAC*DUMMY*G1INT(1:3)
235: !        PRINT '(A,4I6,2G15.5)','in1 J1,J2,REPI,REPJ,REPGRAD,NREPCUT=',J1,J2,NREPI(J2),NREPJ(J2), &187: !        PRINT '(A,4I6,2G15.5)','in1 J1,J2,REPI,REPJ,REPGRAD,NREPCUT=',J1,J2,NREPI(J2),NREPJ(J2), &
236: ! &                              SQRT(REPGRAD(1)**2+REPGRAD(2)**2+REPGRAD(3)**2),NREPCUT(J2)188: ! &                              SQRT(REPGRAD(1)**2+REPGRAD(2)**2+REPGRAD(3)**2),NREPCUT(J2)
237: !189: !
238: ! Gradient contributions for image J1-1190: ! Gradient contributions for image J1-1
239: !191: !
240:          GGG(NI1+1:NI1+3)=GGG(NI1+1:NI1+3)+REPGRAD(1:3)192:          GGG(NI1+1:NI1+3)=GGG(NI1+1:NI1+3)+REPGRAD(1:3)
241:          GGG(NJ1+1:NJ1+3)=GGG(NJ1+1:NJ1+3)-REPGRAD(1:3)193:          GGG(NJ1+1:NJ1+3)=GGG(NJ1+1:NJ1+3)-REPGRAD(1:3)
243: !        PRINT '(A,4I6,2G15.5)','in1 J1,J2,REPI,REPJ,REPGRAD,NREPCUT=',J1,J2,NREPI(J2),NREPJ(J2), &195: !        PRINT '(A,4I6,2G15.5)','in1 J1,J2,REPI,REPJ,REPGRAD,NREPCUT=',J1,J2,NREPI(J2),NREPJ(J2), &
244: ! &                              SQRT(REPGRAD(1)**2+REPGRAD(2)**2+REPGRAD(3)**2),NREPCUT(J2)196: ! &                              SQRT(REPGRAD(1)**2+REPGRAD(2)**2+REPGRAD(3)**2),NREPCUT(J2)
245: !197: !
246: ! Gradient contributions for image J1198: ! Gradient contributions for image J1
247: !199: !
248:          GGG(NI2+1:NI2+3)=GGG(NI2+1:NI2+3)+REPGRAD(1:3)200:          GGG(NI2+1:NI2+3)=GGG(NI2+1:NI2+3)+REPGRAD(1:3)
249:          GGG(NJ2+1:NJ2+3)=GGG(NJ2+1:NJ2+3)-REPGRAD(1:3)201:          GGG(NJ2+1:NJ2+3)=GGG(NJ2+1:NJ2+3)-REPGRAD(1:3)
250:       ENDIF202:       ENDIF
251:    ENDDO203:    ENDDO
252: ENDDO204: ENDDO
253: IF (JMAX.GT.0) THEN 
254:    WRITE(*,'(A,I6,A,I6,A,2I6)') ' congrad> Highest repulsive  contribution for any image in image ',IMAX, & 
255:  &  ' pair index ', & 
256:  &                                JMAX,' atoms ',NREPI(JMAX),NREPJ(JMAX) 
257: ENDIF 
258:  
259: !205: !
260: ! Spring energy. Set EEE(J1) and ESPRING dividing up the pairwise206: ! Spring energy. Set EEE(J1) and ESPRING dividing up the pairwise
261: ! energy terms between images except for the end points.207: ! energy terms between images except for the end points.
262: !208: !
263: ESPRING=0.0D0209: ESPRING=0.0D0
264: IF (KINT.NE.0.0D0) THEN210: IF (KINT.NE.0.0D0) THEN
265:    DO J1=1,INTIMAGE+1 ! sum over edges from J1 to J1+1211:    DO J1=1,INTIMAGE+1 ! sum over edges from J1 to J1+1
266:       NI1=(3*NATOMS)*(J1-1)212:       NI1=(3*NATOMS)*(J1-1)
267:       NI2=(3*NATOMS)*J1213:       NI2=(3*NATOMS)*J1
268: !214: !
273:          IF ((.NOT.INTSPRINGACTIVET).OR.ATOMACTIVE(J2)) THEN 219:          IF ((.NOT.INTSPRINGACTIVET).OR.ATOMACTIVE(J2)) THEN 
274:             DPLUS=DPLUS+(XYZ(NI1+3*(J2-1)+1)-XYZ(NI2+3*(J2-1)+1))**2 &220:             DPLUS=DPLUS+(XYZ(NI1+3*(J2-1)+1)-XYZ(NI2+3*(J2-1)+1))**2 &
275:   &                    +(XYZ(NI1+3*(J2-1)+2)-XYZ(NI2+3*(J2-1)+2))**2 &221:   &                    +(XYZ(NI1+3*(J2-1)+2)-XYZ(NI2+3*(J2-1)+2))**2 &
276:   &                    +(XYZ(NI1+3*(J2-1)+3)-XYZ(NI2+3*(J2-1)+3))**2222:   &                    +(XYZ(NI1+3*(J2-1)+3)-XYZ(NI2+3*(J2-1)+3))**2
277:          ENDIF223:          ENDIF
278:       ENDDO224:       ENDDO
279:       DPLUS=SQRT(DPLUS)225:       DPLUS=SQRT(DPLUS)
280:       IF (DPLUS.GT.IMSEPMAX) THEN226:       IF (DPLUS.GT.IMSEPMAX) THEN
281: !        DUMMY=KINT*0.5D0*(DPLUS-IMSEPMAX)**2227: !        DUMMY=KINT*0.5D0*(DPLUS-IMSEPMAX)**2
282:          DUMMY=KINT*0.5D0*DPLUS**2228:          DUMMY=KINT*0.5D0*DPLUS**2
283:          IF (DUMMY.GT.EMAX) THEN 
284:             IMAX=J1 
285:             EMAX=DUMMY 
286:          ENDIF 
287:          ESPRING=ESPRING+DUMMY229:          ESPRING=ESPRING+DUMMY
288: !        DUMMY=KINT*(DPLUS-IMSEPMAX)/DPLUS230: !        DUMMY=KINT*(DPLUS-IMSEPMAX)/DPLUS
289:          DUMMY=KINT231:          DUMMY=KINT
290:          DO J2=1,NATOMS232:          DO J2=1,NATOMS
291:             IF ((.NOT.INTSPRINGACTIVET).OR.ATOMACTIVE(J2)) THEN 233:             IF ((.NOT.INTSPRINGACTIVET).OR.ATOMACTIVE(J2)) THEN 
292:                SPGRAD(1:3)=DUMMY*(XYZ(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)-XYZ(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3))234:                SPGRAD(1:3)=DUMMY*(XYZ(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)-XYZ(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3))
293:                GGG(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)=GGG(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)+SPGRAD(1:3)235:                GGG(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)=GGG(NI1+3*(J2-1)+1:NI1+3*(J2-1)+3)+SPGRAD(1:3)
294:                GGG(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3)=GGG(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3)-SPGRAD(1:3)236:                GGG(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3)=GGG(NI2+3*(J2-1)+1:NI2+3*(J2-1)+3)-SPGRAD(1:3)
295:             ENDIF237:             ENDIF
296:          ENDDO238:          ENDDO
297:       ENDIF239:       ENDIF
298:    ENDDO240:    ENDDO
299: ENDIF241: ENDIF
300: WRITE(*,'(A,I6,A,I6,A,2I6)') ' congrad> Highest spring  contribution for any image in image ',IMAX 
301:  
302:  
303: !242: !
304: ! Set gradients on frozen atoms to zero.243: ! Set gradients on frozen atoms to zero.
305: !244: !
306: IF (FREEZE) THEN245: IF (FREEZE) THEN
307:    DO J1=2,INTIMAGE+1  246:    DO J1=2,INTIMAGE+1  
308:       DO J2=1,NATOMS247:       DO J2=1,NATOMS
309:          IF (FROZEN(J2)) THEN248:          IF (FROZEN(J2)) THEN
310:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+1)=0.0D0249:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+1)=0.0D0
311:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+2)=0.0D0250:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+2)=0.0D0
312:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+3)=0.0D0251:             GGG((3*NATOMS)*(J1-1)+3*(J2-1)+3)=0.0D0


legend
Lines Added 
Lines changed
 Lines Removed

hdiff - version: 2.1.0