--- trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/05/11 16:00:22 1154 +++ trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/05/11 21:31:15 1160 @@ -2,8 +2,6 @@ module notifyCutoffs use definitions use do_Forces, only: setRlistDF - use charge_charge, only: setCutoffsCharge - use dipole_dipole, only: setCutoffsDipole use reaction_field, only: setCutoffsRF use lj, only: setCutoffLJ use eam, only: setCutoffEAM @@ -25,6 +23,7 @@ module notifyCutoffs real(kind=dp) :: rsw, rcut, rlist integer :: localError + logical :: do_shift rcut = this_rcut rsw = this_rsw @@ -37,12 +36,15 @@ module notifyCutoffs if (rlist .lt. rcut) then write(*,*) 'warning, rlist = ', rlist, ' but rcut = ', rcut endif + + do_shift = .false. + if (abs(rcut-rsw) .lt. 0.0001) then + do_shift = .true. + endif call setRlistDF( rlist ) - call setCutoffsCharge( rcut, rsw ) - call setCutoffsDipole( rcut, rsw ) call setCutoffsRF( rcut, rsw ) - call setCutoffLJ( rcut, localError ) + call setCutoffLJ( rcut, do_shift, localError ) call setCutoffEAM( rcut, localError) call set_switch(GROUP_SWITCH, rsw, rcut)