-
Notifications
You must be signed in to change notification settings - Fork 0
/
m_pbc.f90
62 lines (61 loc) · 1.33 KB
/
m_pbc.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
!----------------------------------------------------------------------
! MELQUIADES: Metropolis Monte Carlo Program
!----------------------------------------------------------------------
!bop
!
! !Module: m_pbc
!
! !Description: This module contains a routine to
!define the periodical boundary conditions.
!\\
!\\
! !Interface:
!
module m_pbc
!
! !Uses:
use m_kind
use m_simtype
use m_boxtype
implicit none
!
! !Public member functions:
!
private
public :: r_pbc
!
! !Revision history:
! 06Aug 2015 Asdrubal Lozada
!
!eop
!---------------------------------------------------------------------
contains
!bop
!
! !Iroutine: r_pbc
!
! !Description: This routine implements the periodic boundary
!conditions criterium and minimum imagen convention.
!\\
!\\
! !Interface:
subroutine r_pbc( com, edge )
implicit none
!
! !Input parameters:
real(rkind), dimension(:), intent(inout) :: com ! Center of mass position
real(rkind), dimension(:), intent(in) :: edge ! Lenght of edge box
!
! !Revision history:
! 06Aug 2015 Asdrubal Lozada
!
!eop
!------------------------------------------------------------------
!
!boc
com(1) = com(1) - edge(1) * dnint(com(1) / edge(1))
com(2) = com(2) - edge(2) * dnint(com(2) / edge(2))
com(3) = com(3) - edge(3) * dnint(com(3) / edge(3))
!eoc
end subroutine r_pbc
end module m_pbc