2 C @(#) in_loopf.f 1.17 18 Aug 1996
4 C This source-code is part of
8 C GROningen MAchine for Chemical Simulations
10 C Copyright (c) 1990-1995,
11 C BIOSON Research Institute, Dept. of Biophysical Chemistry,
12 C University of Groningen, The Netherlands
15 C GROMACS: A Message Passing Parallel Molecular Dynamics Implementation
16 C H.J.C. Berendsen, D. van der Spoel and R. van Drunen
17 C Comp. Phys. Comm. 1995 (in press)
19 C Also check out our WWW page:
20 C http://rugmd0.chem.rug.nl/~gmx/gmx.cgi
25 C Gyas ROwers Mature At Cryogenic Speed
29 C This code is meant to be called from C routines.
30 C Therefore all indices start at 0, although the arrays
31 C start at 1, if an array contains an index we must add 1 to it.
32 C EG: jjnr points to particles starting at 0
33 C type is indexed from 1 to ...
36 subroutine FORLJC(ix,iy,iz,qi,
37 $ pos,nj,type,jjnr,charge,nbfp,
44 real pos(*),charge(*),faction(*),fip(3)
45 integer*4 nj,jjnr(*),type(*)
54 real rinv1,rinv2,rinv6
56 real tx,ty,tz,vnb6,vnb12
58 parameter(twelve=12.0,six=6.0)
66 cray compiler directive ignore vector dependencies
75 rinv1 = 1.0/sqrt((rijX*rijX)+(rijY*rijY)+(rijZ*rijZ))
77 rinv6 = rinv2*rinv2*rinv2
81 vnb12 = nbfp(tj+1)*rinv6*rinv6
82 vijcoul = qi*charge(jnr)*rinv1
85 vnbtot = vnbtot+vnb12-vnb6
86 fijscal = (twelve*vnb12-six*vnb6+vijcoul)*rinv2
91 faction(j3) = fjx - tx
95 faction(j3+1) = fjy - ty
99 faction(j3+2) = fjz - tz
117 integer maxatom,maxx,maxlist,maxtype
118 parameter(maxatom=1000,maxx=3*maxatom,maxlist=100)
119 parameter(maxtype=19)
121 real*4 ix,iy,iz,qi,pos(maxx),faction(maxx),fip(3)
122 real*4 charge(maxatom),nbfp(2*maxtype),Vc,Vnb
123 integer type(maxatom),jjnr(maxlist)
134 type(i)=1+mod(type(i-1)+91,maxtype)
143 charge(i) = mod(i,2)-0.5
148 jjnr(i) = mod(jjnr(i-1)+13,maxatom)
164 call FORLJC(ix,iy,iz,qi,
165 $ pos,maxlist,type,jjnr,charge,nbfp,