CHARMM Bugfix Report Form (this and a Problem Report Form can be found in ~charmm/support/form)
Please use this form to report a bug you have fixed.
Send your bugfix report to charmm-bugs@tammy.harvard.edu with the
patch or corrected source file(s).
=========================================================================

Name :Lennart Nilsson
Email Address :Lennart.Nilsson@biosci.ki.se
Institution :
Date :October 19, 2003

CHARMM version :c27a1 and later; the fix below is based on c31a1
Machine :all
Operating System :all
FORTRAN version :all
Optimization :all

BUG REPORT
----------
Command(s) involved (including options used):
coor anal sele ... end site sele ... end isdist 21 mgn 100


One-line summary :
first solvent atom from the solvent selection is not included in calculation of rdf around a single site

Detailed description:
The rdf will be slightly off, but in rare cases where the first selected solvent atom is of unusual importance the error may be substantial. The problem is caused by an
incorrectly passed flag-array in a call to gdist. If keyword "multi" is used the calculation is however correct.


Sample input to reproduce the problem (or testcase):
see above


FIX(es)
-------
Files involved:
correl/solana.src

Detailed description of fixes per each file:


*** solana.src Sun Oct 19 13:52:58 2003
--- ../../../harvard/c31a1/source/correl/solana.src Thu Aug 14 00:07:00 2003
***************

*** 1012,1018 ****
ELSE
CALL GDIST(1,REF,NSOLV,HEAP(OX2),CROS,
$ RSPHER,REF,NGOS,MGN,HEAP(GNOS),DR,LMULTI,
! & HEAP(SITESET),HEAP(SOLVSET))
ENDIF
ENDIF
C
--- 1012,1018 ----
ELSE
CALL GDIST(1,REF,NSOLV,HEAP(OX2),CROS,
$ RSPHER,REF,NGOS,MGN,HEAP(GNOS),DR,LMULTI,
! & HEAP(SOLVSET),HEAP(SOLVSET))
ENDIF
ENDIF
C


*********************For c30a1 and later the following is also needed:
*** 930,941 ****
NDENS2=0
NCONF2=0
C
! IF(RHYD.GT.0.0 .OR. ISDIST+IGDIST.GT.0)THEN
C For hydration analysis we need the flag arrays to indicate
! C the atom index, which is not compatible with any of QBY* being true
! IF((QBYGRP.OR.QBYREs.OR.QBYSEG).AND.RHYD.GT.0.0)
& CALL WRNDIE(-2,'<SOLANA>',
! & 'GROUP/RES/SEG flag not compatible with hyd.no. calculation')
CALL MSETINI(QBYGRP,QBYRES,QBYSEG,HEAP(SOLVSET),HEAP(SITESET),
& NSOLV,FLGSOL,NSITE,FLGSIT)
ENDIF
--- 930,941 ----
NDENS2=0
NCONF2=0
C
! IF(RHYD.GT.0.0)THEN
C For hydration analysis we need the flag arrays to indicate
! C the atom index, which is not compatible with any of QBY* being trur
! IF(QBYGRP.OR.QBYREs.OR.QBYSEG)
& CALL WRNDIE(-2,'<SOLANA>',
! & 'GROUP/RES/SEG flag not compatible wtih hyd.no. calculation')
CALL MSETINI(QBYGRP,QBYRES,QBYSEG,HEAP(SOLVSET),HEAP(SITESET),
& NSOLV,FLGSOL,NSITE,FLGSIT)
ENDIF
***************

Other Comments:

Due to the way the reference point for calculation of densities is computed, results for
the rdf around a single site with or without keyword multi (which should be equivalent!),
may differ slightly; with multi the density is computed in a sphere centered at the
origin, without multi the reference point is the average position of the site selection.


Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden