3 C This source code is part of
7 C GROningen MAchine for Chemical Simulations
11 C Copyright (c) 1991-2001
12 C BIOSON Research Institute, Dept. of Biophysical Chemistry
13 C University of Groningen, The Netherlands
15 C This program is free software; you can redistribute it and/or
16 C modify it under the terms of the GNU General Public License
17 C as published by the Free Software Foundation; either version 2
18 C of the License, or (at your option) any later version.
20 C If you want to redistribute modifications, please consider that
21 C scientific software is very special. Version control is crucial -
22 C bugs must be traceable. We will be happy to consider code for
23 C inclusion in the official distribution, but derived work must not
24 C be called official GROMACS. Details are found in the README & COPYING
25 C files - if they are missing, get the official version at www.gromacs.org.
27 C To help us fund GROMACS development, we humbly ask that you cite
28 C the papers on the package - you can find them in the top README file.
30 C Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
33 C GROup of MAchos and Cynical Suckers
35 c IMPORTANT IMPORTANT IMPORTANT IMPORTANT !
36 c Note that this file comes in two flavours -
37 c fshake.f for single precision and fshaked.f
38 c for double precision. The only difference is
39 c the size of the real variables.
40 c This is an unfortunate, but necessary setup
41 c since not all f77 compilers (e.g. g77) have
42 c switches to change the real size, and neither
43 c do all f77 compilers support preprocessing.
44 c Thus, if you edit one of the files, make sure
45 c to change to other similarly!
47 subroutine fshake
(iatom
,ncon
,nit
,maxnit
,
48 $ dist2
,xp
,rij
,m2
,omega
,invmass
,tt
,lagr
,error
)
53 integer*4 ncon
,nit
,maxnit
55 real*4 dist2
(*),xp
(*),rij
(*),m2
(*),invmass
(*),tt
(*),lagr
(*)
58 integer*4 ll
,i
,j
,i3
,j3
,l3
,nconv
,iconv
59 integer*4 ix
,iy
,iz
,jx
,jy
,jz
60 real*4 toler
,rpij2
,rrpr
,tx
,ty
,tz
,diff
,acor
,im
,jm
61 real*4 xh
,yh
,zh
,rijx
,rijy
,rijz
88 rpij2
= tx*tx
+ty*ty
+tz*tz
92 iconv
= abs
(diff
)*tt
(ll
)
94 if (iconv
.ne
. 0) then
96 rrpr
= rijx*tx
+rijy*ty
+rijz*tz
98 if (rrpr
.lt
. mytol*toler
) then
101 acor
= omega*diff*m2
(ll
)/rrpr
102 lagr
(ll
) = lagr
(ll
) + acor
108 if ((im
.ne
. 0) .and
. (jm
.ne
. 0)) then
109 xp
(ix
) = xp
(ix
) + xh*im
110 xp
(iy
) = xp
(iy
) + yh*im
111 xp
(iz
) = xp
(iz
) + zh*im
112 xp
(jx
) = xp
(jx
) - xh*jm
113 xp
(jy
) = xp
(jy
) - yh*jm
114 xp
(jz
) = xp
(jz
) - zh*jm
116 if ((im
.eq
. 0) .and
. (jm
.ne
. 0)) then
117 xp
(ix
) = xp
(ix
) + xh*jm
118 xp
(iy
) = xp
(iy
) + yh*jm
119 xp
(iz
) = xp
(iz
) + zh*jm
120 else if ((jm
.eq
. 0) .and
. (im
.ne
. 0)) then
121 xp
(jx
) = xp
(jx
) - xh*im
122 xp
(jy
) = xp
(jy
) - yh*im
123 xp
(jz
) = xp
(jz
) - zh*im
132 if (nconv
.eq
. 0) goto 10
133 if (error
.ne
. 0) goto 10