1 |
gezelter |
1608 |
!! module defines atypes available to simulation |
2 |
|
|
|
3 |
|
|
module atype_module |
4 |
gezelter |
1633 |
|
5 |
gezelter |
1608 |
use vector_class |
6 |
|
|
implicit none |
7 |
|
|
private |
8 |
gezelter |
1633 |
|
9 |
gezelter |
1608 |
type (Vector), pointer, public :: atypes => null() |
10 |
gezelter |
1633 |
|
11 |
gezelter |
1608 |
public :: new_atype |
12 |
|
|
|
13 |
|
|
contains |
14 |
|
|
|
15 |
gezelter |
1633 |
subroutine new_atype(ident, is_Directional, is_LennardJones, & |
16 |
|
|
is_Electrostatic, is_Charge, is_Dipole, is_Sticky, is_GayBerne, & |
17 |
|
|
is_EAM, is_Shape, is_FLARB, status) |
18 |
gezelter |
1608 |
|
19 |
gezelter |
1633 |
integer,intent(in) :: ident |
20 |
|
|
logical,intent(in) :: is_Directional, is_LennardJones, is_Electrostatic |
21 |
|
|
logical,intent(in) :: is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM |
22 |
|
|
logical,intent(in) :: is_Shape, is_FLARB |
23 |
|
|
integer,intent(out) :: status |
24 |
gezelter |
1608 |
|
25 |
|
|
integer :: me |
26 |
gezelter |
1633 |
|
27 |
gezelter |
1608 |
status = 0 |
28 |
gezelter |
1633 |
|
29 |
gezelter |
1608 |
if (.not. associated(atypes)) then |
30 |
|
|
!! There are 16 properties to worry about for now. |
31 |
|
|
!! Fix this if needed for more atomic properties |
32 |
|
|
atypes => initialize(17) |
33 |
|
|
if (.not.associated(atypes)) then |
34 |
|
|
status = -1 |
35 |
|
|
return |
36 |
|
|
endif |
37 |
|
|
endif |
38 |
gezelter |
1633 |
|
39 |
gezelter |
1608 |
me = addElement(atypes) |
40 |
chrisfen |
1689 |
|
41 |
gezelter |
1633 |
call setElementProperty(atypes, me, "c_ident", ident) |
42 |
|
|
|
43 |
|
|
call setElementProperty(atypes, me, "is_Directional", is_Directional) |
44 |
|
|
call setElementProperty(atypes, me, "is_LennardJones", is_LennardJones) |
45 |
|
|
call setElementProperty(atypes, me, "is_Electrostatic", is_Electrostatic) |
46 |
|
|
call setElementProperty(atypes, me, "is_Charge", is_Charge) |
47 |
|
|
call setElementProperty(atypes, me, "is_Dipole", is_Dipole) |
48 |
|
|
call setElementProperty(atypes, me, "is_Sticky", is_Sticky) |
49 |
|
|
call setElementProperty(atypes, me, "is_GayBerne", is_GayBerne) |
50 |
|
|
call setElementProperty(atypes, me, "is_EAM", is_EAM) |
51 |
|
|
call setElementProperty(atypes, me, "is_Shape", is_Shape) |
52 |
|
|
call setElementProperty(atypes, me, "is_FLARB", is_FLARB) |
53 |
|
|
|
54 |
|
|
end subroutine new_atype |
55 |
|
|
|
56 |
|
|
end module atype_module |
57 |
gezelter |
1608 |
|
58 |
gezelter |
1633 |
! provide interface for c calls.... |
59 |
gezelter |
1608 |
|
60 |
gezelter |
1633 |
subroutine makeatype(atp, status) |
61 |
|
|
|
62 |
|
|
use atype_module, ONLY: new_atype |
63 |
gezelter |
1608 |
|
64 |
gezelter |
1633 |
#define __FORTRAN90 |
65 |
|
|
#include "types/AtomTypeProperties.h" |
66 |
gezelter |
1608 |
|
67 |
gezelter |
1633 |
type(AtomTypeProperties), intent(in) :: atp |
68 |
|
|
integer, intent(inout) :: status |
69 |
gezelter |
1608 |
|
70 |
gezelter |
1633 |
integer :: ident |
71 |
|
|
logical :: is_Directional, is_LennardJones, is_Electrostatic |
72 |
|
|
logical :: is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM |
73 |
|
|
logical :: is_Shape, is_FLARB |
74 |
chrisfen |
1689 |
|
75 |
gezelter |
1633 |
ident = atp%ident |
76 |
|
|
is_Directional = (atp%is_Directional .ne. 0) |
77 |
|
|
is_LennardJones = (atp%is_LennardJones .ne. 0) |
78 |
|
|
is_Electrostatic = (atp%is_Electrostatic .ne. 0) |
79 |
|
|
is_Charge = (atp%is_Charge .ne. 0) |
80 |
|
|
is_Dipole = (atp%is_Dipole .ne. 0) |
81 |
|
|
is_Sticky = (atp%is_Sticky .ne. 0) |
82 |
|
|
is_GayBerne = (atp%is_GayBerne .ne. 0) |
83 |
|
|
is_EAM = (atp%is_EAM .ne. 0) |
84 |
|
|
is_Shape = (atp%is_Shape .ne. 0) |
85 |
|
|
is_FLARB = (atp%is_FLARB .ne. 0) |
86 |
gezelter |
1609 |
|
87 |
gezelter |
1633 |
call new_atype(ident, is_Directional, is_LennardJones, is_Electrostatic, & |
88 |
|
|
is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM, is_Shape, & |
89 |
|
|
is_FLARB, status) |
90 |
|
|
|
91 |
gezelter |
1609 |
end subroutine |