********>Bugfix 18
Author: Ross Walker
Date: 09/29/2006
Programs: sander
Description: QMMM Calculations in which adjust_q>0 and qmcharge>0 can
print an incorrect value for the QM+MM total charge after
correction. This is simply an error in the informational
message and does not affect the calculation results. Internally
the code is applying the correction properly it is just the
message that is wrong and could potentially lead to confusion.
This bugfix corrects the code so that the message is consistent
with what the code is actually doing.
Fix: apply the following patch to src/sander/qm_zero_charges.f
------------------------------------------------------------------------------
*** qm_zero_charges.f 2006-09-28 16:48:14.000000000 -0700
--- qm_zero_charges.f 2006-09-28 16:48:44.000000000 -0700
***************
*** 147,153 ****
charge(closest_id) = charge(closest_id) + correction
end do
if (master) then
! final_q_sum = qmcharge
do i = 1, natom
if ((.not. atom_mask(i)) .and. (.not. mm_link_mask(i))) final_q_sum = final_q_sum + charge(i)
end do
--- 147,153 ----
charge(closest_id) = charge(closest_id) + correction
end do
if (master) then
! final_q_sum = qmcharge * AMBER_ELECTROSTATIC
do i = 1, natom
if ((.not. atom_mask(i)) .and. (.not. mm_link_mask(i))) final_q_sum = final_q_sum + charge(i)
end do
***************
*** 167,173 ****
correction = q_correction / dble(natom-nquant_nlink) !Should never divide by zero here as code
!returns above if nquant==natom. - i.e. pure QM run.
! final_q_sum = zero
do i = 1, natom
!Go through each atom adding correction to it's charge if it
!is not a QM or MM Link atom.
--- 167,173 ----
correction = q_correction / dble(natom-nquant_nlink) !Should never divide by zero here as code
!returns above if nquant==natom. - i.e. pure QM run.
! final_q_sum = qmcharge * AMBER_ELECTROSTATIC
do i = 1, natom
!Go through each atom adding correction to it's charge if it
!is not a QM or MM Link atom.
------------------------------------------------------------------------------
Temporary workarounds: Just ignore the message and assume the code is doing things correctly.