1 |
!! module defines atypes available to simulation |
2 |
|
3 |
module atype_module |
4 |
|
5 |
use vector_class |
6 |
implicit none |
7 |
private |
8 |
|
9 |
type (Vector), pointer, public :: atypes => null() |
10 |
|
11 |
public :: new_atype |
12 |
|
13 |
contains |
14 |
|
15 |
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 |
|
19 |
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 |
|
25 |
integer :: me |
26 |
|
27 |
status = 0 |
28 |
|
29 |
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 |
|
39 |
me = addElement(atypes) |
40 |
call setElementProperty(atypes, me, "c_ident", ident) |
41 |
|
42 |
call setElementProperty(atypes, me, "is_Directional", is_Directional) |
43 |
call setElementProperty(atypes, me, "is_LennardJones", is_LennardJones) |
44 |
call setElementProperty(atypes, me, "is_Electrostatic", is_Electrostatic) |
45 |
call setElementProperty(atypes, me, "is_Charge", is_Charge) |
46 |
call setElementProperty(atypes, me, "is_Dipole", is_Dipole) |
47 |
call setElementProperty(atypes, me, "is_Sticky", is_Sticky) |
48 |
call setElementProperty(atypes, me, "is_GayBerne", is_GayBerne) |
49 |
call setElementProperty(atypes, me, "is_EAM", is_EAM) |
50 |
call setElementProperty(atypes, me, "is_Shape", is_Shape) |
51 |
call setElementProperty(atypes, me, "is_FLARB", is_FLARB) |
52 |
|
53 |
end subroutine new_atype |
54 |
|
55 |
end module atype_module |
56 |
|
57 |
! provide interface for c calls.... |
58 |
|
59 |
subroutine makeatype(atp, status) |
60 |
|
61 |
use atype_module, ONLY: new_atype |
62 |
|
63 |
#define __FORTRAN90 |
64 |
#include "types/AtomTypeProperties.h" |
65 |
|
66 |
type(AtomTypeProperties), intent(in) :: atp |
67 |
integer, intent(inout) :: status |
68 |
|
69 |
integer :: ident |
70 |
logical :: is_Directional, is_LennardJones, is_Electrostatic |
71 |
logical :: is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM |
72 |
logical :: is_Shape, is_FLARB |
73 |
|
74 |
ident = atp%ident |
75 |
is_Directional = (atp%is_Directional .ne. 0) |
76 |
is_LennardJones = (atp%is_LennardJones .ne. 0) |
77 |
is_Electrostatic = (atp%is_Electrostatic .ne. 0) |
78 |
is_Charge = (atp%is_Charge .ne. 0) |
79 |
is_Dipole = (atp%is_Dipole .ne. 0) |
80 |
is_Sticky = (atp%is_Sticky .ne. 0) |
81 |
is_GayBerne = (atp%is_GayBerne .ne. 0) |
82 |
is_EAM = (atp%is_EAM .ne. 0) |
83 |
is_Shape = (atp%is_Shape .ne. 0) |
84 |
is_FLARB = (atp%is_FLARB .ne. 0) |
85 |
|
86 |
call new_atype(ident, is_Directional, is_LennardJones, is_Electrostatic, & |
87 |
is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM, is_Shape, & |
88 |
is_FLARB, status) |
89 |
|
90 |
end subroutine |