ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/atype_module.F90
Revision: 894
Committed: Mon Jan 5 21:00:05 2004 UTC (20 years, 6 months ago) by chuckv
File size: 2806 byte(s)
Log Message:
Added bitmask to do_forces property lookup

File Contents

# Content
1 !! module defines atypes available to simulation
2
3 module atype_module
4 use definitions, only: dp
5 use vector_class
6 implicit none
7 private
8
9 type (Vector), pointer, public :: atypes => null()
10
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, 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) :: dipole_moment
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(17)
47 if (.not.associated(atypes)) then
48 status = -1
49 return
50 endif
51 endif
52
53 me = addElement(atypes)
54 call setElementProperty(atypes, me, "c_ident", c_ident)
55
56 l_is_LJ = (is_LJ .ne. 0)
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)
80 endif
81 if (l_is_DP) then
82 call setElementProperty(atypes, me, "dipole_moment", dipole_moment)
83 endif
84
85 end subroutine new_atype
86
87 end module atype_module