-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCF_mod.F90
66 lines (42 loc) · 1.52 KB
/
CF_mod.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
63
64
65
module functions
contains
real function dist(x,y,z,a,b,c)
! Function checks the distance of two molecules
! in 3D space using simple distance formula
! xyz mol 1; abc mol2
implicit none
real,intent(in) :: x, y, z, a, b, c
dist = sqrt(((a-x)*(a-x)) + ((b-y)*(b-y)) + ((c-z)*(c-z)))
end function dist
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer function chain(beadNum)
! Function finds which chain a molecule
! belongs to. Each chain is assumed to be
! 40 molecules in length
implicit none
real,intent(in) :: beadNum
chain = ceiling(beadnum/40.0)
end function chain
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
end module
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
module chain_Functions
contains
integer function chainEnds(beadNum)
! Function finds which half of a chain
! a molecule belongs to. Each chain is
! assumed to 40 molecules in length.
use functions, only : chain
implicit none
integer,intent(in) :: beadNum
integer :: chainNum
chainNum = chain(real(beadNum))
if (mod(float(beadNum),40.0) .gt. 20) then
chainEnds = chainNum + 1
else
chainEnds = chainNum
end if
end function
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
end module