Statistiques
| Révision :

root / src / VectorPer.f90 @ 3

Historique | Voir | Annoter | Télécharger (1,42 ko)

1 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2 1 pfleura2
!
3 1 pfleura2
! VectorPer
4 1 pfleura2
!
5 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!
6 1 pfleura2
!
7 1 pfleura2
! This subroutine caclulates the vector defined by atom i and j
8 1 pfleura2
! with j being displaced to a periodic image of the system.
9 1 pfleura2
!
10 1 pfleura2
! Input:
11 1 pfleura2
!  i: (INTEGER) index of the first atom, in the central cell
12 1 pfleura2
!  j: (INTEGER) index of the second atom, in a periodic image
13 1 pfleura2
!  na,nb,nc: (INTEGER) number of displacement of j atom, in lattice vectors.
14 1 pfleura2
!  x(Nat), y(nat), z(nat) : (REAL) Cartesian coordinates of the system.
15 1 pfleura2
!
16 1 pfleura2
! Output:
17 1 pfleura2
! vx,vy,vz: (REAL) Vector i->j
18 1 pfleura2
! Norm:     (REAL) Norm of the vector.
19 1 pfleura2
!
20 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21 1 pfleura2
!
22 1 pfleura2
! Nat and Lattice vectors (lat_a, lat_b, lat_c) are taken from Path_Module
23 1 pfleura2
!
24 1 pfleura2
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25 1 pfleura2
26 1 pfleura2
      SUBROUTINE VectorPer(n1,n2,na,nb,nc,x,y,z,vx,vy,vz,norm)
27 1 pfleura2
28 1 pfleura2
        use VarTypes
29 1 pfleura2
        use Path_module, only : NAt,Lat_a,Lat_b,Lat_c
30 1 pfleura2
31 1 pfleura2
        integer(KINT) :: n1,n2
32 1 pfleura2
        INTEGER(KINT) :: na,nb,nc
33 1 pfleura2
        real(KREAL) ::  x(Nat),y(Nat),z(Nat)
34 1 pfleura2
        real(KREAL) ::  vx,vy,vz,norm
35 1 pfleura2
36 1 pfleura2
        vx=x(n2)-x(n1)+na*Lat_a(1)+nb*Lat_b(1)+nc*Lat_c(1)
37 1 pfleura2
        vy=y(n2)-y(n1)+na*Lat_a(2)+nb*Lat_b(2)+nc*Lat_c(2)
38 1 pfleura2
        vz=z(n2)-z(n1)+na*Lat_a(3)+nb*Lat_b(3)+nc*Lat_c(3)
39 1 pfleura2
40 1 pfleura2
        norm=dsqrt( vx*vx + vy*vy + vz*vz )
41 1 pfleura2
42 1 pfleura2
!       write(6,*) "Dbg VectorPer : n1,n2, na,nb,nc :",n1,n2,na,nb,nc
43 1 pfleura2
!       write(6,*) vx,vy,vz,norm
44 1 pfleura2
!       write(6,*)
45 1 pfleura2
46 1 pfleura2
        RETURN
47 1 pfleura2
      END SUBROUTINE VectorPer