4 |
|
|
5 |
|
!! @author Charles F. Vardeman II |
6 |
|
!! @author Matthew Meineke |
7 |
< |
!! @version $Id: do_Forces.F90,v 1.13 2003-04-08 22:38:43 chuckv Exp $, $Date: 2003-04-08 22:38:43 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $ |
7 |
> |
!! @version $Id: do_Forces.F90,v 1.16 2003-07-01 22:39:53 gezelter Exp $, $Date: 2003-07-01 22:39:53 $, $Name: not supported by cvs2svn $, $Revision: 1.16 $ |
8 |
|
|
9 |
|
module do_Forces |
10 |
|
use force_globals |
218 |
|
|
219 |
|
do_pot = do_pot_c |
220 |
|
do_stress = do_stress_c |
221 |
– |
|
221 |
|
|
222 |
|
! Gather all information needed by all force loops: |
223 |
|
|
487 |
|
endif |
488 |
|
|
489 |
|
if (do_stress) then |
490 |
< |
call mpi_allreduce(tau_Temp, tau,9,mpi_double_precision,mpi_sum, & |
490 |
> |
call mpi_allreduce(tau_Temp, tau, 9,mpi_double_precision,mpi_sum, & |
491 |
|
mpi_comm_world,mpi_err) |
492 |
|
call mpi_allreduce(virial_Temp, virial,1,mpi_double_precision,mpi_sum, & |
493 |
|
mpi_comm_world,mpi_err) |
525 |
|
|
526 |
|
r = sqrt(rijsq) |
527 |
|
|
528 |
+ |
|
529 |
+ |
|
530 |
|
#ifdef IS_MPI |
531 |
+ |
if (tagRow(i) .eq. tagColumn(j)) then |
532 |
+ |
write(0,*) 'do_pair is doing', i , j, tagRow(i), tagColumn(j) |
533 |
+ |
endif |
534 |
|
|
535 |
|
me_i = atid_row(i) |
536 |
|
me_j = atid_col(j) |
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(d, HmatInv) |
612 |
> |
|
613 |
> |
! wrap the scaled coordinates |
614 |
> |
|
615 |
> |
do i = 1, 3 |
616 |
> |
scaled(i) = scaled(i) - anint(scaled(i)) |
617 |
> |
enddo |
618 |
> |
|
619 |
> |
! calc the wrapped real coordinates from the wrapped scaled |
620 |
> |
! coordinates |
621 |
> |
|
622 |
> |
d = matmul(scaled,Hmat) |
623 |
> |
|
624 |
> |
else |
625 |
> |
! calc the scaled coordinates. |
626 |
> |
|
627 |
> |
do i = 1, 3 |
628 |
> |
scaled(i) = d(i) * HmatInv(i,i) |
629 |
> |
|
630 |
> |
! wrap the scaled coordinates |
631 |
> |
|
632 |
> |
scaled(i) = scaled(i) - anint(scaled(i)) |
633 |
> |
|
634 |
> |
! calc the wrapped real coordinates from the wrapped scaled |
635 |
> |
! coordinates |
636 |
> |
|
637 |
> |
d(i) = scaled(i)*Hmat(i,i) |
638 |
> |
enddo |
639 |
> |
endif |
640 |
|
|
641 |
|
endif |
642 |
+ |
|
643 |
|
r_sq = dot_product(d,d) |
644 |
< |
|
644 |
> |
|
645 |
|
end subroutine get_interatomic_vector |
646 |
< |
|
646 |
> |
|
647 |
|
subroutine check_initialization(error) |
648 |
|
integer, intent(out) :: error |
649 |
|
|