forked from slitvinov/packmol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompindexes.f
94 lines (69 loc) · 1.89 KB
/
compindexes.f
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
c
c Written by Leandro Martínez, 2009-2011.
c Copyright (c) 2009-2011, Leandro Martínez, Jose Mario Martinez,
c Ernesto G. Birgin.
c
c This program is free software; you can redistribute it and/or
c modify it under the terms of the GNU General Public License
c as published by the Free Software Foundation; either version 2
c of the License, or (at your option) any later version.
c
subroutine compicart(itype,imol,iatom,icart)
implicit none
include 'sizes.i'
include 'molpa.i'
integer itype, imol, iatom, icart
integer i
icart = natfix
do i=1,itype-1
icart = icart + nmols(i)*natoms(i)
end do
icart = icart + (imol-1)*natoms(itype)
icart = icart + iatom
end
subroutine compiluganbar(itype,imol,ilugan,ilubar)
implicit none
include 'sizes.i'
include 'molpa.i'
integer itype, imol
integer ilugan, ilubar
integer i
ilubar = 0
ilugan = ntotmol*3
do i=1,itype-1
if(comptype(i)) then
ilubar = ilubar + 3*nmols(i)
ilugan = ilugan + 3*nmols(i)
end if
end do
if(comptype(itype)) then
ilubar = ilubar + (imol-1)*3
ilugan = ilugan + (imol-1)*3
end if
end
subroutine comprindex(itype,imol,ind)
implicit none
include 'sizes.i'
include 'molpa.i'
integer itype, imol, ind
integer i
ind = 0.d0
do i=1,itype-1
if(comptype(i)) then
ind = ind + nmols(i)
end if
end do
ind = ind + imol
end
c Calculates the ceeling of a number x
c
subroutine ceil(x,result)
implicit none
double precision x
integer result
if ((x - int(x)) .eq. 0) then
result = int(x)
else
result = int(x) + 1
end if
end