ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/atype_module.F90
Revision: 462
Committed: Sat Apr 5 02:56:27 2003 UTC (21 years, 3 months ago) by gezelter
File size: 1911 byte(s)
Log Message:
bug fixes for compilation

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 contains
15
16 subroutine new_atype(c_ident, is_LJ, is_Sticky, is_DP, is_GB, &
17 lj_epsilon, lj_sigma, dipole_moment, 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
23 integer, intent(in) :: c_ident
24 integer, intent(out) :: status
25 integer, intent(in) :: is_Sticky
26 integer, intent(in) :: is_DP
27 integer, intent(in) :: is_GB
28 integer, intent(in) :: is_LJ
29 integer :: me
30 logical :: l_is_LJ, l_is_DP, l_is_Sticky, l_is_GB
31 integer :: FFcheckStatus
32 status = 0
33
34 if (.not. associated(atypes)) then
35 !! There are 16 properties to worry about for now.
36 !! Fix this if needed for more atomic properties
37 atypes => initialize(16)
38 if (.not.associated(atypes)) then
39 status = -1
40 return
41 endif
42 endif
43
44 me = addElement(atypes)
45 call setElementProperty(atypes, me, "c_ident", c_ident)
46
47 l_is_LJ = (is_LJ .ne. 0)
48 l_is_DP = (is_DP .ne. 0)
49 l_is_Sticky = (is_Sticky .ne. 0)
50 l_is_GB = (is_GB .ne. 0)
51
52 call setElementProperty(atypes, me, "is_LJ", l_is_LJ)
53 call setElementProperty(atypes, me, "is_DP", l_is_DP)
54 call setElementProperty(atypes, me, "is_Sticky", l_is_Sticky)
55 call setElementProperty(atypes, me, "is_GB", l_is_GB)
56
57 if (l_is_LJ) then
58 call setElementProperty(atypes, me, "lj_sigma", lj_sigma)
59 call setElementProperty(atypes, me, "lj_epsilon", lj_epsilon)
60 endif
61 if (l_is_DP) then
62 call setElementProperty(atypes, me, "dipole_moment", dipole_moment)
63 endif
64
65 end subroutine new_atype
66
67 end module atype_module