********>Bugfix 22
Author: Dave Case (fix contributed by Ingvar Lagerstedt)
Date: 10/20/2006

Programs: sander 

Description: Statistics for the born radii (reported with rbornstat set)
             will be incorrect if nrespai != nrespa.  This is because the
             radii statistics arrays are updated every nrespai steps.

Fix: Apply the following patch to $AMBERHOME/src/sander/runmd.f

------------------------------------------------------------------------------
*** runmd.f	3 Apr 2006 23:35:55 -0000	9.0
--- runmd.f	20 Oct 2006 17:02:28 -0000
***************
*** 154,160 ****
     
     equivalence (pres(1),ener(11)),(ekcmt(1),ener(15))
     equivalence (vir(1),ener(19))
!    integer nvalid
     _REAL_ eke,eket
     _REAL_ extent
  
--- 154,160 ----
     
     equivalence (pres(1),ener(11)),(ekcmt(1),ener(15))
     equivalence (vir(1),ener(19))
!    integer nvalid, nvalidi
     _REAL_ eke,eket
     _REAL_ extent
  
***************
*** 457,462 ****
--- 457,463 ----
     nrep = 15
     
     nvalid = 0
+    nvalidi = 0
     nstep = 0
     fit = 0.d0
     fiti = 0.d0
***************
*** 1965,1970 ****
--- 1966,1974 ----
        enert2(1:nren) = enert2(1:nren) + ener(1:nren)**2
        if( nvalid == 1 ) etot_start = ener(1)
     end if
+ 
+    ! added for rbornstat
+    if (mod(irespa,nrespai) == 0 .or. irespa < 2) nvalidi = nvalidi + 1
       
     ntnb = 0
     if (mod(nstep,nsnb) == 0) ntnb = 1
***************
*** 2349,2354 ****
--- 2353,2362 ----
           !          print Born radii statistics
           
           if ((rbornstat == 1).and.(igb /= 0)) then
+ 
+             ! Born radii stats collected every nrespai step not nrespa step
+             tspan = nvalidi
+ 
              write(6,580) nstep
              write(6,590)
              do m = 1,natom

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

Temporary workarounds: none