117 |
|
integer :: currentAddition = 0 |
118 |
|
|
119 |
|
type (EAMtype), pointer :: EAMParams(:) => null() |
120 |
+ |
integer, pointer :: atidToEAMType(:) => null() |
121 |
|
end type EAMTypeList |
122 |
|
|
123 |
|
|
153 |
|
integer :: eam_ident |
154 |
|
integer :: status |
155 |
|
|
156 |
< |
integer :: nAtypes |
156 |
> |
integer :: nAtypes,nEAMTypes,myATID |
157 |
|
integer :: maxVals |
158 |
|
integer :: alloc_stat |
159 |
|
integer :: current |
168 |
|
|
169 |
|
! check to see if this is the first time into |
170 |
|
if (.not.associated(EAMList%EAMParams)) then |
171 |
< |
call getMatchingElementList(atypes, "is_EAM", .true., nAtypes, MatchList) |
172 |
< |
EAMList%n_eam_types = nAtypes |
173 |
< |
allocate(EAMList%EAMParams(nAtypes)) |
171 |
> |
call getMatchingElementList(atypes, "is_EAM", .true., nEAMtypes, MatchList) |
172 |
> |
EAMList%n_eam_types = nEAMtypes |
173 |
> |
allocate(EAMList%EAMParams(nEAMTypes)) |
174 |
> |
nAtypes = getSize(atypes) |
175 |
> |
allocate(EAMList%atidToEAMType(nAtypes)) |
176 |
|
end if |
177 |
|
|
178 |
|
EAMList%currentAddition = EAMList%currentAddition + 1 |
179 |
|
current = EAMList%currentAddition |
180 |
|
|
181 |
+ |
myATID = getFirstMatchingElement(atypes, "c_ident", c_ident) |
182 |
+ |
EAMList%atidToEAMType(myATID) = current |
183 |
|
|
184 |
|
call allocate_EAMType(eam_nrho,eam_nr,EAMList%EAMParams(current),stat=alloc_stat) |
185 |
|
if (alloc_stat /= 0) then |
187 |
|
return |
188 |
|
end if |
189 |
|
|
190 |
< |
! this is a possible bug, we assume a correspondence between the vector atypes and |
186 |
< |
! EAMAtypes |
187 |
< |
|
190 |
> |
|
191 |
|
EAMList%EAMParams(current)%eam_atype = eam_ident |
192 |
|
EAMList%EAMParams(current)%eam_lattice = lattice_constant |
193 |
|
EAMList%EAMParams(current)%eam_nrho = eam_nrho |