1 |
|
subroutine v_constrain_a(dt,natoms,mass,rx,ry,rz, & |
2 |
|
vx,vy,vz,fx,fy,fz, n_constrained, constraints_sqr, c_i, c_j, & |
3 |
< |
box_x, box_y, box_z) |
3 |
> |
box_x, box_y, box_z, isError) |
4 |
|
implicit none |
5 |
|
|
6 |
|
! ******************************************************************* |
16 |
|
|
17 |
|
! move part a calculate velocities |
18 |
|
|
19 |
< |
INTEGER I |
19 |
> |
INTEGER I, isError |
20 |
|
double precision DT2, DTSQ2 |
21 |
|
|
22 |
|
double precision box_x, box_y, box_z |
59 |
|
double precision e_convert |
60 |
|
parameter ( e_convert = 4.184d-4 ) |
61 |
|
|
62 |
< |
|
62 |
> |
isError = 0 |
63 |
> |
|
64 |
|
DT2 = DT / 2.0d0 |
65 |
|
DTSQ2 = DT * DT2 |
66 |
|
|
135 |
|
if( rpabSqr .lt. ( rabsq * prSqr )) then |
136 |
|
write (*, '('' Constraint Failure '')' ) |
137 |
|
write (*,*) a-1, b-1,rpabSqr, rabsq * prSqr |
138 |
< |
stop |
138 |
> |
isError = 1 |
139 |
> |
return |
140 |
|
end if |
141 |
|
|
142 |
|
rma = 1.0d0 / mass(a) |
188 |
|
|
189 |
|
if( .not. done) then |
190 |
|
write (*, '('' too many constraint iterations in move_a '')' ) |
191 |
< |
stop |
191 |
> |
isError = 1 |
192 |
> |
return |
193 |
|
endif |
194 |
|
|
195 |
|
! store new values |
206 |
|
|
207 |
|
Subroutine v_constrain_b(dt,natoms,mass,rx,ry,rz, & |
208 |
|
vx,vy,vz,fx,fy,fz,k, n_constrained, constraints_sqr, & |
209 |
< |
c_i, c_j, box_x, box_y, box_z) |
209 |
> |
c_i, c_j, box_x, box_y, box_z, isError) |
210 |
|
implicit none |
211 |
|
|
212 |
|
! ******************************************************************* |
221 |
|
|
222 |
|
! declarations |
223 |
|
|
224 |
< |
integer i |
224 |
> |
integer i, isError |
225 |
|
double precision accvel2, dt2 |
226 |
|
double precision box_x, box_y, box_z |
227 |
|
|
264 |
|
|
265 |
|
! ******************************************************************* |
266 |
|
|
267 |
+ |
isError = 0 |
268 |
+ |
|
269 |
|
tol = 1.0d-6 / dt |
270 |
|
dt2 = dt / 2.0d0 |
271 |
|
accvel2 = 0.0d0 |
357 |
|
if (.not. done) then |
358 |
|
|
359 |
|
write(*, '('' Too many constraint iterations in moveb '')') |
360 |
< |
stop |
360 |
> |
isError = 1 |
361 |
> |
return |
362 |
|
|
363 |
|
endif |
364 |
|
|