hdiff output

r33022/efol.f90 2017-07-15 15:30:13.506800532 +0100 r33021/efol.f90 2017-07-15 15:30:14.006807191 +0100
763: !  Hessian eigenvector. This enables us to start from converged minima.763: !  Hessian eigenvector. This enables us to start from converged minima.
764: !  Distinguish the case where we want to take a very small step away764: !  Distinguish the case where we want to take a very small step away
765: !  from a transition state from others where we want a big displacement765: !  from a transition state from others where we want a big displacement
766: !  to get unstuck. 766: !  to get unstuck. 
767: !767: !
768:       AWAY=.FALSE.768:       AWAY=.FALSE.
769:       IF (RMS.LT.PUSHCUT) THEN769:       IF (RMS.LT.PUSHCUT) THEN
770:          IF (TSTEST.AND.(INEG.NE.HINDEX)) THEN770:          IF (TSTEST.AND.(INEG.NE.HINDEX)) THEN
771:             IF (MOD(ITER-1,4).EQ.0) AWAY=.TRUE.771:             IF (MOD(ITER-1,4).EQ.0) AWAY=.TRUE.
772:          ELSE IF (MINTEST.AND.(INEG.NE.0)) THEN772:          ELSE IF (MINTEST.AND.(INEG.NE.0)) THEN
773: !773:             IF (MOD(ITER-1,4).EQ.0) AWAY=.TRUE.
774: ! This causes the step along the eigenvector with negative eigenvalue not to be scaled. 
775: ! Can lead to large energy rises in pathway calculations. Turn off 14/7/17. 
776: ! Paths look much smoother! 
777: ! However, we need the pushoff if it is the first step from a ts. 
778: !           IF (MOD(ITER-1,4).EQ.0) AWAY=.TRUE.  
779:             IF (ITER-1.EQ.0) AWAY=.TRUE.  
780:          ENDIF774:          ENDIF
781:       ENDIF775:       ENDIF
782:       IF ((.NOT.SDTEST).OR.AWAY) THEN776:       IF ((.NOT.SDTEST).OR.AWAY) THEN
783: !777: !
784: !  EF determination of steps778: !  EF determination of steps
785: !779: !
786:          ICOUNT=0780:          ICOUNT=0
787:          DO I=NOPT,1,-1781:          DO I=NOPT,1,-1
788:             STEP(I)=0.0D0782:             STEP(I)=0.0D0
789:             IF (ZT(I)) THEN783:             IF (ZT(I)) THEN
863:                      IF ((IVEC.GE.0).AND.PTEST) PRINT '(A,I6,A)',' efol> Stepping away from saddle along mode ',IMODE,' + direction'857:                      IF ((IVEC.GE.0).AND.PTEST) PRINT '(A,I6,A)',' efol> Stepping away from saddle along mode ',IMODE,' + direction'
864:                      IF ((IVEC.LT.0).AND.PTEST) PRINT '(A,I6,A)',' efol> Stepping away from saddle along mode ',IMODE,' - direction'858:                      IF ((IVEC.LT.0).AND.PTEST) PRINT '(A,I6,A)',' efol> Stepping away from saddle along mode ',IMODE,' - direction'
865:                      IF (PUSHOFF.NE.0.0D0) THEN859:                      IF (PUSHOFF.NE.0.0D0) THEN
866:                         STEP(IMODE)=PUSHOFF860:                         STEP(IMODE)=PUSHOFF
867:                      ELSE861:                      ELSE
868:                         STEP(IMODE)=STPMAX(IMODE)/10.0D0862:                         STEP(IMODE)=STPMAX(IMODE)/10.0D0
869:                      ENDIF863:                      ENDIF
870:                      IF (IVEC.LT.0) STEP(IMODE)=-STEP(IMODE)864:                      IF (IVEC.LT.0) STEP(IMODE)=-STEP(IMODE)
871:                   ENDIF865:                   ENDIF
872:                ENDIF866:                ENDIF
873: !           ELSE IF ((MINTEST.OR.SDTEST).AND.(.NOT.PUSHOPTT)) THEN 
874:             ELSE IF (MINTEST.OR.SDTEST) THEN867:             ELSE IF (MINTEST.OR.SDTEST) THEN
875: !868: !
876: !  Step off along all the modes with negative eigenvalues.869: !  Step off along all the modes with negative eigenvalues.
877: !870: !
878:                IF (IVEC.EQ.0) THEN871:                IF (IVEC.EQ.0) THEN
879:                   DO J1=1,NOPT872:                   DO J1=1,NOPT
880:                      IF (ZT(J1).AND.(DIAG(J1).LT.0.0D0)) THEN873:                      IF (ZT(J1).AND.(DIAG(J1).LT.0.0D0)) THEN
881:                         IF (PTEST) PRINT '(A,I6)',' efol> Stepping away from saddle along mode ',J1874:                         IF (PTEST) PRINT '(A,I6)',' efol> Stepping away from saddle along mode ',J1
882:                         IF (PUSHOFF.NE.0.0D0) THEN875:                         IF (PUSHOFF.NE.0.0D0) THEN
883:                            STEP(J1)=PUSHOFF876:                            STEP(J1)=PUSHOFF
957:             IF (ZT(J2)) TEMP=TEMP+FOB(J2)**2*DIAGEXP(J2)**J1950:             IF (ZT(J2)) TEMP=TEMP+FOB(J2)**2*DIAGEXP(J2)**J1
958:          ENDDO951:          ENDDO
959:          DELTAS=DELTAS+DSQRT(TEMP)*DELTAT952:          DELTAS=DELTAS+DSQRT(TEMP)*DELTAT
960: !953: !
961: !  We need to escape from the loop if the integral has effectively converged954: !  We need to escape from the loop if the integral has effectively converged
962: !  or if the arc length exceeds the allowed value.955: !  or if the arc length exceeds the allowed value.
963: !956: !
964:          IF ((DELTAS.LT.STPMAX(1)).AND.(J1.LT.100000).AND.((DELTAS-DELTASP)/DELTASP.GT.1.0D-10)) GOTO 666957:          IF ((DELTAS.LT.STPMAX(1)).AND.(J1.LT.100000).AND.((DELTAS-DELTASP)/DELTASP.GT.1.0D-10)) GOTO 666
965: 958: 
966:          TPAR=J1*DELTAT959:          TPAR=J1*DELTAT
967:          IF (PTEST) WRITE(*,'(A,G15.6,A,G15.6,A,I6)') ' efol> Estimated arc length=',DELTAS,' for t=',TPAR,' integration steps=',J1960:          IF (PTEST) WRITE(*,'(A,F12.6,A,F15.3,A,I6)') ' efol> Estimated arc length=',DELTAS,' for t=',TPAR,' integration steps=',J1
968: 961: 
969:          STEP(1:NOPT)=0.0D0962:          STEP(1:NOPT)=0.0D0
970:          DO J1=NOPT-NEV+1,NOPT 963:          DO J1=NOPT-NEV+1,NOPT 
971:             IF (.NOT.((DABS(FOB(J1)).LT.CONVR).AND.(INR.EQ.7)).AND.ZT(J1)) &964:             IF (.NOT.((DABS(FOB(J1)).LT.CONVR).AND.(INR.EQ.7)).AND.ZT(J1)) &
972:   &            STEP(J1)=FOB(J1)*(DEXP(-DIAG(J1)*TPAR)-1)/DIAG(J1)965:   &            STEP(J1)=FOB(J1)*(DEXP(-DIAG(J1)*TPAR)-1)/DIAG(J1)
973:          ENDDO966:          ENDDO
974:          IF (INR.EQ.8) STEP(IMODE)=FOB(IMODE)*(DEXP(DIAG(IMODE)*TPAR)-1)/DIAG(IMODE)967:          IF (INR.EQ.8) STEP(IMODE)=FOB(IMODE)*(DEXP(DIAG(IMODE)*TPAR)-1)/DIAG(IMODE)
975:          STPMAG=DSQRT(DOTOPT(STEP(1),STEP(1),NOPT))968:          STPMAG=DSQRT(DOTOPT(STEP(1),STEP(1),NOPT))
976:          SSTPMAG=STPMAG969:          SSTPMAG=STPMAG
977:          SCALE=1.0D0970:          SCALE=1.0D0


r33022/path.f 2017-07-15 15:30:13.750803782 +0100 r33021/path.f 2017-07-15 15:30:14.258810548 +0100
167: !        IF (DEBUG) PRINT*,'ts step off plus points in path:'167: !        IF (DEBUG) PRINT*,'ts step off plus points in path:'
168: !        IF (DEBUG) WRITE(*,'(3G20.10)') (Q(J1),J1=1,NOPT)168: !        IF (DEBUG) WRITE(*,'(3G20.10)') (Q(J1),J1=1,NOPT)
169:          DO J1=1,NOPT169:          DO J1=1,NOPT
170:             STEP(J1)=Q(J1)-QINIT(J1)170:             STEP(J1)=Q(J1)-QINIT(J1)
171:          ENDDO171:          ENDDO
172:          IF (PUSHOPTT) THEN  ! set REDOTS to zero? maybe not172:          IF (PUSHOPTT) THEN  ! set REDOTS to zero? maybe not
173:             PINIT=PUSHOFF173:             PINIT=PUSHOFF
174:             CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)174:             CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)
175:             Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)175:             Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)
176:             STEP(1:NOPT)=POPT*VECS(1:NOPT)176:             STEP(1:NOPT)=POPT*VECS(1:NOPT)
177:             WRITE(6,'(A,4G25.15)') ' path> golden section + pushoff, energy, delta, step: ',177:             WRITE(6,'(A,3G25.15)') ' path> golden section + pushoff, energy and delta energy: ',
178:      &                                 POPT,PENERGY,PENERGY-ETS,POPT178:      &                              POPT,PENERGY,PENERGY-ETS
179:          ENDIF179:          ENDIF
180:          180:          
181:          IF (RKMIN) RMS=1.0D0181:          IF (RKMIN) RMS=1.0D0
182:          MFLAG=.FALSE.182:          MFLAG=.FALSE.
183:          BFGSSTEP=.FALSE.183:          BFGSSTEP=.FALSE.
184:          BFGSTST=.FALSE.184:          BFGSTST=.FALSE.
185:          IF (BFGSMINT) THEN185:          IF (BFGSMINT) THEN
186:             IF (UNRST.OR.(CHRMMT.AND.INTMINT)) THEN186:             IF (UNRST.OR.(CHRMMT.AND.INTMINT)) THEN
187:                 CALL MYLBFGS(NINTS,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,187:                 CALL MYLBFGS(NINTS,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,
188:      1                       .TRUE.,ITDONE,PTEST,VNEW,.FALSE.,.FALSE.)188:      1                       .TRUE.,ITDONE,PTEST,VNEW,.FALSE.,.FALSE.)
289:          ENDDO289:          ENDDO
290:          DUMMY=SQRT(DUMMY)290:          DUMMY=SQRT(DUMMY)
291:          DO J1=1,NOPT291:          DO J1=1,NOPT
292:             VECS(J1)=VECS(J1)/DUMMY292:             VECS(J1)=VECS(J1)/DUMMY
293:          ENDDO293:          ENDDO
294:          IF (PUSHOPTT) THEN294:          IF (PUSHOPTT) THEN
295:             PINIT=PUSHOFF295:             PINIT=PUSHOFF
296:             CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)  296:             CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)  
297:             Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)297:             Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)
298:             STEP(1:NOPT)=POPT*VECS(1:NOPT)298:             STEP(1:NOPT)=POPT*VECS(1:NOPT)
299:             WRITE(6,'(A,4G25.15)') ' path> golden section + pushoff, energy, delta, step: ',299:             WRITE(6,'(A,3G25.15)') ' path> golden section + pushoff, energy and delta energy: ',
300:      &                                 POPT,PENERGY,PENERGY-ETS,POPT300:      &                              POPT,PENERGY,PENERGY-ETS
301:          ENDIF301:          ENDIF
302:          KNOWE=.FALSE.302:          KNOWE=.FALSE.
303:          KNOWG=.FALSE. ! we don`t know the gradient at the point in Q because VNEW isn`t passed from efol?303:          KNOWG=.FALSE. ! we don`t know the gradient at the point in Q because VNEW isn`t passed from efol?
304:          IF (BFGSMINT) THEN304:          IF (BFGSMINT) THEN
305: C           NOSHIFT=.FALSE.305: C           NOSHIFT=.FALSE.
306:             IF (CHRMMT.AND.INTMINT) THEN306:             IF (CHRMMT.AND.INTMINT) THEN
307:                CALL MYLBFGS(NINTS,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,307:                CALL MYLBFGS(NINTS,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,
308:      1                      .TRUE.,ITDONE,PTEST,VNEW,.FALSE.,.FALSE.)308:      1                      .TRUE.,ITDONE,PTEST,VNEW,.FALSE.,.FALSE.)
309:             ELSE309:             ELSE
310:                CALL MYLBFGS(NOPT,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,310:                CALL MYLBFGS(NOPT,MUPDATE,Q,.FALSE.,MFLAG,ENERGY,RMS2,EREAL,RMS,BFGSSTEPS,
470:       ENDDO470:       ENDDO
471:       EPLUS=ENERGY471:       EPLUS=ENERGY
472: !     IF (DEBUG) PRINT*,'ts step off minus points in path:'472: !     IF (DEBUG) PRINT*,'ts step off minus points in path:'
473: !     IF (DEBUG) WRITE(*,'(3G20.10)') (Q(J1),J1=1,NOPT)473: !     IF (DEBUG) WRITE(*,'(3G20.10)') (Q(J1),J1=1,NOPT)
474: 474: 
475:       IF (PUSHOPTT) THEN 475:       IF (PUSHOPTT) THEN 
476:          PINIT=-PUSHOFF476:          PINIT=-PUSHOFF
477:          CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)477:          CALL GOLDEN(VECS,QINIT,ETS,PINIT,POPT,PENERGY)
478:          Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)478:          Q(1:NOPT)=QINIT(1:NOPT)+POPT*VECS(1:NOPT)
479:          STEP(1:NOPT)=POPT*VECS(1:NOPT)479:          STEP(1:NOPT)=POPT*VECS(1:NOPT)
480:          WRITE(6,'(A,4G25.15)') ' path> golden section - pushoff, energy, delta, step: ',480:          WRITE(6,'(A,3G25.15)') ' path> golden section - pushoff, energy and delta energy: ',
481:      &                              POPT,PENERGY,PENERGY-ETS,POPT481:      &                              POPT,PENERGY,PENERGY-ETS
482:       ENDIF482:       ENDIF
483: 483: 
484:       IF (UNRST) THEN ! jmc new intstep stuff 484:       IF (UNRST) THEN ! jmc new intstep stuff 
485:          DO J1=1,nres485:          DO J1=1,nres
486:             c(1,J1)=QINIT(6*(J1-1)+1)486:             c(1,J1)=QINIT(6*(J1-1)+1)
487:             c(2,J1)=QINIT(6*(J1-1)+2)487:             c(2,J1)=QINIT(6*(J1-1)+2)
488:             c(3,J1)=QINIT(6*(J1-1)+3)488:             c(3,J1)=QINIT(6*(J1-1)+3)
489:             c(1,J1+nres)=QINIT(6*(J1-1)+4)489:             c(1,J1+nres)=QINIT(6*(J1-1)+4)
490:             c(2,J1+nres)=QINIT(6*(J1-1)+5)490:             c(2,J1+nres)=QINIT(6*(J1-1)+5)
491:             c(3,J1+nres)=QINIT(6*(J1-1)+6)491:             c(3,J1+nres)=QINIT(6*(J1-1)+6)
997:          ELSE997:          ELSE
998:             DO J2=1,NOPT998:             DO J2=1,NOPT
999:                Q1(J2)=Q2(J2)999:                Q1(J2)=Q2(J2)
1000:             ENDDO1000:             ENDDO
1001:          ENDIF1001:          ENDIF
1002:       ENDDO1002:       ENDDO
1003: 1003: 
1004: 555   CONTINUE1004: 555   CONTINUE
1005:       ! Write the data we have just obtained to the EofS file for this path1005:       ! Write the data we have just obtained to the EofS file for this path
1006:       OPEN(UNIT=3,FILE=EOFSSTRING,STATUS='UNKNOWN')1006:       OPEN(UNIT=3,FILE=EOFSSTRING,STATUS='UNKNOWN')
1007:       WRITE(3,'(2G25.15,I6)') (PATHLENGTH(J1),EOFS(J1),J1,J1=1,NSTEPPLUS+NSTEPMINUS+1)1007:       WRITE(3,'(2G20.10,I6)') (PATHLENGTH(J1),EOFS(J1),J1,J1=1,NSTEPPLUS+NSTEPMINUS+1)
1008:       CLOSE(3)1008:       CLOSE(3)
1009:       1009:       
1010:       SUM2=0.0D01010:       SUM2=0.0D0
1011:       SUM4=0.0D01011:       SUM4=0.0D0
1012: C     NDUMMY=1 !  WCOMMENT1012: C     NDUMMY=1 !  WCOMMENT
1013: C     IF (ZSYMSAVE(1:1).EQ.'W') NDUMMY=9  !  WCOMMENT 9 should have been 3?1013: C     IF (ZSYMSAVE(1:1).EQ.'W') NDUMMY=9  !  WCOMMENT 9 should have been 3?
1014:       NATOMSIMUL=NATOMS1014:       NATOMSIMUL=NATOMS
1015:       IF (ZSYMSAVE(1:1).EQ.'W') NATOMSIMUL=3*(NATOMS/2)1015:       IF (ZSYMSAVE(1:1).EQ.'W') NATOMSIMUL=3*(NATOMS/2)
1016:       IF (ZSYMSAVE(1:1).EQ.'W') THEN1016:       IF (ZSYMSAVE(1:1).EQ.'W') THEN
1017:          DO J1=1,NATOMSIMUL  !  WCOMMENT1017:          DO J1=1,NATOMSIMUL  !  WCOMMENT


legend
Lines Added 
Lines changed
 Lines Removed

hdiff - version: 2.1.0