ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/f_verlet_constrained.F90
(Generate patch)

Comparing trunk/OOPSE/libmdtools/f_verlet_constrained.F90 (file contents):
Revision 505 by mmeineke, Fri Apr 25 02:00:11 2003 UTC vs.
Revision 542 by mmeineke, Fri May 30 21:31:48 2003 UTC

# Line 1 | Line 1
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    ! *******************************************************************
# Line 16 | Line 16 | subroutine v_constrain_a(dt,natoms,mass,rx,ry,rz, &
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
# Line 59 | Line 59 | subroutine v_constrain_a(dt,natoms,mass,rx,ry,rz, &
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    
# Line 134 | Line 135 | subroutine v_constrain_a(dt,natoms,mass,rx,ry,rz, &
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)
# Line 186 | Line 188 | subroutine v_constrain_a(dt,natoms,mass,rx,ry,rz, &
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
# Line 203 | Line 206 | Subroutine v_constrain_b(dt,natoms,mass,rx,ry,rz, &
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    ! *******************************************************************
# Line 218 | Line 221 | Subroutine v_constrain_b(dt,natoms,mass,rx,ry,rz, &
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    
# Line 261 | Line 264 | Subroutine v_constrain_b(dt,natoms,mass,rx,ry,rz, &
264  
265    ! *******************************************************************
266    
267 +  isError = 0
268 +
269    tol = 1.0d-6 / dt
270    dt2 = dt / 2.0d0
271    accvel2 = 0.0d0
# Line 352 | Line 357 | Subroutine v_constrain_b(dt,natoms,mass,rx,ry,rz, &
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    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines