50 |
|
type (Vector), pointer, public :: atypes => null() |
51 |
|
|
52 |
|
public :: new_atype |
53 |
< |
|
53 |
> |
public :: delete_atypes |
54 |
> |
|
55 |
|
contains |
56 |
< |
|
56 |
> |
|
57 |
|
subroutine new_atype(ident, is_Directional, is_LennardJones, & |
58 |
< |
is_Electrostatic, is_Charge, is_Dipole, is_Sticky, is_GayBerne, & |
59 |
< |
is_EAM, is_Shape, is_FLARB, status) |
60 |
< |
|
58 |
> |
is_Electrostatic, is_Charge, is_Dipole, is_Quadrupole, & |
59 |
> |
is_Sticky, is_GayBerne, is_EAM, is_Shape, is_FLARB, status) |
60 |
> |
integer :: myATID, c_ident |
61 |
|
integer,intent(in) :: ident |
62 |
|
logical,intent(in) :: is_Directional, is_LennardJones, is_Electrostatic |
63 |
< |
logical,intent(in) :: is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM |
64 |
< |
logical,intent(in) :: is_Shape, is_FLARB |
63 |
> |
logical,intent(in) :: is_Charge, is_Dipole, is_Quadrupole |
64 |
> |
logical,intent(in) :: is_Sticky, is_GayBerne, is_EAM, is_Shape, is_FLARB |
65 |
|
integer,intent(out) :: status |
66 |
|
|
67 |
|
integer :: me |
68 |
< |
|
68 |
> |
|
69 |
|
status = 0 |
70 |
< |
|
70 |
> |
|
71 |
|
if (.not. associated(atypes)) then |
72 |
< |
!! There are 16 properties to worry about for now. |
72 |
> |
!! There are 17 properties to worry about for now. |
73 |
|
!! Fix this if needed for more atomic properties |
74 |
< |
atypes => initialize(17) |
74 |
> |
atypes => initialize(18) |
75 |
|
if (.not.associated(atypes)) then |
76 |
|
status = -1 |
77 |
|
return |
78 |
|
endif |
79 |
|
endif |
80 |
< |
|
80 |
> |
|
81 |
|
me = addElement(atypes) |
82 |
|
|
83 |
|
call setElementProperty(atypes, me, "c_ident", ident) |
83 |
– |
|
84 |
|
call setElementProperty(atypes, me, "is_Directional", is_Directional) |
85 |
|
call setElementProperty(atypes, me, "is_LennardJones", is_LennardJones) |
86 |
|
call setElementProperty(atypes, me, "is_Electrostatic", is_Electrostatic) |
87 |
|
call setElementProperty(atypes, me, "is_Charge", is_Charge) |
88 |
|
call setElementProperty(atypes, me, "is_Dipole", is_Dipole) |
89 |
+ |
call setElementProperty(atypes, me, "is_Quadrupole", is_Quadrupole) |
90 |
|
call setElementProperty(atypes, me, "is_Sticky", is_Sticky) |
91 |
|
call setElementProperty(atypes, me, "is_GayBerne", is_GayBerne) |
92 |
|
call setElementProperty(atypes, me, "is_EAM", is_EAM) |
93 |
|
call setElementProperty(atypes, me, "is_Shape", is_Shape) |
94 |
|
call setElementProperty(atypes, me, "is_FLARB", is_FLARB) |
95 |
< |
|
95 |
> |
|
96 |
|
end subroutine new_atype |
96 |
– |
|
97 |
– |
end module atype_module |
97 |
|
|
98 |
< |
! provide interface for c calls.... |
98 |
> |
subroutine delete_atypes() |
99 |
> |
atypes => destroy(atypes) |
100 |
> |
end subroutine delete_atypes |
101 |
|
|
102 |
< |
subroutine makeatype(atp, status) |
102 |
< |
|
103 |
< |
use atype_module, ONLY: new_atype |
102 |
> |
end module atype_module |
103 |
|
|
105 |
– |
#define __FORTRAN90 |
106 |
– |
#include "types/AtomTypeProperties.h" |
107 |
– |
|
108 |
– |
type(AtomTypeProperties), intent(in) :: atp |
109 |
– |
integer, intent(inout) :: status |
110 |
– |
|
111 |
– |
integer :: ident |
112 |
– |
logical :: is_Directional, is_LennardJones, is_Electrostatic |
113 |
– |
logical :: is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM |
114 |
– |
logical :: is_Shape, is_FLARB |
115 |
– |
|
116 |
– |
ident = atp%ident |
117 |
– |
is_Directional = (atp%is_Directional .ne. 0) |
118 |
– |
is_LennardJones = (atp%is_LennardJones .ne. 0) |
119 |
– |
is_Electrostatic = (atp%is_Charge .ne. 0) .or. (atp%is_Dipole .ne. 0) .and. & |
120 |
– |
(atp%is_Quadrupole .ne. 0) |
121 |
– |
|
122 |
– |
is_Charge = (atp%is_Charge .ne. 0) |
123 |
– |
is_Dipole = (atp%is_Dipole .ne. 0) |
124 |
– |
is_Sticky = (atp%is_Sticky .ne. 0) |
125 |
– |
is_GayBerne = (atp%is_GayBerne .ne. 0) |
126 |
– |
is_EAM = (atp%is_EAM .ne. 0) |
127 |
– |
is_Shape = (atp%is_Shape .ne. 0) |
128 |
– |
is_FLARB = (atp%is_FLARB .ne. 0) |
129 |
– |
|
130 |
– |
call new_atype(ident, is_Directional, is_LennardJones, is_Electrostatic, & |
131 |
– |
is_Charge, is_Dipole, is_Sticky, is_GayBerne, is_EAM, is_Shape, & |
132 |
– |
is_FLARB, status) |
133 |
– |
|
134 |
– |
end subroutine |