2 C This source code is part of
6 C GROningen MAchine for Chemical Simulations
10 C Copyright (c) 1991-2001
11 C BIOSON Research Institute, Dept. of Biophysical Chemistry
12 C University of Groningen, The Netherlands
14 C This program is free software; you can redistribute it and/or
15 C modify it under the terms of the GNU General Public License
16 C as published by the Free Software Foundation; either version 2
17 C of the License, or (at your option) any later version.
19 C If you want to redistribute modifications, please consider that
20 C scientific software is very special. Version control is crucial -
21 C bugs must be traceable. We will be happy to consider code for
22 C inclusion in the official distribution, but derived work must not
23 C be called official GROMACS. Details are found in the README & COPYING
24 C files - if they are missing, get the official version at www.gromacs.org.
26 C To help us fund GROMACS development, we humbly ask that you cite
27 C the papers on the package - you can find them in the top README file.
29 C Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32 C GROup of MAchos and Cynical Suckers
35 C This code is meant to be called from C routines.
36 C Therefore all indices start at 0, although the arrays
37 C start at 1, if an array contains an index we must add 1 to it.
38 C EG: jjnr points to particles starting at 0
39 C type is indexed from 1 to ...
42 subroutine FORLJC
(ix
,iy
,iz
,qi
,
43 $ pos
,nj
,type
,jjnr
,charge
,nbfp
,
50 real pos
(*),charge
(*),faction
(*),fip
(3)
51 integer*4 nj
,jjnr
(*),type
(*)
60 real rinv1
,rinv2
,rinv6
62 real tx
,ty
,tz
,vnb6
,vnb12
64 parameter(twelve
=12.0,six
=6.0)
72 cray compiler directive ignore vector dependencies
81 rinv1
= 1.0/sqrt
((rijX*rijX
)+(rijY*rijY
)+(rijZ*rijZ
))
83 rinv6
= rinv2*rinv2*rinv2
87 vnb12
= nbfp
(tj
+1)*rinv6*rinv6
88 vijcoul
= qi*charge
(jnr
)*rinv1
91 vnbtot
= vnbtot
+vnb12
-vnb6
92 fijscal
= (twelve*vnb12
-six*vnb6
+vijcoul
)*rinv2
97 faction
(j3
) = fjx
- tx
101 faction
(j3
+1) = fjy
- ty
105 faction
(j3
+2) = fjz
- tz
123 integer maxatom
,maxx
,maxlist
,maxtype
124 parameter(maxatom
=1000,maxx
=3*maxatom
,maxlist
=100)
125 parameter(maxtype
=19)
127 real*4 ix
,iy
,iz
,qi
,pos
(maxx
),faction
(maxx
),fip
(3)
128 real*4 charge
(maxatom
),nbfp
(2*maxtype
),Vc
,Vnb
129 integer type
(maxatom
),jjnr
(maxlist
)
140 type
(i
)=1+mod
(type
(i
-1)+91,maxtype
)
149 charge
(i
) = mod
(i
,2)-0.5
154 jjnr
(i
) = mod
(jjnr
(i
-1)+13,maxatom
)
170 call FORLJC
(ix
,iy
,iz
,qi
,
171 $ pos
,maxlist
,type
,jjnr
,charge
,nbfp
,