hdiff output

r30216/dftb.f 2016-04-01 16:30:10.357003222 +0100 r30215/dftb.f 2016-04-01 16:30:10.933010865 +0100
 12: C   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 12: C   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13: C   GNU General Public License for more details. 13: C   GNU General Public License for more details.
 14: C 14: C
 15: C   You should have received a copy of the GNU General Public License 15: C   You should have received a copy of the GNU General Public License
 16: C   along with this program; if not, write to the Free Software 16: C   along with this program; if not, write to the Free Software
 17: C   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 17: C   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18: C 18: C
 19: C 19: C
 20: C  Tiffany s TB routine for C. 20: C  Tiffany s TB routine for C.
 21: C 21: C
 22:       SUBROUTINE DFTB(N,XS,deriv1st,ENERGY,GTEST,XMULREAL,BOXLA1,BOXLA2,BOXLZ) 22:       SUBROUTINE DFTB(N,XS,deriv1st,ENERGY,GTEST,XMULREAL,BOXLX,BOXLY,BOXLZ)
 23:       USE KEY 23:       USE KEY
 24:       IMPLICIT NONE 24:       IMPLICIT NONE
 25:       LOGICAL GTEST 25:       LOGICAL GTEST
 26:       INTEGER I, J, K, AI, AJ, NDIM,NMAX, I2, J2, K2, LWORK, INFO, J1, N, NDIAG, NA1, NA2, J3, J4 26:       INTEGER I, J, K, AI, AJ, NDIM,NMAX, I2, J2, K2, LWORK, INFO, J1, N, NDIAG
 27:       DOUBLE PRECISION DIST(N,N),XMULREAL,WORK(320*N),DPRAND,S(4*N,4*N),Sorig(4*N,4*N), 27:       DOUBLE PRECISION DIST(N,N),XMULREAL,WORK(320*N),DPRAND,S(4*N,4*N),Sorig(4*N,4*N),
 28:      &                 ENERGY,XS(3*N),HB(4*N,4*N),HA(4*N,4*N),VA(4*N,4*N),VB(4*N,4*N) 28:      &                 ENERGY,XS(3*N),HB(4*N,4*N),HA(4*N,4*N),VA(4*N,4*N),VB(4*N,4*N)
 29:  29: 
 30:       DOUBLE PRECISION R(N,N), ABSTOL,DIRCOS(N,N,3),DIAG(4*N),deriv1st(3*N),DIAGA(4*N),DIAGB(4*N) 30:       DOUBLE PRECISION R(N,N), ABSTOL,DIRCOS(N,N,3),DIAG(4*N),deriv1st(3*N),DIAGA(4*N),DIAGB(4*N)
 31:       DOUBLE PRECISION BOXLA1,BOXLA2,BOXLZ 31:       DOUBLE PRECISION BOXLX,BOXLY,BOXLZ
 32:       DOUBLE PRECISION A1VEC(3), A2VEC(3), DUMMY, DMIN, A1DOT, A2DOT 
 33:       INTEGER MX(N,N), MY(N,N), MZ(N,N) 32:       INTEGER MX(N,N), MY(N,N), MZ(N,N)
 34:  33: 
 35:       DOUBLE PRECISION Ssssig,Sspsig,Sppsig,Spppi,EPSsac,EPSsbc,EPSpac,EPSpbc,Hsssiga,Hspsiga, 34:       DOUBLE PRECISION Ssssig,Sspsig,Sppsig,Spppi,EPSsac,EPSsbc,EPSpac,EPSpbc,Hsssiga,Hspsiga,
 36:      &        Hppsiga,Hpppia,Hsssigb,Hspsigb,Hppsigb,Hpppib,VECTOR(3) 35:      &        Hppsiga,Hpppia,Hsssigb,Hspsigb,Hppsigb,Hpppib,VECTOR(3)
 37:  36: 
 38:       PARAMETER(EPSsac=-0.519289D0, EPSpac=-0.216472D0, EPSsbc=-0.434382D0, EPSpbc=-0.216472D0) 37:       PARAMETER(EPSsac=-0.519289D0, EPSpac=-0.216472D0, EPSsbc=-0.434382D0, EPSpbc=-0.216472D0)
 39:     38:    
 40:       INTEGER IWORK(20*N), IFAIL(4*N)  39:       INTEGER IWORK(20*N), IFAIL(4*N) 
 41:  40: 
 42: C     COMMON /RDIST/ R, DIRCOS, DIAGA, DIAGB 41: C     COMMON /RDIST/ R, DIRCOS, DIAGA, DIAGB
 43:  42: 
 44:       DOUBLE PRECISION UREP,REP 43:       DOUBLE PRECISION UREP,REP
 45:       LOGICAL DIAGTEST 44:       LOGICAL DIAGTEST
 46:       COMMON /FAIL/ DIAGTEST 45:       COMMON /FAIL/ DIAGTEST
 47:  46: 
 48:       LWORK=320*N 47:       LWORK=320*N
 49:       XMUL=INT(XMULREAL) 48:       XMUL=INT(XMULREAL)
 50:       A1VEC(1)=0.8660254037844388D0 
 51:       A1VEC(2)=0.5D0 
 52:       A1VEC(3)=0.0D0 
 53:       A2VEC(1)=0.8660254037844388D0 
 54:       A2VEC(2)=-0.5D0 
 55:       A2VEC(3)=0.0D0 
 56:  49: 
 57: C   Calculate distance matrix 50: C   Calculate distance matrix
 58: C 51: C
 59: C************ START PERIODIC BOUNDARY CONDITIONS ************************** 52: C************ START PERIODIC BOUNDARY CONDITIONS **************************
 60: C   53: C  Deal with atoms leaving the box:
 61: C  Assume graphene and hexagonal underlying lattice. 
 62: C 
 63: C |Nearest Whole     | int(a+.5) if a>=0|     1    | ANINT  | ANINT   | Real     | Real     | 
 64: C |  Number          | int(a-.5) if a<0 |          |        | DNINT   | Double   | Double   | 
 65: C 
 66: C For a of type real or double precision, there are two cases: if |a| < 1, int(a)=0; if |a| >= 1,  
 67: C int(a) is the integer whose magnitude is the largest integer that does not exceed the magnitude of a  
 68: C and whose sign is the same as the sign of a. For example, int(-3.7) = -3 
 69: C 
 70: C However, in this case the two lattice vectors are not orthogonal! 
 71: C 
 72: C 54: C
 73:       IF (BULKT) THEN 55:       IF (BULKT) THEN
 74: !            IF ((.NOT.FIXIMAGE).AND.(.NOT.NORESET)) THEN 56:          IF ((.NOT.FIXIMAGE).AND.(.NOT.NORESET)) THEN
 75: ! !           PRINT*,'Points before:' 57: C           PRINT*,'Points before:'
 76: ! !           WRITE(*,'(3F15.7)') (XS(J1),J1=1,3*N) 58: C           WRITE(*,'(3F15.7)') (XS(J1),J1=1,3*N)
 77: !             DO J1=1,N 59:             DO J1=1,N
 78: !                J2=3*(J1-1) 60:                J2=3*(J1-1)
 79: !                A1DOT=XS(J2+1)*A1VEC(1)+XS(J2+2)*A1VEC(2) 61:                XS(J2+1)=XS(J2+1) - BOXLX*DNINT(XS(J2+1)/BOXLX)
 80: !                NA1=DNINT(A1DOT/BOXLA1) 62:                XS(J2+2)=XS(J2+2) - BOXLY*DNINT(XS(J2+2)/BOXLY)
 81: !                A2DOT=XS(J2+1)*A2VEC(1)+XS(J2+2)*A2VEC(2) 63:                XS(J2+3)=XS(J2+3) - BOXLZ*DNINT(XS(J2+3)/BOXLZ)
 82: !                NA2=DNINT(A2DOT/BOXLA2) 64:             ENDDO
 83: !                IF ((NA1.NE.0).OR.(NA1.NE.0)) THEN 65: C           PRINT*,'Points after:'
 84: !                   PRINT '(A,I6,A,3G20.10,A,2I4)','atom ',J1,' before: ',XS(J2+1),XS(J2+2),XS(J2+3),' NA1,NA2=',NA1,NA2 66: C           WRITE(*,'(3F15.7)') (XS(J1),J1=1,3*N)
 85: !                   PRINT '(A,I6,A,3G20.10)','atom ',J1,'  after: ',XS(J2+1)- BOXLA1*A1VEC(1)*NA1 - BOXLA2*A2VEC(1)*NA2, 67:          ENDIF
 86: !      &                                                            XS(J2+2)- BOXLA1*A1VEC(2)*NA1 - BOXLA2*A2VEC(2)*NA2,XS(J2+3) 
 87: !                ENDIF 
 88: !                XS(J2+1)=XS(J2+1) - BOXLA1*A1VEC(1)*NA1 - BOXLA2*A2VEC(1)*NA2 
 89: !                XS(J2+2)=XS(J2+2) - BOXLA1*A1VEC(2)*NA1 - BOXLA2*A2VEC(2)*NA2 
 90: !             ENDDO 
 91: ! !           PRINT*,'Points after:' 
 92: ! !           WRITE(*,'(3F15.7)') (XS(J1),J1=1,3*N) 
 93: !            ENDIF 
 94: C 68: C
 95: C  Calculation of connecting vectors; to implement the periodic 69: C  Calculation of connecting vectors; to implement the periodic
 96: C  boundary conditions, the shortest vector between two atoms is used: 70: C  boundary conditions, the shortest vector between two atoms is used:
 97: C 71: C
 98:          DO I=1,N 72:          DO I=1,N
 99:             I2=3*(I-1) 73:             I2=3*(I-1)
100:             R(I,I)=0.0D0 74:             R(I,I)=0.0D0
101:             DO J=I+1,N 75:             DO J=I+1,N
102:                J2=3*(J-1) 76:                J2=3*(J-1)
103:                DMIN=1.0D100 77:                VECTOR(1)=XS(J2+1)-XS(I2+1)
104:                DO J3=-1,1 78:                VECTOR(2)=XS(J2+2)-XS(I2+2)
105:                   DO J4=-1,1 79:                VECTOR(3)=XS(J2+3)-XS(I2+3)
106:                      DUMMY=(XS(J2+1)-XS(I2+1)+J3*A1VEC(1)*BOXLA1+J4*A2VEC(1)*BOXLA2)**2+ 80:                IF (.NOT.FIXIMAGE) THEN
107:      &                     (XS(J2+2)-XS(I2+2)+J3*A1VEC(2)*BOXLA1+J4*A2VEC(2)*BOXLA2)**2+ 81:                   MX(J,I)=NINT(VECTOR(1)/BOXLX)
108:      &                     (XS(J2+3)-XS(I2+3))**2 82:                   MY(J,I)=NINT(VECTOR(2)/BOXLY)
109:                      IF (DUMMY.LT.DMIN) THEN 83:                   MZ(J,I)=NINT(VECTOR(3)/BOXLZ)
110:                         NA1=J3 84:                ENDIF 
111:                         NA2=J4 85:                VECTOR(1)= VECTOR(1) - BOXLX * MX(J,I)
112:                         DMIN=DUMMY 86:                VECTOR(2)= VECTOR(2) - BOXLY * MY(J,I)
113:                      ENDIF 87:                VECTOR(3)= VECTOR(3) - BOXLZ * MZ(J,I)
114: !                    PRINT '(A,4I6,2G20.10)','I,J,J3,J4,DUMMY,DMIN=',I,J,J3,J4,DUMMY,DMIN 88:                DIST(I,J)=VECTOR(1)**2+VECTOR(2)**2+VECTOR(3)**2
115:                   ENDDO 
116:                ENDDO 
117:  
118:                DIST(I,J)=DMIN 
119:                R(I,J)=SQRT(DIST(I,J)) 89:                R(I,J)=SQRT(DIST(I,J))
120: !                    PRINT '(A,4I6,3G20.10)','I,J,NA1,NA2,DUMMY,DMIN,R=',I,J,NA1,NA2,DMIN,R(I,J) 
121:                R(J,I)=R(I,J) 90:                R(J,I)=R(I,J)
122:                DO K=1,3 91:                DO K=1,3
123: !                 DIRCOS(I,J,K)=VECTOR(K)/R(I,J) 92:                   DIRCOS(I,J,K)=VECTOR(K)/R(I,J)
124:                   DIRCOS(I,J,K)=(XS(J2+K)-XS(I2+K)+NA1*A1VEC(K)*BOXLA1+NA2*A2VEC(K)*BOXLA2)/R(I,J) 
125:                   DIRCOS(J,I,K)=-DIRCOS(I,J,K) 93:                   DIRCOS(J,I,K)=-DIRCOS(I,J,K)
126:                ENDDO 94:                ENDDO
127: C              WRITE(*,'(2I4,3F15.7)') (I,J,(DIRCOS(I,J,K),K=1,3)) 95: C              WRITE(*,'(2I4,3F15.7)') (I,J,(DIRCOS(I,J,K),K=1,3))
128:                IF (I.EQ.1) THEN ! use first atom as a reference 
129:                   IF ((.NOT.FIXIMAGE).AND.(.NOT.NORESET)) THEN 
130:                      XS(J2+1)=XS(J2+1)+NA1*A1VEC(1)*BOXLA1+NA2*A2VEC(1)*BOXLA2 
131:                      XS(J2+2)=XS(J2+2)+NA1*A1VEC(2)*BOXLA1+NA2*A2VEC(2)*BOXLA2 
132:                   ENDIF 
133:                ENDIF 
134:             ENDDO 96:             ENDDO
135:             DO K=1,3 97:             DO K=1,3
136:                DIRCOS(I,I,K)=0.0D0 98:                DIRCOS(I,I,K)=0.0D0
137:             ENDDO 99:             ENDDO
138:          ENDDO100:          ENDDO
139: C************ END PERIODIC BOUNDARY CONDITIONS ****************************101: C************ END PERIODIC BOUNDARY CONDITIONS ****************************
140:       ELSE102:       ELSE
141: 103: 
142:       DO I=1,N104:       DO I=1,N
143:        I2=3*(I-1)105:        I2=3*(I-1)


r30216/newneb.f90 2016-04-01 16:30:09.972998126 +0100 r30215/newneb.f90 2016-04-01 16:30:10.549005771 +0100
495:                       MINFOUND(NMINFOUND)%E=EREAL495:                       MINFOUND(NMINFOUND)%E=EREAL
496:                       WRITE(987,'(I6)') NATOMS496:                       WRITE(987,'(I6)') NATOMS
497:                       WRITE(987,'(A,I5)') 'image ',J1497:                       WRITE(987,'(A,I5)') 'image ',J1
498:                       WRITE(987,'(A,3G20.10)') (ZSYM(J2), MINFOUND(NMINFOUND)%COORD(3*(J2-1)+1:3*(J2-1)+3),J2=1,NATOMS)498:                       WRITE(987,'(A,3G20.10)') (ZSYM(J2), MINFOUND(NMINFOUND)%COORD(3*(J2-1)+1:3*(J2-1)+3),J2=1,NATOMS)
499:                    ENDIF499:                    ENDIF
500:                    DEALLOCATE(VNEW)500:                    DEALLOCATE(VNEW)
501:                 ENDIF501:                 ENDIF
502:              ENDDO502:              ENDDO
503:           ELSE503:           ELSE
504:              CALL PRINTSUMMARY504:              CALL PRINTSUMMARY
505:              PRINT *,' newneb before tslocator' 
506:              CALL TSLOCATOR(TSRESET)  ! Perform the transition-state search505:              CALL TSLOCATOR(TSRESET)  ! Perform the transition-state search
507:              PRINT *,' newneb after tslocator' 
508:           ENDIF506:           ENDIF
509: 507: 
510: ! hk286508: ! hk286
511:           IF (RIGIDINIT) THEN509:           IF (RIGIDINIT) THEN
512:           ! sn402: We want to stay in RB coordinates for the moment. But for some reason we set ATOMRIGIDCOORDT510:           ! sn402: We want to stay in RB coordinates for the moment. But for some reason we set ATOMRIGIDCOORDT
513:           ! to .TRUE. even though it isn't. I will investigate why we do this.511:           ! to .TRUE. even though it isn't. I will investigate why we do this.
514: !                CALL GENRIGID_IMAGE_RIGIDTOC(NIMAGE, XYZ)   ! hk286 commented this line.512: !                CALL GENRIGID_IMAGE_RIGIDTOC(NIMAGE, XYZ)   ! hk286 commented this line.
515:              ATOMRIGIDCOORDT = .TRUE.513:              ATOMRIGIDCOORDT = .TRUE.
516:           ENDIF514:           ENDIF
517: ! hk286515: ! hk286
518: 516: 
519:              PRINT *,' newneb here a' 
520:           NULLIFY(X,EIMAGE)517:           NULLIFY(X,EIMAGE)
521:              PRINT *,' newneb here b' 
522: !         IF (ALLOCATED(DVEC)) DEALLOCATE(DVEC)518: !         IF (ALLOCATED(DVEC)) DEALLOCATE(DVEC)
523:           IF (ALLOCATED(NEWNEBK)) DEALLOCATE(NEWNEBK)519:           IF (ALLOCATED(NEWNEBK)) DEALLOCATE(NEWNEBK)
524: !         IF (ALLOCATED(XYZ)) DEALLOCATE(XYZ)520: !         IF (ALLOCATED(XYZ)) DEALLOCATE(XYZ)
525: !         IF (ALLOCATED(EEE)) DEALLOCATE(EEE)521: !         IF (ALLOCATED(EEE)) DEALLOCATE(EEE)
526: !         IF (ALLOCATED(GGG)) DEALLOCATE(GGG)522: !         IF (ALLOCATED(GGG)) DEALLOCATE(GGG)
527:           IF (ALLOCATED(TRUEGRAD)) DEALLOCATE(TRUEGRAD)523:           IF (ALLOCATED(TRUEGRAD)) DEALLOCATE(TRUEGRAD)
528: !         IF (ALLOCATED(SSS)) DEALLOCATE(SSS)524: !         IF (ALLOCATED(SSS)) DEALLOCATE(SSS)
529: !         IF (ALLOCATED(RRR)) DEALLOCATE(RRR)525: !         IF (ALLOCATED(RRR)) DEALLOCATE(RRR)
530: !         IF (ALLOCATED(DEVIATION)) DEALLOCATE(DEVIATION)526: !         IF (ALLOCATED(DEVIATION)) DEALLOCATE(DEVIATION)
531: !         IF (ALLOCATED(TANVEC)) DEALLOCATE(TANVEC)527: !         IF (ALLOCATED(TANVEC)) DEALLOCATE(TANVEC)
535:           IF (ALLOCATED(EPSALPHA)) DEALLOCATE(EPSALPHA)531:           IF (ALLOCATED(EPSALPHA)) DEALLOCATE(EPSALPHA)
536:           IF (ALLOCATED(DISTREF)) DEALLOCATE(DISTREF)532:           IF (ALLOCATED(DISTREF)) DEALLOCATE(DISTREF)
537:           IF (ALLOCATED(REPPOW)) DEALLOCATE(REPPOW)533:           IF (ALLOCATED(REPPOW)) DEALLOCATE(REPPOW)
538: !         DEALLOCATE(DVEC,NEWNEBK,XYZ,EEE,GGG,TRUEGRAD,SSS,RRR,DEVIATION,TANVEC,STEPIMAGE,ORDERI,ORDERJ,EPSALPHA,DISTREF,REPPOW)534: !         DEALLOCATE(DVEC,NEWNEBK,XYZ,EEE,GGG,TRUEGRAD,SSS,RRR,DEVIATION,TANVEC,STEPIMAGE,ORDERI,ORDERJ,EPSALPHA,DISTREF,REPPOW)
539:           DEALLOCATE(BADIMAGE,BADPEPTIDE)535:           DEALLOCATE(BADIMAGE,BADPEPTIDE)
540:           IF (FREEZENODEST) DEALLOCATE(IMGFREEZE)536:           IF (FREEZENODEST) DEALLOCATE(IMGFREEZE)
541:           IF (DESMINT) THEN537:           IF (DESMINT) THEN
542:              NULLIFY(XCART, GCART)538:              NULLIFY(XCART, GCART)
543:              DEALLOCATE(XYZCART,GGGCART,DIHINFO)539:              DEALLOCATE(XYZCART,GGGCART,DIHINFO)
544:           ENDIF540:           ENDIF
545:              PRINT *,' newneb here c' 
546: 541: 
547:      END SUBROUTINE NEWNEB542:      END SUBROUTINE NEWNEB
548: END MODULE NEWNEBMODULE543: END MODULE NEWNEBMODULE


r30216/output.f90 2016-04-01 16:30:10.165000673 +0100 r30215/output.f90 2016-04-01 16:30:10.741008313 +0100
192:                       ENDIF192:                       ENDIF
193: 193: 
194:                       IF (DESMINT) THEN194:                       IF (DESMINT) THEN
195:                          CALL BFGSTS(NSTEPS,XYZCART(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &195:                          CALL BFGSTS(NSTEPS,XYZCART(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &
196:                               &       EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)196:                               &       EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)
197:                       ELSE197:                       ELSE
198:                          IF (CUDAT) THEN198:                          IF (CUDAT) THEN
199:                             CALL CUDA_BFGSTS_WRAPPER(NSTEPS,XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &199:                             CALL CUDA_BFGSTS_WRAPPER(NSTEPS,XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &
200:                                  &       EDUMMY,TSCONVERGED,RMS,EVALMIN,VECS,ITDONE)200:                                  &       EDUMMY,TSCONVERGED,RMS,EVALMIN,VECS,ITDONE)
201:                          ELSE201:                          ELSE
202:                             PRINT *,'in output before bfgsts' 
203:                             CALL BFGSTS(NSTEPS,XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &202:                             CALL BFGSTS(NSTEPS,XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),  &
204:                                  &       EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)203:                                  &       EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)
205:                             PRINT *,'in output after bfgsts' 
206:                          END IF204:                          END IF
207:                       ENDIF205:                       ENDIF
208:                    ENDIF206:                    ENDIF
209:                 ELSE207:                 ELSE
210:                    IF (DESMINT) THEN208:                    IF (DESMINT) THEN
211:                       CALL EFOL(XYZCART(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),TSCONVERGED, &209:                       CALL EFOL(XYZCART(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),TSCONVERGED, &
212:                            &   NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)210:                            &   NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)
213:                    ELSE211:                    ELSE
214:                       CALL EFOL(XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),TSCONVERGED, &212:                       CALL EFOL(XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)),TSCONVERGED, &
215:                            &   NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)213:                            &   NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)
250:                    WRITE(METHSTR,'(A)') 'ES'248:                    WRITE(METHSTR,'(A)') 'ES'
251:                 ELSE249:                 ELSE
252:                    WRITE(METHSTR,'(A)') 'GS'250:                    WRITE(METHSTR,'(A)') 'GS'
253:                 ENDIF251:                 ENDIF
254:              ELSE252:              ELSE
255:                 WRITE(METHSTR,'(A)') 'DNEB'253:                 WRITE(METHSTR,'(A)') 'DNEB'
256:              ENDIF              254:              ENDIF              
257: 255: 
258:              WRITE(*, '(1x,a,f7.2)',advance='yes') trim(METHSTR)//' run yielded '//trim(adjustl(IntStr))// &256:              WRITE(*, '(1x,a,f7.2)',advance='yes') trim(METHSTR)//' run yielded '//trim(adjustl(IntStr))// &
259:                           &' true transition state(s) time=',EndTime-StartTime257:                           &' true transition state(s) time=',EndTime-StartTime
260:              PRINT *,' here A tslocator' 
261:         ENDIF258:         ENDIF
262:              PRINT *,' here B tslocator SAVECANDIDATES=',SAVECANDIDATES 
263:         IF (SAVECANDIDATES) THEN259:         IF (SAVECANDIDATES) THEN
264:            DO J=1,NTSFOUND260:            DO J=1,NTSFOUND
265:               IF (DESMINT) THEN261:               IF (DESMINT) THEN
266:                  INQUIRE(IOLENGTH=RECLEN) (XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)))262:                  INQUIRE(IOLENGTH=RECLEN) (XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)))
267:               ELSE                       263:               ELSE                       
268:                  INQUIRE(IOLENGTH=RECLEN) (XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)))264:                  INQUIRE(IOLENGTH=RECLEN) (XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)))
269:               ENDIF265:               ENDIF
270:               WRITE(FILENAME,'(i10)') J266:               WRITE(FILENAME,'(i10)') J
271:               FILENAME='points'//trim(adjustl(filename))//'.out'267:               FILENAME='points'//trim(adjustl(filename))//'.out'
272:               OPEN(UNIT=40,FILE=FILENAME,STATUS='unknown',form='unformatted',access='direct',recl=reclen)268:               OPEN(UNIT=40,FILE=FILENAME,STATUS='unknown',form='unformatted',access='direct',recl=reclen)
273: 269: 
274:               IF (DESMINT) THEN270:               IF (DESMINT) THEN
275:                  WRITE(40,REC=1) ( XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)) )271:                  WRITE(40,REC=1) ( XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)) )
276:               ELSE272:               ELSE
277:                  WRITE(40,REC=1) ( XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)) )273:                  WRITE(40,REC=1) ( XYZ(NOPT*(TSPOS(J)-1)+1:NOPT*TSPOS(J)) )
278:               ENDIF274:               ENDIF
279: 275: 
280:               CLOSE(40)276:               CLOSE(40)
281:            ENDDO277:            ENDDO
282:         ENDIF278:         ENDIF
283:              PRINT *,' here C tslocator' 
284: 279: 
285:         RETURN280:         RETURN
286: 281: 
287:       END SUBROUTINE TSLOCATOR282:       END SUBROUTINE TSLOCATOR
288: 283: 
289: SUBROUTINE CONTSLOCATOR284: SUBROUTINE CONTSLOCATOR
290: USE KEY,ONLY: BFGSTST,UNRST,NSTEPS,MACHINE, GROWSTRINGT, INTEPSILON, REDOTSIM285: USE KEY,ONLY: BFGSTST,UNRST,NSTEPS,MACHINE, GROWSTRINGT, INTEPSILON, REDOTSIM
291: USE GSDATA, ONLY: EVOLVESTRINGT286: USE GSDATA, ONLY: EVOLVESTRINGT
292: USE KEYOUTPUT287: USE KEYOUTPUT
293: USE MODCHARMM288: USE MODCHARMM
312: INTEGER :: MLOC307: INTEGER :: MLOC
313: DOUBLE PRECISION :: TIME, TIME0308: DOUBLE PRECISION :: TIME, TIME0
314: DOUBLE PRECISION :: DPRAND309: DOUBLE PRECISION :: DPRAND
315: LOGICAL :: KNOWE, KNOWG, KNOWH ! JMC310: LOGICAL :: KNOWE, KNOWG, KNOWH ! JMC
316: COMMON /KNOWN/ KNOWE, KNOWG, KNOWH ! JMC311: COMMON /KNOWN/ KNOWE, KNOWG, KNOWH ! JMC
317: CHARACTER(LEN=256) :: FILENAME, METHSTR312: CHARACTER(LEN=256) :: FILENAME, METHSTR
318: LOGICAL :: TMPINTNEWT, FAILED313: LOGICAL :: TMPINTNEWT, FAILED
319: DOUBLE PRECISION, ALLOCATABLE :: TSGUESS(:,:), TSTEMP(:,:), LTANVEC(:,:)314: DOUBLE PRECISION, ALLOCATABLE :: TSGUESS(:,:), TSTEMP(:,:), LTANVEC(:,:)
320: 315: 
321: MYTSMAX=10316: MYTSMAX=10
322:  PRINT *,' A ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS) 
323:  PRINT *,' A ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC) 
324: IF (ALLOCATED(TSGUESS)) DEALLOCATE(TSGUESS)317: IF (ALLOCATED(TSGUESS)) DEALLOCATE(TSGUESS)
325: IF (ALLOCATED(LTANVEC)) DEALLOCATE(LTANVEC)318: IF (ALLOCATED(LTANVEC)) DEALLOCATE(LTANVEC)
326:  PRINT *,' A2 ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)319: ! PRINT *,' A ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)
327:  PRINT *,' A2 ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)320: ! PRINT *,' A ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)
328: ALLOCATE(TSGUESS(MYTSMAX,NOPT),LTANVEC(MYTSMAX,NOPT))321: ALLOCATE(TSGUESS(MYTSMAX,NOPT),LTANVEC(MYTSMAX,NOPT))
329: NTS=0322: NTS=0
330: LGDUMMY = 0 ! sn402 added323: LGDUMMY = 0 ! sn402 added
331: IF (REDOPATHNEB) THEN324: IF (REDOPATHNEB) THEN
332:    PRINT '(A,F20.10)',' contslocator> ERROR *** REDOPATH cannot be set with NEBCONSTRAINT'325:    PRINT '(A,F20.10)',' contslocator> ERROR *** REDOPATH cannot be set with NEBCONSTRAINT'
333:    STOP326:    STOP
334: ELSE327: ELSE
335:    DO I=1,NIMAGE+1328:    DO I=1,NIMAGE+1
336:       DO J2=1,NIMAGE+2 ! extra interpolation using the same number of images329:       DO J2=1,NIMAGE+2 ! extra interpolation using the same number of images
337:          XLOCAL(1:NOPT)=( (NIMAGE+2-J2)*XYZ((I-1)*NOPT+1:I*NOPT)+(J2-1)*XYZ(I*NOPT+1:(I+1)*NOPT) )/(NIMAGE+1)330:          XLOCAL(1:NOPT)=( (NIMAGE+2-J2)*XYZ((I-1)*NOPT+1:I*NOPT)+(J2-1)*XYZ(I*NOPT+1:(I+1)*NOPT) )/(NIMAGE+1)
338:          CALL POTENTIAL(XLOCAL,ELOCAL(J2),LGDUMMY,.FALSE.,.FALSE.,RMS,.FALSE.,.FALSE.)331:          CALL POTENTIAL(XLOCAL,ELOCAL(J2),LGDUMMY,.FALSE.,.FALSE.,RMS,.FALSE.,.FALSE.)
339:          PRINT '(3(A,I6),A,G20.10)',' contslocator> energy at position ',J2,' between images ',I,' and ',I+1, &332:          PRINT '(3(A,I6),A,G20.10)',' contslocator> energy at position ',J2,' between images ',I,' and ',I+1, &
340:   &                                  ' E=',ELOCAL(J2)333:   &                                  ' E=',ELOCAL(J2)
341:       ENDDO334:       ENDDO
342:       IF (ELOCAL(2).LT.ELOCAL(1)) THEN335:       IF (ELOCAL(2).LT.ELOCAL(1)) THEN
343:          NTS=NTS+1336:          NTS=NTS+1
344:          IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates337:          IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates
345:             ALLOCATE(TSTEMP(MYTSMAX,NOPT))338:             ALLOCATE(TSTEMP(MYTSMAX,NOPT))
346:              PRINT *,' B ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)339:             ! PRINT *,' B ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)
347:              PRINT *,' B ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)340:             ! PRINT *,' B ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)
348:             TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)341:             TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)
349:             DEALLOCATE(TSGUESS)342:             DEALLOCATE(TSGUESS)
350:             ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))343:             ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))
351:             TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)344:             TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
352:             TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)345:             TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)
353:             DEALLOCATE(LTANVEC)346:             DEALLOCATE(LTANVEC)
354:             ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))347:             ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))
355:             LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)348:             LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
356:             DEALLOCATE(TSTEMP)349:             DEALLOCATE(TSTEMP)
357:             MYTSMAX=2*MYTSMAX350:             MYTSMAX=2*MYTSMAX
358:          ENDIF351:          ENDIF
359:          PRINT '(3(A,I6),A,G20.10)',' contslocator> adding ts candidate at position ',1,' between images ',I,' and ',I+1, &352:          PRINT '(3(A,I6),A,G20.10)',' contslocator> adding ts candidate at position ',1,' between images ',I,' and ',I+1, &
360:   &                               ' E=',ELOCAL(1)353:   &                               ' E=',ELOCAL(1)
361:          TSGUESS(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)354:          TSGUESS(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)
362:          LTANVEC(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)-XYZ(I*NOPT+1:(I+1)*NOPT)355:          LTANVEC(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)-XYZ(I*NOPT+1:(I+1)*NOPT)
363:       ENDIF356:       ENDIF
364:       DO J2=2,NIMAGE+1 357:       DO J2=2,NIMAGE+1 
365:          IF ( (ELOCAL(J2-1).LT.ELOCAL(J2)) .AND. (ELOCAL(J2).GT.ELOCAL(J2+1)) ) THEN358:          IF ( (ELOCAL(J2-1).LT.ELOCAL(J2)) .AND. (ELOCAL(J2).GT.ELOCAL(J2+1)) ) THEN
366:             NTS=NTS+1359:             NTS=NTS+1
367:             IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates360:             IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates
368:               PRINT *,' C ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)361:             ! PRINT *,' C ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)
369:               PRINT *,' C ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)362:             ! PRINT *,' C ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)
370:                ALLOCATE(TSTEMP(MYTSMAX,NOPT))363:                ALLOCATE(TSTEMP(MYTSMAX,NOPT))
371:                TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)364:                TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)
372:                DEALLOCATE(TSGUESS)365:                DEALLOCATE(TSGUESS)
373:                ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))366:                ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))
374:                TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)367:                TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
375:                TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)368:                TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)
376:                DEALLOCATE(LTANVEC)369:                DEALLOCATE(LTANVEC)
377:                ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))370:                ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))
378:                LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)371:                LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
379:                DEALLOCATE(TSTEMP)372:                DEALLOCATE(TSTEMP)
382:             PRINT '(3(A,I6),A,G20.10)',' contslocator> adding ts candidate at position ',J2,' between images ',I,' and ',I+1, &375:             PRINT '(3(A,I6),A,G20.10)',' contslocator> adding ts candidate at position ',J2,' between images ',I,' and ',I+1, &
383:   &                                  ' E=',ELOCAL(J2)376:   &                                  ' E=',ELOCAL(J2)
384:             TSGUESS(NTS,1:NOPT)=( (NIMAGE+2-J2)*XYZ((I-1)*NOPT+1:I*NOPT)+(J2-1)*XYZ(I*NOPT+1:(I+1)*NOPT) )/(NIMAGE+1)377:             TSGUESS(NTS,1:NOPT)=( (NIMAGE+2-J2)*XYZ((I-1)*NOPT+1:I*NOPT)+(J2-1)*XYZ(I*NOPT+1:(I+1)*NOPT) )/(NIMAGE+1)
385:             LTANVEC(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)-XYZ(I*NOPT+1:(I+1)*NOPT)378:             LTANVEC(NTS,1:NOPT)=XYZ((I-1)*NOPT+1:I*NOPT)-XYZ(I*NOPT+1:(I+1)*NOPT)
386:          ENDIF379:          ENDIF
387:       ENDDO380:       ENDDO
388:       IF (ELOCAL(NIMAGE+1).LT.ELOCAL(NIMAGE+2)) THEN381:       IF (ELOCAL(NIMAGE+1).LT.ELOCAL(NIMAGE+2)) THEN
389:          NTS=NTS+1382:          NTS=NTS+1
390:          IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates383:          IF (NTS.GT.MYTSMAX) THEN ! increase storage as required for TS candidates
391:             ALLOCATE(TSTEMP(MYTSMAX,NOPT))384:             ALLOCATE(TSTEMP(MYTSMAX,NOPT))
392:              PRINT *,' D ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)385:             ! PRINT *,' D ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)
393:              PRINT *,' D ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)386:             ! PRINT *,' D ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)
394:             TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)387:             TSTEMP(1:MYTSMAX,1:NOPT)=TSGUESS(1:MYTSMAX,1:NOPT)
395:             DEALLOCATE(TSGUESS)388:             DEALLOCATE(TSGUESS)
396:             ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))389:             ALLOCATE(TSGUESS(2*MYTSMAX,NOPT))
397:             TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)390:             TSGUESS(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
398:             TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)391:             TSTEMP(1:MYTSMAX,1:NOPT)=LTANVEC(1:MYTSMAX,1:NOPT)
399:             DEALLOCATE(LTANVEC)392:             DEALLOCATE(LTANVEC)
400:             ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))393:             ALLOCATE(LTANVEC(2*MYTSMAX,NOPT))
401:             LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)394:             LTANVEC(1:MYTSMAX,1:NOPT)=TSTEMP(1:MYTSMAX,1:NOPT)
402:             DEALLOCATE(TSTEMP)395:             DEALLOCATE(TSTEMP)
403:             MYTSMAX=2*MYTSMAX396:             MYTSMAX=2*MYTSMAX
422: DO J=1,NTS415: DO J=1,NTS
423:    CALL MYCPU_TIME(TIME0,.FALSE.)416:    CALL MYCPU_TIME(TIME0,.FALSE.)
424:    KNOWE=.FALSE.417:    KNOWE=.FALSE.
425:    KNOWG=.FALSE.418:    KNOWG=.FALSE.
426:    IF (BFGSTST) THEN419:    IF (BFGSTST) THEN
427:       IF (UNRST) THEN 420:       IF (UNRST) THEN 
428:          PRINT '(A)',' contslocator> ERROR *** not coded for UNRES'421:          PRINT '(A)',' contslocator> ERROR *** not coded for UNRES'
429:          STOP422:          STOP
430:       ELSE423:       ELSE
431:          VECS(1:NOPT)=LTANVEC(J,1:NOPT)424:          VECS(1:NOPT)=LTANVEC(J,1:NOPT)
432:                             PRINT *,'in output before bfgsts B' 
433:          CALL BFGSTS(NSTEPS,TSGUESS(J,1:NOPT),EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)425:          CALL BFGSTS(NSTEPS,TSGUESS(J,1:NOPT),EDUMMY,LGDUMMY,TSCONVERGED,RMS,EVALMIN,EVALMAX,VECS,ITDONE,.TRUE.,PRINTOPTIMIZETS)
434:                             PRINT *,'in output after bfgsts B' 
435:       ENDIF426:       ENDIF
436:    ELSE427:    ELSE
437:       CALL EFOL(TSGUESS(J,1:NOPT),TSCONVERGED,NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)428:       CALL EFOL(TSGUESS(J,1:NOPT),TSCONVERGED,NSTEPS,EDUMMY,ITDONE,EVALMIN,DEBUG,DIAG,2)
438:    ENDIF429:    ENDIF
439:    CALL MYCPU_TIME(TIME,.FALSE.)430:    CALL MYCPU_TIME(TIME,.FALSE.)
440: 431: 
441:    IF (TSCONVERGED) THEN432:    IF (TSCONVERGED) THEN
442:       NTSFOUND=NTSFOUND+1433:       NTSFOUND=NTSFOUND+1
443:       ALLOCATE(TSFOUND(NTSFOUND)%E,TSFOUND(NTSFOUND)%COORD(NOPT),TSFOUND(NTSFOUND)%EVALMIN,TSFOUND(NTSFOUND)%VECS(NOPT))434:       ALLOCATE(TSFOUND(NTSFOUND)%E,TSFOUND(NTSFOUND)%COORD(NOPT),TSFOUND(NTSFOUND)%EVALMIN,TSFOUND(NTSFOUND)%VECS(NOPT))
444:       TSFOUND(NTSFOUND)%VECS=VECS(1:NOPT)435:       TSFOUND(NTSFOUND)%VECS=VECS(1:NOPT)
455: ENDDO446: ENDDO
456: CALL MYCPU_TIME(ENDTIME,.FALSE.)447: CALL MYCPU_TIME(ENDTIME,.FALSE.)
457: 448: 
458: WRITE(*,'(a)') '.'449: WRITE(*,'(a)') '.'
459: 450: 
460: WRITE(INTSTR,'(i10)') NTSfound451: WRITE(INTSTR,'(i10)') NTSfound
461: 452: 
462: WRITE(*, '(A,F7.2)',advance='yes') ' Constrained potential run yielded '//trim(adjustl(IntStr))// &453: WRITE(*, '(A,F7.2)',advance='yes') ' Constrained potential run yielded '//trim(adjustl(IntStr))// &
463:                   &' true transition state(s) time=',EndTime-StartTime454:                   &' true transition state(s) time=',EndTime-StartTime
464: 455: 
465:  PRINT *,' end ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)456: ! PRINT *,' end ALLOCATED(TSGUESS)=',ALLOCATED(TSGUESS)
466:  PRINT *,' end ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)457: ! PRINT *,' end ALLOCATED(LTANVEC)=',ALLOCATED(LTANVEC)
467: IF (ALLOCATED(TSGUESS)) DEALLOCATE(TSGUESS)458: IF (ALLOCATED(TSGUESS)) DEALLOCATE(TSGUESS)
468: RETURN459: RETURN
469: 460: 
470: END SUBROUTINE CONTSLOCATOR461: END SUBROUTINE CONTSLOCATOR
471: 462: 
472:       SUBROUTINE CHECKTS(DUMMY,EVALMIN,TSCONVERGED)463:       SUBROUTINE CHECKTS(DUMMY,EVALMIN,TSCONVERGED)
473:           USE NEBDATA464:           USE NEBDATA
474:           USE MODCHARMM465:           USE MODCHARMM
475:           USE LINKEDLIST466:           USE LINKEDLIST
476:           IMPLICIT NONE467:           IMPLICIT NONE


legend
Lines Added 
Lines changed
 Lines Removed

hdiff - version: 2.1.0