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

Comparing trunk/OOPSE/libmdtools/do_Forces.F90 (file contents):
Revision 490 by gezelter, Fri Apr 11 15:16:59 2003 UTC vs.
Revision 601 by gezelter, Mon Jul 14 23:06:09 2003 UTC

# Line 4 | Line 4
4  
5   !! @author Charles F. Vardeman II
6   !! @author Matthew Meineke
7 < !! @version $Id: do_Forces.F90,v 1.15 2003-04-11 15:16:59 gezelter Exp $, $Date: 2003-04-11 15:16:59 $, $Name: not supported by cvs2svn $, $Revision: 1.15 $
7 > !! @version $Id: do_Forces.F90,v 1.19 2003-07-14 23:06:09 gezelter Exp $, $Date: 2003-07-14 23:06:09 $, $Name: not supported by cvs2svn $, $Revision: 1.19 $
8  
9   module do_Forces
10    use force_globals
# Line 525 | Line 525 | contains
525  
526      r = sqrt(rijsq)
527  
528
529
528   #ifdef IS_MPI
529      if (tagRow(i) .eq. tagColumn(j)) then
530         write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j)
# Line 589 | Line 587 | contains
587         endif
588      endif
589      
590 +
591 +
592    end subroutine do_pair
593  
594  
# Line 597 | Line 597 | contains
597      real (kind = dp), dimension(3) :: q_i
598      real (kind = dp), dimension(3) :: q_j
599      real ( kind = dp ), intent(out) :: r_sq
600 <    real( kind = dp ) :: d(3)
601 <    real( kind = dp ) :: d_old(3)
600 >    real( kind = dp ) :: d(3), scaled(3)
601 >    integer i
602 >
603      d(1:3) = q_j(1:3) - q_i(1:3)
604 <    d_old = d
604 >
605      ! Wrap back into periodic box if necessary
606      if ( SimUsesPBC() ) then
607        
608 <       d(1:3) = d(1:3) - box(1:3) * sign(1.0_dp,d(1:3)) * &
609 <            int(abs(d(1:3)/box(1:3)) + 0.5_dp)
608 >       if( .not.boxIsOrthorhombic ) then
609 >          ! calc the scaled coordinates.
610 >          
611 >          scaled = matmul(HmatInv, d)
612 >          
613 >          ! wrap the scaled coordinates
614 >
615 >          scaled = scaled  - anint(scaled)
616 >          
617 >
618 >          ! calc the wrapped real coordinates from the wrapped scaled
619 >          ! coordinates
620 >
621 >          d = matmul(Hmat,scaled)
622 >
623 >       else
624 >          ! calc the scaled coordinates.
625 >          
626 >          do i = 1, 3
627 >             scaled(i) = d(i) * HmatInv(i,i)
628 >            
629 >             ! wrap the scaled coordinates
630 >            
631 >             scaled(i) = scaled(i) - anint(scaled(i))
632 >            
633 >             ! calc the wrapped real coordinates from the wrapped scaled
634 >             ! coordinates
635 >
636 >             d(i) = scaled(i)*Hmat(i,i)
637 >          enddo
638 >       endif
639        
640      endif
641 +    
642      r_sq = dot_product(d,d)
643 <        
643 >    
644    end subroutine get_interatomic_vector
645 <
645 >  
646    subroutine check_initialization(error)
647      integer, intent(out) :: error
648      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines