3 |
|
module atype_module |
4 |
|
use definitions, only: dp |
5 |
|
use vector_class |
6 |
– |
use sticky_pair |
7 |
– |
use gb_pair |
6 |
|
implicit none |
7 |
|
private |
8 |
|
|
11 |
|
|
12 |
|
public :: new_atype |
13 |
|
|
14 |
+ |
integer, public, parameter :: LJ_PROPERTY_MASK = 1 |
15 |
+ |
integer, public, parameter :: DP_PROPERTY_MASK = 2 |
16 |
+ |
integer, public, parameter :: STICKY_PROPERTY_MASK = 4 |
17 |
+ |
integer, public, parameter :: GB_PROPERTY_MASK = 8 |
18 |
+ |
integer, public, parameter :: EAM_PROPERTY_MASK = 16 |
19 |
+ |
|
20 |
|
contains |
21 |
|
|
22 |
< |
subroutine new_atype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, & |
23 |
< |
lj_epsilon, lj_sigma, & |
20 |
< |
dipole_moment, & |
21 |
< |
sticky_w0, sticky_v0, & |
22 |
< |
GB_sigma, GB_l2b_ratio, GB_eps, GB_eps_ratio, GB_mu, GB_nu, & |
23 |
< |
status) |
22 |
> |
subroutine new_atype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, is_EAM,& |
23 |
> |
lj_epsilon, lj_sigma, dipole_moment, status) |
24 |
|
|
25 |
|
real( kind = dp ), intent(in) :: lj_epsilon |
26 |
|
real( kind = dp ), intent(in) :: lj_sigma |
27 |
– |
real( kind = dp ), intent(in) :: sticky_w0 |
28 |
– |
real( kind = dp ), intent(in) :: sticky_v0 |
27 |
|
real( kind = dp ), intent(in) :: dipole_moment |
30 |
– |
real( kind = dp ), intent(in) :: GB_sigma, GB_l2b_ratio, GB_eps |
31 |
– |
real( kind = dp ), intent(in) :: GB_eps_ratio, GB_mu, GB_nu |
28 |
|
|
29 |
|
integer, intent(in) :: c_ident |
30 |
|
integer, intent(out) :: status |
31 |
|
integer, intent(in) :: is_Sticky |
32 |
|
integer, intent(in) :: is_DP |
33 |
|
integer, intent(in) :: is_GB |
34 |
+ |
integer, intent(in) :: is_EAM |
35 |
|
integer, intent(in) :: is_LJ |
36 |
|
integer :: me |
37 |
|
logical :: l_is_LJ, l_is_DP, l_is_Sticky, l_is_GB |
38 |
+ |
logical :: l_is_EAM |
39 |
+ |
integer :: propertyPack |
40 |
|
integer :: FFcheckStatus |
41 |
|
status = 0 |
42 |
|
|
43 |
|
if (.not. associated(atypes)) then |
44 |
|
!! There are 16 properties to worry about for now. |
45 |
|
!! Fix this if needed for more atomic properties |
46 |
< |
atypes => initialize(16) |
46 |
> |
atypes => initialize(17) |
47 |
|
if (.not.associated(atypes)) then |
48 |
|
status = -1 |
49 |
|
return |
57 |
|
l_is_DP = (is_DP .ne. 0) |
58 |
|
l_is_Sticky = (is_Sticky .ne. 0) |
59 |
|
l_is_GB = (is_GB .ne. 0) |
60 |
+ |
l_is_EAM = (is_EAM .ne. 0) |
61 |
|
|
62 |
|
call setElementProperty(atypes, me, "is_LJ", l_is_LJ) |
63 |
|
call setElementProperty(atypes, me, "is_DP", l_is_DP) |
64 |
|
call setElementProperty(atypes, me, "is_Sticky", l_is_Sticky) |
65 |
|
call setElementProperty(atypes, me, "is_GB", l_is_GB) |
66 |
+ |
call setElementProperty(atypes, me, "is_EAM", l_is_EAM) |
67 |
|
|
68 |
+ |
propertyPack = 0 |
69 |
+ |
if (l_is_LJ) propertyPack = propertyPack + LJ_PROPERTY_MASK |
70 |
+ |
if (l_is_DP) propertyPack = propertyPack + DP_PROPERTY_MASK |
71 |
+ |
if (l_is_Sticky) propertyPack = propertyPack + STICKY_PROPERTY_MASK |
72 |
+ |
if (l_is_GB) propertyPack = propertyPack + GB_PROPERTY_MASK |
73 |
+ |
if (l_is_EAM) propertyPack = propertyPack + EAM_PROPERTY_MASK |
74 |
+ |
|
75 |
+ |
call setElementProperty(atypes, me, "propertyPack", propertyPack) |
76 |
+ |
|
77 |
|
if (l_is_LJ) then |
78 |
|
call setElementProperty(atypes, me, "lj_sigma", lj_sigma) |
79 |
|
call setElementProperty(atypes, me, "lj_epsilon", lj_epsilon) |
81 |
|
if (l_is_DP) then |
82 |
|
call setElementProperty(atypes, me, "dipole_moment", dipole_moment) |
83 |
|
endif |
74 |
– |
if (l_is_Sticky) then |
75 |
– |
call setElementProperty(atypes, me, "sticky_w0", sticky_w0) |
76 |
– |
call setElementProperty(atypes, me, "sticky_v0", sticky_v0) |
77 |
– |
call check_sticky_FF(FFcheckStatus) |
78 |
– |
if (FFcheckStatus .ne. 0) call set_sticky_params(sticky_w0, sticky_v0) |
79 |
– |
endif |
80 |
– |
if (l_is_GB) then |
81 |
– |
call setElementProperty(atypes, me, "GB_sigma", GB_sigma) |
82 |
– |
call setElementProperty(atypes, me, "GB_l2b_ratio", GB_l2b_ratio) |
83 |
– |
call setElementProperty(atypes, me, "GB_eps", GB_eps) |
84 |
– |
call setElementProperty(atypes, me, "GB_eps_ratio", GB_eps_ratio) |
85 |
– |
call setElementProperty(atypes, me, "GB_mu", GB_mu) |
86 |
– |
call setElementProperty(atypes, me, "GB_nu", GB_nu) |
87 |
– |
call check_gb_pair_FF(FFcheckStatus) |
88 |
– |
if (FFcheckStatus .ne. 0) call set_gb_pair_params(GB_sigma, GB_l2b_ratio, & |
89 |
– |
GB_eps, GB_eps_ratio, GB_mu, GB_nu) |
90 |
– |
endif |
84 |
|
|
85 |
|
end subroutine new_atype |
86 |
|
|