21 |
|
public :: getCharge |
22 |
|
|
23 |
|
type :: ChargeList |
24 |
< |
integer :: ident |
24 |
> |
integer :: c_ident |
25 |
|
real(kind=DP) :: charge = 0.0_DP |
26 |
|
end type ChargeList |
27 |
|
|
29 |
|
|
30 |
|
contains |
31 |
|
|
32 |
< |
subroutine newChargeType(ident, charge, status) |
33 |
< |
integer,intent(in) :: ident |
32 |
> |
subroutine newChargeType(c_ident, charge, status) |
33 |
> |
integer,intent(in) :: c_ident |
34 |
|
real(kind=dp),intent(in) :: charge |
35 |
|
integer,intent(out) :: status |
36 |
< |
integer :: nAtypes |
36 |
> |
integer :: nAtypes, myATID |
37 |
|
|
38 |
|
status = 0 |
39 |
|
|
40 |
+ |
myATID = getFirstMatchingElement(atypes, "c_ident", c_ident) |
41 |
+ |
|
42 |
|
!! Be simple-minded and assume that we need a ChargeMap that |
43 |
|
!! is the same size as the total number of atom types |
44 |
|
|
57 |
|
|
58 |
|
end if |
59 |
|
|
60 |
< |
if (ident .gt. size(ChargeMap)) then |
60 |
> |
if (myATID .gt. size(ChargeMap)) then |
61 |
|
status = -1 |
62 |
|
return |
63 |
|
endif |
64 |
|
|
65 |
|
! set the values for ChargeMap for this atom type: |
66 |
|
|
67 |
< |
ChargeMap(ident)%ident = ident |
68 |
< |
ChargeMap(ident)%charge = charge |
67 |
> |
ChargeMap(myATID)%c_ident = c_ident |
68 |
> |
ChargeMap(myATID)%charge = charge |
69 |
|
|
70 |
|
end subroutine newChargeType |
71 |
|
|