********>Bugfix 13:
Author: Ross Walker, with help from Bing Wang and Dave Case 
Date: 06/18/2004

Programs: sander.QMMM

Description: Several patches are needed to make the QMMM option work
             correctly, especially for molecular dynamics.  These involve
             glitches in transfering things from the ROAR environment to
             sander.

Fix:         save this file to bugfix.13
             cd $AMBERHOME
             patch -N -p0 -r rejects < bugfix.13

------------------------------------------------------------------------------
*** src/sander/dynlib.f	2004/06/18 15:51:52	7.70
--- src/sander/dynlib.f	2004/06/18 16:01:09
***************
*** 316,322 ****
--- 316,327 ----
     else
        write(6,9059) eel,ehbond,econst
     end if
+ #ifdef QMMM
+    !write the SCF energy
+    write(6,9080) esurf
+ #else
     if (gbsa > 0) write(6,9077) esurf
+ #endif
     if (econst /= 0.0) write(6,9076) epot-econst
     if ( dvdl /= 0.d0) write(6,9089) dvdl
  #ifndef LES
***************
*** 367,373 ****
--- 372,383 ----
     else
        write(7,9059) eel,ehbond,econst
     end if
+ #ifdef QMMM
+    !write the SCF energy
+    write(7,9080) esurf
+ #else
     if (gbsa > 0) write(7,9077) esurf
+ #endif
     if (econst /= 0.0) write(7,9076) epot-econst
     if ( dvdl /= 0.d0) write(7,9089) dvdl
  #ifndef LES
***************
*** 411,416 ****
--- 421,427 ----
     9078 format (1x,'EKCMT  = ',f14.4,2x,'VIRIAL  = ',f14.4,2x, &
           'VOLUME     = ',f14.4)
     9079 format (52x,'Density    = ',f14.4)
+    9080 format (1x,'ESCF   = ',f14.4)
     
  #ifdef LES
     ! LES and non-LES temperatures (no solvent/solute)


*** src/sander/link_atoms.f	2003/12/31 21:19:23	7.5
--- src/sander/link_atoms.f	2004/06/18 16:01:51
***************
*** 1,5 ****
        subroutine link_atoms(nbonds,x,nlink,npert,ib,jb, &
!        qmlink,nquant,labels,natoms,winv,numbon,mmqmbo, &
         igrp)
  !
        implicit double precision (a-h,o-z)
--- 1,5 ----
        subroutine link_atoms(nbonds,x,nlink,npert,ib,jb, &
!        qmlink,nquant,labels,natoms,winv,amass,numbon,mmqmbo, &
         igrp)
  !
        implicit double precision (a-h,o-z)
***************
*** 9,15 ****
  !     common/parms/rk(5000),req(5000),tk(900),teq(900),pk(900),pn(900),
  !    +             phase(900),cn1(1830),cn2(1830),solty(60),
  !    +             gamc(900),gams(900),ipn(900),fmn(900)
!       dimension x(*),ib(*),jb(*),qmlink(*),labels(*),winv(*)
        dimension mmqmbo(*),igrp(*)
  !
  !     PMF info:
--- 9,15 ----
  !     common/parms/rk(5000),req(5000),tk(900),teq(900),pk(900),pn(900),
  !    +             phase(900),cn1(1830),cn2(1830),solty(60),
  !    +             gamc(900),gams(900),ipn(900),fmn(900)
!       dimension x(*),ib(*),jb(*),qmlink(*),labels(*),winv(*),amass(*)
        dimension mmqmbo(*),igrp(*)
  !
  !     PMF info:
***************
*** 82,91 ****
   150      continue
            nlink = mm
        end if
!       do 200 i=1,nlink
!           winv(i) = atinv
!           igrp(i) = 1
!  200  continue
  !
  !     identify those atoms directly bonded to quantum atoms
  !
--- 82,92 ----
   150      continue
            nlink = mm
        end if
!       do i=1,nlink
!          winv(i) = atinv
!          amass(i) = 1.d0/atinv
!          igrp(i) = 1
!       end do
  !
  !     identify those atoms directly bonded to quantum atoms
  !



*** src/sander/locmem.f	2004/03/14 06:07:35	7.116
--- src/sander/locmem.f	2004/06/18 16:02:58
***************
*** 205,211 ****
     
     !     --- real array NMR restraints/weight changes:
     
!    call adj_mem_ptr( r_ptr, lmass, natom )
     call adj_mem_ptr( r_ptr, lnmr01, irlreq )
     
     call adj_mem_ptr( r_ptr, l75, natom )
--- 205,211 ----
     
     !     --- real array NMR restraints/weight changes:
     
!    call adj_mem_ptr( r_ptr, lmass, natom + ncpp )
     call adj_mem_ptr( r_ptr, lnmr01, irlreq )
     
     call adj_mem_ptr( r_ptr, l75, natom )
***************
*** 214,220 ****
--- 214,228 ----
     else if (nmropt > 0 ) then
        call adj_mem_ptr( r_ptr, l95, max(natom, 2*ntbond) )
     else
+ #ifdef QMMM
+       ! QMMM code uses l95 as xwij(3,ln) in resnba. The memory allocated
+       ! to this used to be much bigger in the amber 4.1 days and so we
+       ! need to make sure it is big enough for use in the old nonbond
+       ! list code.
+       call adj_mem_ptr( r_ptr, l95, max(3*nmxrs*nmxrs,2*ntbond) )
+ #else
        call adj_mem_ptr( r_ptr, l95, 2*ntbond )
+ #endif
     end if
     if( igb /= 0 ) then
        call adj_mem_ptr( r_ptr, l96, natom )
***************
*** 323,329 ****
     call adj_mem_ptr( i_ptr, i02, nres + 1 )
     call adj_mem_ptr( i_ptr, i04, natom+ncpp )
     call adj_mem_ptr( i_ptr, i06, ntypes*ntypes )
!    call adj_mem_ptr( i_ptr, i08, natom+ncpp )
     call adj_mem_ptr( i_ptr, i10, 2*nnb )
     iibh = i_ptr
     
--- 331,337 ----
     call adj_mem_ptr( i_ptr, i02, nres + 1 )
     call adj_mem_ptr( i_ptr, i04, natom+ncpp )
     call adj_mem_ptr( i_ptr, i06, ntypes*ntypes )
!    call adj_mem_ptr( i_ptr, i08, natom + ncpp )
     call adj_mem_ptr( i_ptr, i10, 2*nnb )
     iibh = i_ptr
     

*** src/sander/rdparm.f	2004/06/15 21:08:03	7.75
--- src/sander/rdparm.f	2004/06/18 16:03:39
***************
*** 207,222 ****
        left = natom - (num*20)
        kk = 1
        mm = 1
        if(num.ge.1) then
           do i=1,num
              cstrng(:) = ' '
              ll = 1
-             FMTIN = AFMT
-             TYPE = 'ATOM_NAME'
-             CALL NXTSEC(NF,  6,  0,FMTIN,  TYPE,  FMT,  IOK)
-             do jtemp = 1, i-1
-                read(nf,9108)
-             enddo
              read(nf,9138)(cstrng(k),k=1,80)
              call qmcompare(cstrng,itemp,20)
              do n=1,20
--- 207,219 ----
        left = natom - (num*20)
        kk = 1
        mm = 1
+       FMTIN = AFMT
+       TYPE = 'ATOM_NAME'
+       CALL NXTSEC(NF,  6,  0,FMTIN,  TYPE,  FMT,  IOK)
        if(num.ge.1) then
           do i=1,num
              cstrng(:) = ' '
              ll = 1
              read(nf,9138)(cstrng(k),k=1,80)
              call qmcompare(cstrng,itemp,20)
              do n=1,20
***************
*** 237,259 ****
           ll = 1
           read(nf,9138)(cstrng(k),k=1,80)
           call qmcompare(cstrng,itemp,left)
!          if(left.eq.1) then
              if(labels(kk).eq.mm) then
!                mlabel(kk) = itemp(1)
              end if
!          else
!             do n=1,left
!                if(labels(kk).eq.mm) then
!                   mlabel(kk) = itemp(ll)
!                   mm = mm + 1
!                   ll = ll + 1
!                   kk = kk + 1
!                else
!                   mm = mm + 1
!                   ll = ll + 1
!                end if
!             end do
!          end if
        end if
     end if
  #endif
--- 234,250 ----
           ll = 1
           read(nf,9138)(cstrng(k),k=1,80)
           call qmcompare(cstrng,itemp,left)
!          do n=1,left
              if(labels(kk).eq.mm) then
!                mlabel(kk) = itemp(ll)
!                mm = mm + 1
!                ll = ll + 1
!                kk = kk + 1
!             else
!                mm = mm + 1
!                ll = ll + 1
              end if
!          end do
        end if
     end if
  #endif



*** src/sander/runmd.f	2004-06-18 13:37:28.000000000 -0700
--- src/sander/runmd.f	2004-06-18 13:37:43.000000000 -0700
***************
*** 185,194 ****
     lout = .true.
     loutfm = ioutfm <= 0
     nr = nrp
-    nr3 = 3*nr
  #ifdef QMMM
     nr = nr + nlink
  #endif
     ekmh = 0.d0
  #ifdef LES
     ekmhles = 0.d0
--- 185,194 ----
     lout = .true.
     loutfm = ioutfm <= 0
     nr = nrp
  #ifdef QMMM
     nr = nr + nlink
  #endif
+    nr3 = 3*nr
     ekmh = 0.d0
  #ifdef LES
     ekmhles = 0.d0
***************
*** 206,212 ****
     end if
  #else
     istart = 1
!    iend = natom
  #endif
     istart3 = 3*istart -2
     iend3 = 3*iend
--- 206,212 ----
     end if
  #else
     istart = 1
!    iend = nr
  #endif
     istart3 = 3*istart -2
     iend3 = 3*iend
***************
*** 425,430 ****
--- 425,436 ----
     fiti = 0.d0
     fit2 = 0.d0
  
+ #ifdef QMMM
+ !  Set ntnb=1 to ensure that we always do an initial non-bond list update
+ !  before doing any MD, even if this is a restart.
+    ntnb = 1
+ #endif
+ 
     do i = 1,nren
        ener(i) = 0.0d0
        enert(i) = 0.0d0
***************
*** 460,466 ****
           ! ----- CALCULATE THE CENTER OF MASS ENERGY AND THE COORDINATES
           !       OF THE SUB-MOLECULES WITH RESPECT TO ITS OWN CENTER OF
           !       MASS -----
!          call ekcmr(nspm,nsp,tma,ekcmt,xr,v,amass,1,natom)
        end if
        
        ! ----- CALCULATE THE FORCE -----
--- 466,472 ----
           ! ----- CALCULATE THE CENTER OF MASS ENERGY AND THE COORDINATES
           !       OF THE SUB-MOLECULES WITH RESPECT TO ITS OWN CENTER OF
           !       MASS -----
!          call ekcmr(nspm,nsp,tma,ekcmt,xr,v,amass,1,nr)
        end if
        
        ! ----- CALCULATE THE FORCE -----
***************
*** 477,483 ****
        iprint = 1
        !       TIME_force is started and stopped inside force
  #ifdef QMMM
-       if(nstep == 0)  ntnb = 1
        call forcecp(xx,ix,ih,ipairs,x,f,ener(23),vir, &
              r_stack, xx(l96), xx(l97), xx(l98), & 
              do_list_update, ifqnt, nquant,  &
--- 483,488 ----
***************
*** 937,946 ****
                 nstep + 1
  #ifdef PSANDER
        endif
!       call setvel(natom,v,winv,temp0*factt,init,iscale,scalm)
        if (ibelly > 0) call bellyf(nr,ix(ibellygp),v)
  #else
!          call setvel(natom,v,winv,temp0*factt,init,iscale,scalm)
  #ifdef LES
       
        ! newvel call is fixed for the dual target temperatures
--- 942,951 ----
                 nstep + 1
  #ifdef PSANDER
        endif
!       call setvel(nr,v,winv,temp0*factt,init,iscale,scalm)
        if (ibelly > 0) call bellyf(nr,ix(ibellygp),v)
  #else
!          call setvel(nr,v,winv,temp0*factt,init,iscale,scalm)
  #ifdef LES
       
        ! newvel call is fixed for the dual target temperatures
***************
*** 1019,1025 ****
        ! in order.  The unused results are thrown away
  
        i3 = 3*(istart-1)
!       do j=1,natom
           if( jiend ) then
              call gauss( 0.d0, 1.d0, fln )
              call gauss( 0.d0, 1.d0, fln )
--- 1024,1030 ----
        ! in order.  The unused results are thrown away
  
        i3 = 3*(istart-1)
!       do j=1,nr
           if( jiend ) then
              call gauss( 0.d0, 1.d0, fln )
              call gauss( 0.d0, 1.d0, fln )
***************
*** 1567,1576 ****
           !     --- now compute the com motion, remove it, and recompute (just
           !         to check that it is really gone.....)
           
!          call cenmas(natom,f,v,tmass,tmassinv,amass,ekcm, &
                 xcm,vcm,acm,ekrot,ocm,4)
!          call stopcm(natom,f,v,xcm,vcm,ocm)
!          call cenmas(natom,f,v,tmass,tmassinv,amass,ekcm, &
                 xcm,vcm,acm,ekrot,ocm,4)
           
        else
--- 1572,1581 ----
           !     --- now compute the com motion, remove it, and recompute (just
           !         to check that it is really gone.....)
           
!          call cenmas(nr,f,v,tmass,tmassinv,amass,ekcm, &
                 xcm,vcm,acm,ekrot,ocm,4)
!          call stopcm(nr,f,v,xcm,vcm,ocm)
!          call cenmas(nr,f,v,tmass,tmassinv,amass,ekcm, &
                 xcm,vcm,acm,ekrot,ocm,4)
           
        else
***************
*** 1822,1828 ****
        
        if (itdump) then
           if( iwrap == 0 ) then
!             call corpac(x,1,nrx,12,loutfm)
              if(ntb > 0)  call corpac(box,1,3,12,loutfm)
           else
              call get_stack(l_temp,3*natom)
--- 1827,1833 ----
        
        if (itdump) then
           if( iwrap == 0 ) then
!             call corpac(x,1,3*natom,12,loutfm)
              if(ntb > 0)  call corpac(box,1,3,12,loutfm)
           else
              call get_stack(l_temp,3*natom)
***************
*** 1835,1841 ****
                 if (ifbox == 2) call wrap_to(nspm,nsp,r_stack(l_temp),box)
              end if
  #endif
!             call corpac(r_stack(l_temp),1,nrx,12,loutfm)
              if(ntb > 0)  call corpac(box,1,3,12,loutfm)
              call free_stack(l_temp)
           end if
--- 1840,1846 ----
                 if (ifbox == 2) call wrap_to(nspm,nsp,r_stack(l_temp),box)
              end if
  #endif
!             call corpac(r_stack(l_temp),1,3*natom,12,loutfm)
              if(ntb > 0)  call corpac(box,1,3,12,loutfm)
              call free_stack(l_temp)
           end if
***************
*** 1844,1850 ****
        !     Velocity archive:
        
        if (ntwv > 0) then
!          if (mod(nstep,ntwv) == 0) call corpac(v,1,nrx,13,loutfm)
        end if
        
        !     Energy archive:
--- 1849,1855 ----
        !     Velocity archive:
        
        if (ntwv > 0) then
!          if (mod(nstep,ntwv) == 0) call corpac(v,1,3*natom,13,loutfm)
        end if
        
        !     Energy archive:

*** src/sander/sander.f	2004/05/03 17:49:03	7.206
--- src/sander/sander.f	2004/06/18 16:05:37
***************
*** 912,918 ****
            klink = nlink
            call link_atoms(nbona,x(Lcrd),nlink,npert,ix(iiba), &
               ix(ijba),x(Lcrd+3*natom),nquant, &
!              labels,natom,x(Lwinv+natom),mmqmbo(1),mmqmbo(2), &
               ix(icnstrgp+nr))
            if((imin.eq.0).and.(nlink.ne.0).and.(klink.eq.0)) then
                write(6,*) 'FATAL ERROR'
--- 912,918 ----
            klink = nlink
            call link_atoms(nbona,x(Lcrd),nlink,npert,ix(iiba), &
               ix(ijba),x(Lcrd+3*natom),nquant, &
!              labels,natom,x(Lwinv+natom),x(Lmass+natom),mmqmbo(1),mmqmbo(2), &
               ix(icnstrgp+nr))
            if((imin.eq.0).and.(nlink.ne.0).and.(klink.eq.0)) then
                write(6,*) 'FATAL ERROR'
***************
*** 926,943 ****
            end if
  
            if(nbona.gt.0) then
!               itemp = nbona
!               call del_bond2(nbona,ix(iibh+nbonh),ix(ijbh+nbonh), &
!                   ix(iicbh+nbonh),ix(iiba),ix(ijba),ix(iicba),  &
                    nquant,labels)
-               idiff = itemp - nbona
-               nbona = nbona - idiff
- 
- !     adjust memory location pointers to reflect changes in bonding
- 
-               Iiba = Iibh + nbonh
-               Ijba = Ijbh + nbonh
-               Iicba = Iicbh + nbonh
            end if
  
  !         now that all of the "qm bonds" have been deleted from the bond lists
--- 926,933 ----
            end if
  
            if(nbona.gt.0) then
!               call del_bond(nbona,ix(iiba),ix(ijba),ix(iicba), &
                    nquant,labels)
            end if
  
  !         now that all of the "qm bonds" have been deleted from the bond lists



*** src/divcon/dcartcl.f	2004/01/15 00:31:12	1.1
--- src/divcon/dcartcl.f	2004/06/18 16:06:21
***************
*** 27,34 ****
        IMPLICIT DOUBLE PRECISION (A-H,O-Z)                                       
  #include "divcon.dim"
  #include "divcon.h"
!       
! c#include "sizesqm.h"
        DIMENSION COORD(3,*), DXYZQM(3,*),crdsmm(*),DXYZMM(3,*),
       .          chrgs(*),iqmres(*),mark(*),jqatms(*)
        dimension xyz_qm(3),xyz_mm(3),psum(171)
--- 27,34 ----
        IMPLICIT DOUBLE PRECISION (A-H,O-Z)                                       
  #include "divcon.dim"
  #include "divcon.h"
! #include "sizesqm.h"
! 
        DIMENSION COORD(3,*), DXYZQM(3,*),crdsmm(*),DXYZMM(3,*),
       .          chrgs(*),iqmres(*),mark(*),jqatms(*)
        dimension xyz_qm(3),xyz_mm(3),psum(171)
***************
*** 93,99 ****
  c        DEBUG = (INDEX(KEYWRD,'DCART') .NE. 0)                                 
  c        FORCE = (INDEX(KEYWRD,'PREC')+INDEX(KEYWRD,'FORCE') .NE. 0)            
        ENDIF                                                                     
!       do 20 i=1,natoms
           do 10 j=1,3
              dxyzmm(j,i) = 0.0d0
   10      continue
--- 93,99 ----
  c        DEBUG = (INDEX(KEYWRD,'DCART') .NE. 0)                                 
  c        FORCE = (INDEX(KEYWRD,'PREC')+INDEX(KEYWRD,'FORCE') .NE. 0)            
        ENDIF                                                                     
!       do 20 i=1,mxatom
           do 10 j=1,3
              dxyzmm(j,i) = 0.0d0
   10      continue



*** src/divcon/qm_mm.f	2004/01/15 00:31:23	1.1
--- src/divcon/qm_mm.f	2004/06/18 16:08:07
***************
*** 46,52 ****
  
  #include "divcon.dim"
  #include "divcon.h"
! c#include "OLD/SIZES" 
  
  C     character keywrd*241
  C
--- 46,52 ----
  
  #include "divcon.dim"
  #include "divcon.h"
! #include "sizesqm.h"
  
  C     character keywrd*241
  C
***************
*** 66,73 ****
  c     COMMON /DIPSTO/ UX,UY,UZ,CH(NUMATM)
  c#include "../sizesqm.h"
  
-       parameter (mxatom=20000)
-    
        dimension qcords(3,mxatom),jqatms(*),mlabel(*),x(*),chrgs(*)
        dimension qmlink(*),forces(*)
        dimension dxyzqm(3,mxatom),dxyzcl(3,mxatom)
--- 66,71 ----
***************
*** 151,157 ****
       $                  nquatm,x,chrgs,iread,
       $                  iqmres,mark,jqatms)
             endif
!             call wrttims
            if (icalcf.eq.0) then
               call gcart(dxyzqm)
               if (idc.eq.1) then
--- 149,155 ----
       $                  nquatm,x,chrgs,iread,
       $                  iqmres,mark,jqatms)
             endif
! c           call wrttims
            if (icalcf.eq.0) then
               call gcart(dxyzqm)
               if (idc.eq.1) then
***************
*** 167,181 ****
           call atmchg
           call wrtchg
          endif
!          write(iout,'(/" ELECTRONIC ENERGY     = ",f25.8," EV",
!      .        /" CORE-CORE REPULSIONS  = ",f25.8," EV")')
!      .        eelect,ecore
!          write(iout,'(" TOTAL ENERGY          = ",f25.8," EV",
!      .           /" HEAT OF FORMATION     = ",f25.8," KCAL/MOL")')
!      .        etot,escf
!          write(iout,'(" FERMI ENERGY          = ",f25.8," EV")')
!      .        efermi(1)
!         call wrtxyz
  c
  c     calculate electrostatic potential
  c
--- 165,179 ----
           call atmchg
           call wrtchg
          endif
! c        write(iout,'(/" ELECTRONIC ENERGY     = ",f25.8," EV",
! c    .        /" CORE-CORE REPULSIONS  = ",f25.8," EV")')
! c    .        eelect,ecore
! c        write(iout,'(" TOTAL ENERGY          = ",f25.8," EV",
! c    .           /" HEAT OF FORMATION     = ",f25.8," KCAL/MOL")')
! c    .        etot,escf
! c        write(iout,'(" FERMI ENERGY          = ",f25.8," EV")')
! c    .        efermi(1)
! c       call wrtxyz
  c
  c     calculate electrostatic potential
  c
***************
*** 218,224 ****
                enddo
           endif
        enddo
!       else           
        do 300 i=1,nquatm
            m = jqatms(i)
            do 320 j=1,3
--- 216,227 ----
                enddo
           endif
        enddo
!       do i=1,ntotatm
!          do j=1,3
!             forces((i-1)*3+j) = forces((i-1)*3+j) - dxyzcl(j,i)
!          enddo
!       enddo
!       else          
        do 300 i=1,nquatm
            m = jqatms(i)
            do 320 j=1,3



*** src/divcon/rotatecl.f	2004/01/15 00:31:30	1.1
--- src/divcon/rotatecl.f	2004/06/18 16:13:09
***************
*** 106,117 ****
           write(iout,*) 'Program terminated'
           stop
  C 
!       ELSE IF (ITYPE.EQ.4) THEN                                                 
  C                                                                               
  C     MINDO CASE                                                                
  C
!          write(iout,*) 'MINDO not supported -- program terminated'
!          stop
  C                                                                               
  C     MNDO, AM1 PM3 CASES
  C                                                                               
--- 106,117 ----
           write(iout,*) 'Program terminated'
           stop
  C 
! C     ELSE IF (ITYPE.EQ.4) THEN                                                 
  C                                                                               
  C     MINDO CASE                                                                
  C
! C        write(iout,*) 'MINDO not supported -- program terminated'
! C        stop
  C                                                                               
  C     MNDO, AM1 PM3 CASES
  C                                                                               
***************
*** 212,234 ****
           SCALE = EXP(-ACI*RIJ)+EXP(-alph_mm*RIJ)
           ENUC = ZNUCI*chrg_mm*GAM                                           
           SCALE=ABS(SCALE*ENUC)                                                  
!          if(igauss.eq.1)then
! c
! c          Add on gaussion functions for QM atom.  This repulsion term
! c          historically has not been used in QM/MM calculations.
! c
! C          IF(ITYPE.EQ.2.OR.ITYPE.EQ.3)THEN
!              DO 40 IG=1,4 
! C              IF(ABS(FN1(NI,IG)).GT.0.0D0)THEN
!                  AX = BGI(IG)*(RIJ-CGI(IG))**2
!                  IF(AX.LE.25.0D0)THEN
!                    SCALE = SCALE +
!      .                     ZNUCI*chrg_mm/RIJ*AGI(IG)*EXP(-AX)
!                  ENDIF
! C              ENDIF
!  40          CONTINUE
! C          ENDIF
!          endif
           ENUC=ENUC+SCALE                                                        
        ENDIF                                                                     
        RETURN                                                                    
--- 212,234 ----
           SCALE = EXP(-ACI*RIJ)+EXP(-alph_mm*RIJ)
           ENUC = ZNUCI*chrg_mm*GAM                                           
           SCALE=ABS(SCALE*ENUC)                                                  
! C         if(igauss.eq.1)then
! Cc
! Cc          Add on gaussion functions for QM atom.  This repulsion term
! Cc          historically has not been used in QM/MM calculations.
! Cc
! CC          IF(ITYPE.EQ.2.OR.ITYPE.EQ.3)THEN
! C             DO 40 IG=1,4 
! CC              IF(ABS(FN1(NI,IG)).GT.0.0D0)THEN
! C                 AX = BGI(IG)*(RIJ-CGI(IG))**2
! C                 IF(AX.LE.25.0D0)THEN
! C                   SCALE = SCALE +
! C     .                     ZNUCI*chrg_mm/RIJ*AGI(IG)*EXP(-AX)
! C                 ENDIF
! CC              ENDIF
! C 40          CONTINUE
! CC          ENDIF
! C         endif
           ENUC=ENUC+SCALE                                                        
        ENDIF                                                                     
        RETURN                                                                    

*** test/qmmm/standard/lysine.out.save	2004/03/11 23:23:47	1.6
--- test/qmmm/standard/lysine.out.save	2004/06/18 16:26:39
***************
*** 3,9 ****
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 01/26/2004 at 01:10:40
    [-O]verwriting output
  
  File Assignments:
--- 3,9 ----
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 06/18/2004 at 09:21:31
    [-O]verwriting output
  
  File Assignments:
***************
*** 28,34 ****
          imin =1, maxcyc = 20, drms=0.005,                                      
          scee=1.2, ntpr=5, ntb=0, cut=99.,                                      
          ifqt=1, nqt= 3, idc=0                                                  
!  /   
   8 9 10                                                                        
  END                                                                            
  END                                                                            
--- 28,34 ----
          imin =1, maxcyc = 20, drms=0.005,                                      
          scee=1.2, ntpr=5, ntb=0, cut=99.,                                      
          ifqt=1, nqt= 3, idc=0                                                  
!  /                                                                             
   8 9 10                                                                        
  END                                                                            
  END                                                                            
***************
*** 50,62 ****
  
  
  |     Memory Use     Allocated
! |     Real                4176
  |     Hollerith           1635
! |     Integer            22805
  |     Max Pairs            231
  |     Max Rstack         50220
  |     Max Istack           110
! |       Total              521 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
--- 50,62 ----
  
  
  |     Memory Use     Allocated
! |     Real                5886
  |     Hollerith           1635
! |     Integer            23449
  |     Max Pairs            231
  |     Max Rstack         50220
  |     Max Istack           110
! |       Total              537 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
***************
*** 116,154 ****
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       1.1240E+00     1.2476E+01     4.8342E+01     C          21
  
!  BOND    =        0.3067  ANGLE   =        0.4890  DIHED      =        0.0039
!  VDWAALS =        0.2595  EEL     =       -5.6916  HBOND      =        0.0000
!  1-4 VDW =        3.6343  1-4 EEL =       61.6404  RESTRAINT  =        0.0000
!  ESCF    =      -59.5182
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      10       1.2645E+00     2.8947E+01     1.2481E+02     C          21
  
!  BOND    =        0.5395  ANGLE   =        0.5698  DIHED      =        0.0046
!  VDWAALS =        0.2956  EEL     =       -5.6340  HBOND      =        0.0000
!  1-4 VDW =        3.6447  1-4 EEL =       61.6286  RESTRAINT  =        0.0000
!  ESCF    =      -59.7843
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      15       1.2691E+00     4.6916E+01     2.0912E+02     C          21
  
!  BOND    =        0.5454  ANGLE   =        0.5716  DIHED      =        0.0046
!  VDWAALS =        0.2965  EEL     =       -5.6328  HBOND      =        0.0000
!  1-4 VDW =        3.6451  1-4 EEL =       61.6285  RESTRAINT  =        0.0000
!  ESCF    =      -59.7897
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      20       1.2681E+00     6.4973E+01     2.9359E+02     C          21
  
!  BOND    =        0.5441  ANGLE   =        0.5712  DIHED      =        0.0046
!  VDWAALS =        0.2963  EEL     =       -5.6331  HBOND      =        0.0000
!  1-4 VDW =        3.6450  1-4 EEL =       61.6285  RESTRAINT  =        0.0000
!  ESCF    =      -59.7886
  
  
    Maximum number of minimization cycles reached.
--- 116,154 ----
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       7.3477E-01     2.4227E+00     7.9326E+00     N           1
  
!  BOND    =        0.0972  ANGLE   =        0.4191  DIHED      =        0.0039
!  VDWAALS =        0.1497  EEL     =       -5.7891  HBOND      =        0.0000
!  1-4 VDW =        3.4866  1-4 EEL =       61.5670  RESTRAINT  =        0.0000
!  ESCF    =      -59.1996
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      10      -2.1110E-01     9.5830E-01     4.1484E+00     CG          8
  
!  BOND    =        0.2291  ANGLE   =        0.9455  DIHED      =        0.0151
!  VDWAALS =       -0.0998  EEL     =       -5.6180  HBOND      =        0.0000
!  1-4 VDW =        3.0296  1-4 EEL =       61.2042  RESTRAINT  =        0.0000
!  ESCF    =      -59.9167
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      15      -4.2612E-01     1.0603E+00     3.3223E+00     C          21
  
!  BOND    =        0.3464  ANGLE   =        1.1014  DIHED      =        0.0189
!  VDWAALS =       -0.1971  EEL     =       -5.5027  HBOND      =        0.0000
!  1-4 VDW =        2.9251  1-4 EEL =       61.0328  RESTRAINT  =        0.0000
!  ESCF    =      -60.1508
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      20      -6.5331E-01     9.8858E-01     2.8940E+00     N           1
  
!  BOND    =        0.4478  ANGLE   =        1.4345  DIHED      =        0.0264
!  VDWAALS =       -0.3677  EEL     =       -5.2667  HBOND      =        0.0000
!  1-4 VDW =        2.8055  1-4 EEL =       60.6462  RESTRAINT  =        0.0000
!  ESCF    =      -60.3792
  
  
    Maximum number of minimization cycles reached.
***************
*** 159,190 ****
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      20       1.2681E+00     6.4973E+01     2.9359E+02     C          21
  
!  BOND    =        0.5441  ANGLE   =        0.5712  DIHED      =        0.0046
!  VDWAALS =        0.2963  EEL     =       -5.6331  HBOND      =        0.0000
!  1-4 VDW =        3.6450  1-4 EEL =       61.6285  RESTRAINT  =        0.0000
!  ESCF    =      -59.7886
   
  
  --------------------------------------------------------------------------------
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.00 ( 0.54% of Total)
! |    Fast Water setup           0.00 ( 0.18% of Total)
! |          Nonbond force              0.00 ( 9.96% of Force)
! |          QMMM energy                0.04 (84.85% of Force)
! |          Bond/Angle/Dihedral        0.00 ( 4.76% of Force)
! |          Other                      0.00 ( 0.43% of Force)
! |       Force time                 0.05 (100.0% of Runmd)
! |    Runmd Time                 0.05 (83.54% of Total)
! |    Other                      0.01 (15.73% of Total)
! | Total time                 0.06 (100.0% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 01:10:40.034  on 01/26/2004
! |           Setup done at 01:10:40.041  on 01/26/2004
! |           Run   done at 01:10:40.089  on 01/26/2004
! |     wallclock() was called     530 times
--- 159,188 ----
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!      20      -6.5331E-01     9.8858E-01     2.8940E+00     N           1
  
!  BOND    =        0.4478  ANGLE   =        1.4345  DIHED      =        0.0264
!  VDWAALS =       -0.3677  EEL     =       -5.2667  HBOND      =        0.0000
!  1-4 VDW =        2.8055  1-4 EEL =       60.6462  RESTRAINT  =        0.0000
!  ESCF    =      -60.3792
   
  
  --------------------------------------------------------------------------------
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.02 ( 1.10% of Total)
! |          Nonbond force              0.02 ( 2.08% of Force)
! |          QMMM energy                0.93 (96.78% of Force)
! |          Bond/Angle/Dihedral        0.01 ( 1.14% of Force)
! |       Force time                 0.96 (100.0% of Runmd)
! |    Runmd Time                 0.96 (52.77% of Total)
! |    Other                      0.84 (46.13% of Total)
! | Total time                 1.82 (98.38% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 09:21:30.963  on 06/18/2004
! |           Setup done at 09:21:31.754  on 06/18/2004
! |           Run   done at 09:21:32.836  on 06/18/2004
! |     wallclock() was called     588 times



*** test/qmmm/divcon/crambin.out.save	2004/03/11 23:23:47	1.6
--- test/qmmm/divcon/crambin.out.save	2004/06/18 16:29:20
***************
*** 3,9 ****
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 03/04/2004 at 01:21:35
    [-O]verwriting output
  
  File Assignments:
--- 3,9 ----
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 06/18/2004 at 09:27:33
    [-O]verwriting output
  
  File Assignments:
***************
*** 20,34 ****
  |INPDIP: inpdip                                                                
  |RSTDIP: rstdip                                                                
  
! 
   Here is the input file:
! 
  Crambin: 5 cycles minimization using D&C qm calculation                        
   &cntrl                                                                        
          imin =1, maxcyc = 5, drms=0.005,                                       
          scee=1.2, ntpr=1, ntb=0, cut=8.1,                                      
          ifqt=1, nqt= 80, idc=1,                                                
!  /   
   80 81 82 83 84 85 86 87 88 89 90                                              
   91 92 99 100 101 102 103 104                                                  
   105 106 107 108 115 116 117 118                                               
--- 20,34 ----
  |INPDIP: inpdip                                                                
  |RSTDIP: rstdip                                                                
  
!  
   Here is the input file:
!  
  Crambin: 5 cycles minimization using D&C qm calculation                        
   &cntrl                                                                        
          imin =1, maxcyc = 5, drms=0.005,                                       
          scee=1.2, ntpr=1, ntb=0, cut=8.1,                                      
          ifqt=1, nqt= 80, idc=1,                                                
!  /                                                                             
   80 81 82 83 84 85 86 87 88 89 90                                              
   91 92 99 100 101 102 103 104                                                  
   105 106 107 108 115 116 117 118                                               
***************
*** 60,72 ****
  
  
  |     Memory Use     Allocated
! |     Real               25280
  |     Hollerith           5400
  |     Integer            55343
  |     Max Pairs         205761
  |     Max Rstack         56420
  |     Max Istack          3210
! |       Total             1691 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
--- 60,72 ----
  
  
  |     Memory Use     Allocated
! |     Real               26010
  |     Hollerith           5400
  |     Integer            55343
  |     Max Pairs         205761
  |     Max Rstack         56420
  |     Max Istack          3210
! |       Total             1697 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
***************
*** 117,164 ****
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       1       1.6067E+03     2.6375E+02     4.2280E+03     SG        373
  
!  BOND    =       51.8279  ANGLE   =       71.9091  DIHED      =      175.6588
   VDWAALS =     2106.9976  EEL     =    -3217.8815  HBOND      =        0.0000
   1-4 VDW =      179.4333  1-4 EEL =     2334.7305  RESTRAINT  =        0.0000
   ESCF    =      -95.9452
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       2       1.5493E+03     2.5693E+02     4.1174E+03     SG        373
  
!  BOND    =       51.7529  ANGLE   =       71.8969  DIHED      =      175.6565
!  VDWAALS =     2049.6784  EEL     =    -3217.8951  HBOND      =        0.0000
!  1-4 VDW =      179.4366  1-4 EEL =     2334.7293  RESTRAINT  =        0.0000
!  ESCF    =      -96.0023
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       3       1.4822E+03     2.4899E+02     3.9889E+03     SG        373
  
!  BOND    =       51.6618  ANGLE   =       71.8833  DIHED      =      175.6537
!  VDWAALS =     1982.8540  EEL     =    -3217.9113  HBOND      =        0.0000
!  1-4 VDW =      179.4406  1-4 EEL =     2334.7276  RESTRAINT  =        0.0000
!  ESCF    =      -96.0725
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       4       1.4045E+03     2.3982E+02     3.8403E+03     SG        373
  
!  BOND    =       51.5509  ANGLE   =       71.8685  DIHED      =      175.6504
!  VDWAALS =     1905.3900  EEL     =    -3217.9309  HBOND      =        0.0000
!  1-4 VDW =      179.4452  1-4 EEL =     2334.7254  RESTRAINT  =        0.0000
!  ESCF    =      -96.1592
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       1.3151E+03     2.2929E+02     3.6700E+03     SG        227
  
!  BOND    =       51.4155  ANGLE   =       71.8529  DIHED      =      175.6464
!  VDWAALS =     1816.2003  EEL     =    -3217.9544  HBOND      =        0.0000
!  1-4 VDW =      179.4506  1-4 EEL =     2334.7224  RESTRAINT  =        0.0000
!  ESCF    =      -96.2667
  
  
    Maximum number of minimization cycles reached.
--- 117,164 ----
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       1       1.6080E+03     2.6376E+02     4.2280E+03     SG        373
  
!  BOND    =       53.1269  ANGLE   =       71.9091  DIHED      =      175.6588
   VDWAALS =     2106.9976  EEL     =    -3217.8815  HBOND      =        0.0000
   1-4 VDW =      179.4333  1-4 EEL =     2334.7305  RESTRAINT  =        0.0000
   ESCF    =      -95.9452
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       2       1.5506E+03     2.5693E+02     4.1175E+03     SG        373
  
!  BOND    =       53.0505  ANGLE   =       71.8970  DIHED      =      175.6564
!  VDWAALS =     2049.6793  EEL     =    -3217.8943  HBOND      =        0.0000
!  1-4 VDW =      179.4364  1-4 EEL =     2334.7296  RESTRAINT  =        0.0000
!  ESCF    =      -96.0046
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       3       1.4835E+03     2.4900E+02     3.9889E+03     SG        373
  
!  BOND    =       52.9577  ANGLE   =       71.8836  DIHED      =      175.6537
!  VDWAALS =     1982.8559  EEL     =    -3217.9096  HBOND      =        0.0000
!  1-4 VDW =      179.4401  1-4 EEL =     2334.7283  RESTRAINT  =        0.0000
!  ESCF    =      -96.0776
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       4       1.4058E+03     2.3983E+02     3.8404E+03     SG        373
  
!  BOND    =       52.8446  ANGLE   =       71.8690  DIHED      =      175.6503
!  VDWAALS =     1905.3932  EEL     =    -3217.9279  HBOND      =        0.0000
!  1-4 VDW =      179.4444  1-4 EEL =     2334.7265  RESTRAINT  =        0.0000
!  ESCF    =      -96.1677
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       1.3164E+03     2.2930E+02     3.6700E+03     SG        373
  
!  BOND    =       52.7065  ANGLE   =       71.8537  DIHED      =      175.6463
!  VDWAALS =     1816.2049  EEL     =    -3217.9499  HBOND      =        0.0000
!  1-4 VDW =      179.4495  1-4 EEL =     2334.7240  RESTRAINT  =        0.0000
!  ESCF    =      -96.2794
  
  
    Maximum number of minimization cycles reached.
***************
*** 169,199 ****
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       1.3151E+03     2.2929E+02     3.6700E+03     SG        227
! 
!  BOND    =       51.4155  ANGLE   =       71.8529  DIHED      =      175.6464
!  VDWAALS =     1816.2003  EEL     =    -3217.9544  HBOND      =        0.0000
!  1-4 VDW =      179.4506  1-4 EEL =     2334.7224  RESTRAINT  =        0.0000
!  ESCF    =      -96.2667
  
  
  --------------------------------------------------------------------------------
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.01 ( 0.07% of Total)
! |          Nonbond force              0.04 ( 0.52% of Force)
! |          QMMM energy                7.10 (99.33% of Force)
! |          Bond/Angle/Dihedral        0.01 ( 0.14% of Force)
! |          Other                      0.00 ( 0.01% of Force)
! |       Force time                 7.15 (100.0% of Runmd)
! |    Runmd Time                 7.15 (98.50% of Total)
! |    Other                      0.10 ( 1.43% of Total)
! | Total time                 7.26 (100.0% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 01:21:35.039  on 03/04/2004
! |           Setup done at 01:21:35.112  on 03/04/2004
! |           Run   done at 01:21:42.298  on 03/04/2004
  |     wallclock() was called     206 times
--- 169,198 ----
  
  
     NSTEP       ENERGY          RMS            GMAX         NAME    NUMBER
!       5       1.3164E+03     2.2930E+02     3.6700E+03     SG        373
  
+  BOND    =       52.7065  ANGLE   =       71.8537  DIHED      =      175.6463
+  VDWAALS =     1816.2049  EEL     =    -3217.9499  HBOND      =        0.0000
+  1-4 VDW =      179.4495  1-4 EEL =     2334.7240  RESTRAINT  =        0.0000
+  ESCF    =      -96.2794
+  
  
  --------------------------------------------------------------------------------
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.01 ( 0.08% of Total)
! |          Nonbond force              0.10 ( 0.81% of Force)
! |          QMMM energy               12.19 (99.11% of Force)
! |          Bond/Angle/Dihedral        0.01 ( 0.08% of Force)
! |       Force time                12.30 (100.0% of Runmd)
! |    Runmd Time                12.30 (98.48% of Total)
! |    Other                      0.18 ( 1.44% of Total)
! | Total time                12.49 (100.0% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 09:27:33.845  on 06/18/2004
! |           Setup done at 09:27:34.025  on 06/18/2004
! |           Run   done at 09:27:46.333  on 06/18/2004
  |     wallclock() was called     206 times



*** src/sander/Makefile	2004/03/16 00:20:27	8.1
--- src/sander/Makefile	2004/06/17 17:31:04	8.2
***************
*** 136,142 ****
        threeb.o tripl.o nmrrad.o decnvh.o \
        fastwt.o echoin.o parallel.o jnrg.o \
        shake.o ene.QMMM.o mdwrit.QMMM.o minrit.QMMM.o \
!       set.o setmm.o dynlib.o mdfil.o nmlsrc.o \
        pcshift.o align.o \
        rstack.o istack.o rfree.o rgroup.o \
        random.o lsqfit.o amopen.o \
--- 136,142 ----
        threeb.o tripl.o nmrrad.o decnvh.o \
        fastwt.o echoin.o parallel.o jnrg.o \
        shake.o ene.QMMM.o mdwrit.QMMM.o minrit.QMMM.o \
!       set.o setmm.o dynlib.QMMM.o mdfil.o nmlsrc.o \
        pcshift.o align.o \
        rstack.o istack.o rfree.o rgroup.o \
        random.o lsqfit.o amopen.o \
***************
*** 502,507 ****
--- 502,511 ----
  	$(FC) -c $(FFLAGS) -o $@ _sander.f
  
  #  --- routines for sander.QMMM:
+ 
+ dynlib.QMMM.o:  dynlib.f
+ 	$(FPP) -DQMMM dynlib.f > _dynlib.f
+ 	$(FC) -c $(FFLAGS) -o $@ _dynlib.f
  
  printe.QMMM.o:  printe.f
  	$(FPP) -DQMMM printe.f > _printe.f


*** test/qmmm/divcon/crambin_md.out.save	2004-03-11 16:40:21.000000000 -0800
--- test/qmmm/divcon/crambin_md.out.save	2004-06-18 11:33:31.000000000 -0700
***************
*** 3,9 ****
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 03/02/2004 at 12:12:18
    [-O]verwriting output
  
  File Assignments:
--- 3,9 ----
            Amber 8  SANDER                 Scripps/UCSF 2004
            -------------------------------------------------------
  
! | Run on 06/18/2004 at 11:32:49
    [-O]verwriting output
  
  File Assignments:
***************
*** 28,34 ****
          imin =0, nstlim=10,                                                    
          scee=1.2, ntpr=1, ntb=0, cut=8.1,                                      
          ifqt=1, nqt= 80, idc=1,                                                
!  /   
   80 81 82 83 84 85 86 87 88 89 90                                              
   91 92 99 100 101 102 103 104                                                  
   105 106 107 108 115 116 117 118                                               
--- 28,34 ----
          imin =0, nstlim=10,                                                    
          scee=1.2, ntpr=1, ntb=0, cut=8.1,                                      
          ifqt=1, nqt= 80, idc=1,                                                
!  /                                                                             
   80 81 82 83 84 85 86 87 88 89 90                                              
   91 92 99 100 101 102 103 104                                                  
   105 106 107 108 115 116 117 118                                               
***************
*** 60,72 ****
  
  
  |     Memory Use     Allocated
! |     Real               17536
  |     Hollerith           5400
  |     Integer            55343
  |     Max Pairs         205761
  |     Max Rstack         56420
  |     Max Istack          3210
! |       Total             1631 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
--- 60,72 ----
  
  
  |     Memory Use     Allocated
! |     Real               18266
  |     Hollerith           5400
  |     Integer            55343
  |     Max Pairs         205761
  |     Max Rstack         56420
  |     Max Istack          3210
! |       Total             1637 kbytes
  | Duplicated    0 dihedrals
  | Duplicated    0 dihedrals
  
***************
*** 116,228 ****
   NB-update: NPAIRS =   94449  HBPAIR =       0
  
   NSTEP =        0   TIME(PS) =       0.000  TEMP(K) =     0.00  PRESS =     0.0
!  Etot   =      -866.9698  EKtot   =         0.0000  EPtot      =      -866.9698
!  BOND   =        13.7445  ANGLE   =        75.7358  DIHED      =       173.5178
   1-4 NB =       172.5680  1-4 EEL =      2309.5141  VDWAALS    =      -271.4044
   EELEC  =     -3215.6062  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        1   TIME(PS) =       0.001  TEMP(K) =     0.00  PRESS =     0.0
!  Etot   =      -866.9698  EKtot   =         0.0000  EPtot      =      -866.9698
!  BOND   =        13.7445  ANGLE   =        75.7358  DIHED      =       173.5178
   1-4 NB =       172.5680  1-4 EEL =      2309.5141  VDWAALS    =      -271.4044
   EELEC  =     -3215.6062  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        2   TIME(PS) =       0.002  TEMP(K) =     1.67  PRESS =     0.0
!  Etot   =      -867.1063  EKtot   =         3.2241  EPtot      =      -870.3304
!  BOND   =        12.8867  ANGLE   =        75.0051  DIHED      =       173.4872
!  1-4 NB =       172.4190  1-4 EEL =      2309.3034  VDWAALS    =      -271.5678
!  EELEC  =     -3215.7262  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        3   TIME(PS) =       0.003  TEMP(K) =     5.54  PRESS =     0.0
!  Etot   =      -867.3391  EKtot   =        10.6932  EPtot      =      -878.0323
!  BOND   =        11.1917  ANGLE   =        73.0103  DIHED      =       173.4018
!  1-4 NB =       171.9992  1-4 EEL =      2308.6660  VDWAALS    =      -272.0499
!  EELEC  =     -3216.0256  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        4   TIME(PS) =       0.004  TEMP(K) =     9.45  PRESS =     0.0
!  Etot   =      -867.4061  EKtot   =        18.2594  EPtot      =      -885.6655
!  BOND   =        10.2671  ANGLE   =        70.2827  DIHED      =       173.2802
!  1-4 NB =       171.3814  1-4 EEL =      2307.5924  VDWAALS    =      -272.8338
!  EELEC  =     -3216.3475  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        5   TIME(PS) =       0.005  TEMP(K) =    12.54  PRESS =     0.0
!  Etot   =      -867.1638  EKtot   =        24.2249  EPtot      =      -891.3887
!  BOND   =        10.6285  ANGLE   =        67.5332  DIHED      =       173.1507
!  1-4 NB =       170.6619  1-4 EEL =      2306.0835  VDWAALS    =      -273.9011
!  EELEC  =     -3216.5023  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        6   TIME(PS) =       0.006  TEMP(K) =    15.52  PRESS =     0.0
!  Etot   =      -866.9821  EKtot   =        29.9780  EPtot      =      -896.9600
!  BOND   =        11.2789  ANGLE   =        65.4617  DIHED      =       173.0481
!  1-4 NB =       169.9327  1-4 EEL =      2304.1671  VDWAALS    =      -275.2252
!  EELEC  =     -3216.3493  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        7   TIME(PS) =       0.007  TEMP(K) =    18.77  PRESS =     0.0
!  Etot   =      -867.0259  EKtot   =        36.2533  EPtot      =      -903.2792
!  BOND   =        11.0953  ANGLE   =        64.5874  DIHED      =       173.0105
!  1-4 NB =       169.2576  1-4 EEL =      2301.9111  VDWAALS    =      -276.7513
!  EELEC  =     -3215.8623  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        8   TIME(PS) =       0.008  TEMP(K) =    21.30  PRESS =     0.0
!  Etot   =      -867.0781  EKtot   =        41.1380  EPtot      =      -908.2161
!  BOND   =        10.2332  ANGLE   =        65.1362  DIHED      =       173.0753
!  1-4 NB =       168.6568  1-4 EEL =      2299.4251  VDWAALS    =      -278.3904
!  EELEC  =     -3215.1518  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        9   TIME(PS) =       0.009  TEMP(K) =    22.09  PRESS =     0.0
!  Etot   =      -866.9373  EKtot   =        42.6589  EPtot      =      -909.5962
!  BOND   =         9.8683  ANGLE   =        66.9992  DIHED      =       173.2749
!  1-4 NB =       168.1032  1-4 EEL =      2296.8495  VDWAALS    =      -280.0343
!  EELEC  =     -3214.4341  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =    21.48  PRESS =     0.0
!  Etot   =      -866.6459  EKtot   =        41.4931  EPtot      =      -908.1390
!  BOND   =        10.7214  ANGLE   =        69.7649  DIHED      =       173.6325
!  1-4 NB =       167.5306  1-4 EEL =      2294.3332  VDWAALS    =      -281.5833
!  EELEC  =     -3213.9580  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
        A V E R A G E S   O V E R      10 S T E P S
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =    12.84  PRESS =     0.0
!  Etot   =      -867.0655  EKtot   =        24.7923  EPtot      =      -891.8577
!  BOND   =        11.1916  ANGLE   =        69.3516  DIHED      =       173.2879
!  1-4 NB =       170.2510  1-4 EEL =      2303.7845  VDWAALS    =      -275.3741
!  EELEC  =     -3215.5963  EHBOND  =         0.0000  RESTRAINT  =         0.0000
   ------------------------------------------------------------------------------
  
  
        R M S  F L U C T U A T I O N S
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =     7.93  PRESS =     0.0
!  Etot   =         0.2031  EKtot   =        15.3140  EPtot      =        15.2196
!  BOND   =         1.1606  ANGLE   =         3.8933  DIHED      =         0.2057
!  1-4 NB =         1.7383  1-4 EEL =         5.1670  VDWAALS    =         3.4815
!  EELEC  =         0.8035  EHBOND  =         0.0000  RESTRAINT  =         0.0000
! |E(PBS) =         0.2608
   ------------------------------------------------------------------------------
  
  
--- 116,241 ----
   NB-update: NPAIRS =   94449  HBPAIR =       0
  
   NSTEP =        0   TIME(PS) =       0.000  TEMP(K) =     0.00  PRESS =     0.0
!  Etot   =      -856.0350  EKtot   =         0.0000  EPtot      =      -856.0350
!  BOND   =        24.6793  ANGLE   =        75.7358  DIHED      =       173.5178
   1-4 NB =       172.5680  1-4 EEL =      2309.5141  VDWAALS    =      -271.4044
   EELEC  =     -3215.6062  EHBOND  =         0.0000  RESTRAINT  =         0.0000
+  ESCF   =      -125.0394
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        1   TIME(PS) =       0.001  TEMP(K) =     0.02  PRESS =     0.0
!  Etot   =      -856.0018  EKtot   =         0.0332  EPtot      =      -856.0350
!  BOND   =        24.6793  ANGLE   =        75.7358  DIHED      =       173.5178
   1-4 NB =       172.5680  1-4 EEL =      2309.5141  VDWAALS    =      -271.4044
   EELEC  =     -3215.6062  EHBOND  =         0.0000  RESTRAINT  =         0.0000
+  ESCF   =      -125.0394
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        2   TIME(PS) =       0.002  TEMP(K) =     2.11  PRESS =     0.0
!  Etot   =      -856.2042  EKtot   =         4.0775  EPtot      =      -860.2818
!  BOND   =        23.1250  ANGLE   =        74.9422  DIHED      =       173.4796
!  1-4 NB =       172.4272  1-4 EEL =      2309.3410  VDWAALS    =      -271.5589
!  EELEC  =     -3215.6356  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -126.4023
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        3   TIME(PS) =       0.003  TEMP(K) =     7.08  PRESS =     0.0
!  Etot   =      -856.6141  EKtot   =        13.6684  EPtot      =      -870.2825
!  BOND   =        19.5732  ANGLE   =        72.8004  DIHED      =       173.3731
!  1-4 NB =       172.0315  1-4 EEL =      2308.8151  VDWAALS    =      -272.0158
!  EELEC  =     -3215.6774  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -129.1827
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        4   TIME(PS) =       0.004  TEMP(K) =    12.38  PRESS =     0.0
!  Etot   =      -856.7865  EKtot   =        23.9086  EPtot      =      -880.6951
!  BOND   =        16.2311  ANGLE   =        69.9499  DIHED      =       173.2208
!  1-4 NB =       171.4524  1-4 EEL =      2307.9223  VDWAALS    =      -272.7610
!  EELEC  =     -3215.6122  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -131.0984
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        5   TIME(PS) =       0.005  TEMP(K) =    16.71  PRESS =     0.0
!  Etot   =      -856.6969  EKtot   =        32.2717  EPtot      =      -888.9686
!  BOND   =        14.3432  ANGLE   =        67.2341  DIHED      =       173.0568
!  1-4 NB =       170.7833  1-4 EEL =      2306.6563  VDWAALS    =      -273.7785
!  EELEC  =     -3215.3021  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -131.9616
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        6   TIME(PS) =       0.006  TEMP(K) =    20.45  PRESS =     0.0
!  Etot   =      -856.6346  EKtot   =        39.5051  EPtot      =      -896.1397
!  BOND   =        13.5235  ANGLE   =        65.4564  DIHED      =       172.9226
!  1-4 NB =       170.1118  1-4 EEL =      2305.0366  VDWAALS    =      -275.0414
!  EELEC  =     -3214.6582  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -133.4909
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        7   TIME(PS) =       0.007  TEMP(K) =    23.82  PRESS =     0.0
!  Etot   =      -856.7552  EKtot   =        46.0168  EPtot      =      -902.7720
!  BOND   =        12.9629  ANGLE   =        65.1670  DIHED      =       172.8628
!  1-4 NB =       169.4956  1-4 EEL =      2303.1223  VDWAALS    =      -276.4925
!  EELEC  =     -3213.6938  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -136.1965
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        8   TIME(PS) =       0.008  TEMP(K) =    25.85  PRESS =     0.0
!  Etot   =      -856.8532  EKtot   =        49.9354  EPtot      =      -906.7886
!  BOND   =        12.7530  ANGLE   =        66.5323  DIHED      =       172.9210
!  1-4 NB =       168.9480  1-4 EEL =      2301.0153  VDWAALS    =      -278.0396
!  EELEC  =     -3212.5404  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -138.3781
   ------------------------------------------------------------------------------
  
  
!  NSTEP =        9   TIME(PS) =       0.009  TEMP(K) =    25.73  PRESS =     0.0
!  Etot   =      -856.7500  EKtot   =        49.6986  EPtot      =      -906.4487
!  BOND   =        13.6697  ANGLE   =        69.3071  DIHED      =       173.1346
!  1-4 NB =       168.4346  1-4 EEL =      2298.8499  VDWAALS    =      -279.5746
!  EELEC  =     -3211.4175  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -138.8523
   ------------------------------------------------------------------------------
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =    24.15  PRESS =     0.0
!  Etot   =      -856.5124  EKtot   =        46.6529  EPtot      =      -903.1653
!  BOND   =        15.8617  ANGLE   =        72.9092  DIHED      =       173.5310
!  1-4 NB =       167.8825  1-4 EEL =      2296.7703  VDWAALS    =      -281.0031
!  EELEC  =     -3210.5663  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -138.5507
   ------------------------------------------------------------------------------
  
  
        A V E R A G E S   O V E R      10 S T E P S
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =    15.83  PRESS =     0.0
!  Etot   =      -856.5809  EKtot   =        30.5768  EPtot      =      -887.1577
!  BOND   =        16.6722  ANGLE   =        70.0034  DIHED      =       173.2020
!  1-4 NB =       170.4135  1-4 EEL =      2304.7043  VDWAALS    =      -275.1670
!  EELEC  =     -3214.0710  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =      -132.9153
   ------------------------------------------------------------------------------
  
  
        R M S  F L U C T U A T I O N S
  
  
!  NSTEP =       10   TIME(PS) =       0.010  TEMP(K) =     9.38  PRESS =     0.0
!  Etot   =         0.2598  EKtot   =        18.1254  EPtot      =        18.3276
!  BOND   =         4.1048  ANGLE   =         3.7120  DIHED      =         0.2475
!  1-4 NB =         1.6104  1-4 EEL =         4.3490  VDWAALS    =         3.2914
!  EELEC  =         1.8284  EHBOND  =         0.0000  RESTRAINT  =         0.0000
!  ESCF   =         4.8014
! |E(PBS) =         0.0346
   ------------------------------------------------------------------------------
  
  
***************
*** 230,248 ****
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.01 ( 0.05% of Total)
! |          Nonbond force              0.15 ( 0.69% of Force)
! |          QMMM energy               21.54 (99.22% of Force)
! |          Bond/Angle/Dihedral        0.02 ( 0.09% of Force)
! |       Force time                21.71 (100.0% of Runmd)
! |       Verlet update time         0.01 ( 0.05% of Runmd)
! |    Runmd Time                21.72 (99.45% of Total)
! |    Other                      0.11 ( 0.51% of Total)
! | Total time                21.84 (100.0% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 12:12:18.246  on 03/02/2004
! |           Setup done at 12:12:18.367  on 03/02/2004
! |           Run   done at 12:12:40.088  on 03/02/2004
  |     wallclock() was called     434 times
--- 243,262 ----
     5.  TIMINGS
  --------------------------------------------------------------------------------
  
! |    Read coords time           0.01 ( 0.02% of Total)
! |          Nonbond force              0.11 ( 0.26% of Force)
! |          QMMM energy               41.20 (99.68% of Force)
! |          Bond/Angle/Dihedral        0.02 ( 0.06% of Force)
! |       Force time                41.33 (99.59% of Runmd)
! |       Verlet update time         0.16 ( 0.39% of Runmd)
! |       Other                      0.01 ( 0.03% of Runmd)
! |    Runmd Time                41.50 (99.86% of Total)
! |    Other                      0.05 ( 0.12% of Total)
! | Total time                41.56 (100.0% of ALL  )
  
  | Highest rstack allocated:          0
  | Highest istack allocated:          0
! |           Job began  at 11:32:49.556  on 06/18/2004
! |           Setup done at 11:32:49.616  on 06/18/2004
! |           Run   done at 11:33:31.120  on 06/18/2004
  |     wallclock() was called     434 times

------------------------------------------------------------------------------

Temporary workarounds: none