1 |
|
!! module defines atypes available to simulation |
2 |
|
|
3 |
|
module atype_module |
4 |
< |
use definitions, only: dp |
4 |
> |
|
5 |
|
use vector_class |
6 |
|
implicit none |
7 |
|
private |
8 |
< |
|
8 |
> |
|
9 |
|
type (Vector), pointer, public :: atypes => null() |
10 |
< |
|
11 |
< |
|
10 |
> |
|
11 |
|
public :: new_atype |
12 |
|
|
13 |
|
contains |
14 |
|
|
15 |
< |
subroutine new_atype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, & |
16 |
< |
is_EAM, is_Charge, lj_epsilon, lj_sigma, charge, dipole_moment, & |
17 |
< |
status) |
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 |
< |
real( kind = dp ), intent(in) :: lj_epsilon |
20 |
< |
real( kind = dp ), intent(in) :: lj_sigma |
21 |
< |
real( kind = dp ), intent(in) :: dipole_moment |
22 |
< |
real( kind = dp ), intent(in) :: charge |
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, intent(in) :: c_ident |
26 |
– |
integer, intent(out) :: status |
27 |
– |
integer, intent(in) :: is_Sticky |
28 |
– |
integer, intent(in) :: is_DP |
29 |
– |
integer, intent(in) :: is_GB |
30 |
– |
integer, intent(in) :: is_EAM |
31 |
– |
integer, intent(in) :: is_LJ |
32 |
– |
integer, intent(in) :: is_Charge |
25 |
|
integer :: me |
26 |
< |
logical :: l_is_LJ, l_is_DP, l_is_Sticky, l_is_GB |
35 |
< |
logical :: l_is_EAM, l_is_Charge |
36 |
< |
integer :: FFcheckStatus |
26 |
> |
|
27 |
|
status = 0 |
28 |
< |
|
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 |
35 |
|
return |
36 |
|
endif |
37 |
|
endif |
38 |
< |
|
38 |
> |
|
39 |
|
me = addElement(atypes) |
50 |
– |
call setElementProperty(atypes, me, "c_ident", c_ident) |
40 |
|
|
41 |
< |
l_is_LJ = (is_LJ .ne. 0) |
42 |
< |
l_is_DP = (is_DP .ne. 0) |
43 |
< |
l_is_Sticky = (is_Sticky .ne. 0) |
44 |
< |
l_is_GB = (is_GB .ne. 0) |
45 |
< |
l_is_EAM = (is_EAM .ne. 0) |
46 |
< |
l_is_Charge = (is_Charge .ne. 0) |
41 |
> |
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 |
|
|
58 |
< |
call setElementProperty(atypes, me, "is_LJ", l_is_LJ) |
60 |
< |
call setElementProperty(atypes, me, "is_DP", l_is_DP) |
61 |
< |
call setElementProperty(atypes, me, "is_Sticky", l_is_Sticky) |
62 |
< |
call setElementProperty(atypes, me, "is_GB", l_is_GB) |
63 |
< |
call setElementProperty(atypes, me, "is_EAM", l_is_EAM) |
64 |
< |
call setElementProperty(atypes, me, "is_Charge", l_is_Charge) |
58 |
> |
! provide interface for c calls.... |
59 |
|
|
60 |
< |
if (l_is_LJ) then |
61 |
< |
call setElementProperty(atypes, me, "lj_sigma", lj_sigma) |
62 |
< |
call setElementProperty(atypes, me, "lj_epsilon", lj_epsilon) |
69 |
< |
endif |
70 |
< |
if (l_is_DP) then |
71 |
< |
call setElementProperty(atypes, me, "dipole_moment", dipole_moment) |
72 |
< |
endif |
73 |
< |
if (l_is_Charge) then |
74 |
< |
call setElementProperty(atypes, me, "charge", charge) |
75 |
< |
endif |
60 |
> |
subroutine makeatype(atp, status) |
61 |
> |
|
62 |
> |
use atype_module, ONLY: new_atype |
63 |
|
|
64 |
< |
end subroutine new_atype |
64 |
> |
#define __FORTRAN90 |
65 |
> |
#include "types/AtomTypeProperties.h" |
66 |
|
|
67 |
< |
end module atype_module |
67 |
> |
type(AtomTypeProperties), intent(in) :: atp |
68 |
> |
integer, intent(inout) :: status |
69 |
|
|
70 |
< |
! provide interface for c calls.... |
70 |
> |
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 |
|
|
75 |
< |
subroutine makeatype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, & |
76 |
< |
is_EAM, is_Charge, lj_epsilon, lj_sigma, charge, dipole_moment, & |
77 |
< |
status) |
78 |
< |
use definitions, only: dp |
79 |
< |
use atype_module, ONLY: new_atype |
80 |
< |
|
81 |
< |
real( kind = dp ), intent(in) :: lj_epsilon |
82 |
< |
real( kind = dp ), intent(in) :: lj_sigma |
83 |
< |
real( kind = dp ), intent(in) :: dipole_moment |
84 |
< |
real( kind = dp ), intent(in) :: charge |
75 |
> |
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 |
|
|
87 |
< |
integer, intent(in) :: c_ident |
88 |
< |
integer, intent(out) :: status |
89 |
< |
integer, intent(in) :: is_Sticky |
90 |
< |
integer, intent(in) :: is_DP |
98 |
< |
integer, intent(in) :: is_GB |
99 |
< |
integer, intent(in) :: is_EAM |
100 |
< |
integer, intent(in) :: is_LJ |
101 |
< |
integer, intent(in) :: is_Charge |
102 |
< |
|
103 |
< |
call new_atype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, & |
104 |
< |
is_EAM, is_Charge, lj_epsilon, lj_sigma, charge, dipole_moment, & |
105 |
< |
status) |
106 |
< |
|
87 |
> |
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 |
|
end subroutine |