|
|
|
@ -198,9 +198,11 @@ module elements
|
|
|
|
|
|
|
|
|
|
!The default size we grow the
|
|
|
|
|
buffer_size = 1024
|
|
|
|
|
|
|
|
|
|
!First check to make sure if it is allocated
|
|
|
|
|
if (allocated(size_ele)) then
|
|
|
|
|
!Figure out the size of the atom and element arrays
|
|
|
|
|
ele_size = size(size_ele)
|
|
|
|
|
atom_size = size(type_atom)
|
|
|
|
|
|
|
|
|
|
!Check if we need to grow the ele_size, if so grow all the variables
|
|
|
|
|
if ( n+ele_num > size(size_ele)) then
|
|
|
|
@ -234,8 +236,13 @@ module elements
|
|
|
|
|
temp_ele_real(:,:,:,ele_size+1:) = 0.0_dp
|
|
|
|
|
call move_alloc(temp_ele_real, r_node)
|
|
|
|
|
end if
|
|
|
|
|
else
|
|
|
|
|
call alloc_ele_arrays(n,0)
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
!Now grow atom arrays if needed
|
|
|
|
|
if (allocated(type_atom)) then
|
|
|
|
|
atom_size = size(type_atom)
|
|
|
|
|
if (m+atom_num > atom_size) then
|
|
|
|
|
allocate(temp_int(m+atom_num+buffer_size))
|
|
|
|
|
temp_int(1:atom_size) = type_atom
|
|
|
|
@ -257,6 +264,9 @@ module elements
|
|
|
|
|
temp_real(:, atom_size+1:) = 0.0_dp
|
|
|
|
|
call move_alloc(temp_real, r_atom)
|
|
|
|
|
end if
|
|
|
|
|
else
|
|
|
|
|
call alloc_ele_arrays(0,m)
|
|
|
|
|
end if
|
|
|
|
|
end subroutine
|
|
|
|
|
|
|
|
|
|
subroutine add_element(tag, type, size, lat, sbox, r)
|
|
|
|
@ -669,17 +679,17 @@ module elements
|
|
|
|
|
esize = size_ele(ie)
|
|
|
|
|
select case(iface)
|
|
|
|
|
case(1)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp, -10.0_dp**-2.0_dp /)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp, -10.0_dp**(-2.0_dp) /)
|
|
|
|
|
case(2)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, -10.0_dp**-2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, -10.0_dp**(-2.0_dp), real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
case(3)
|
|
|
|
|
pos = (/ (esize-1)+10.0_dp**-2.0_dp, real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
pos = (/ (esize-1)+10.0_dp**(-2.0_dp), real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
case(4)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, (esize-1)+10.0_dp**-2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, (esize-1)+10.0_dp**(-2.0_dp), real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
case(5)
|
|
|
|
|
pos = (/ -10.0_dp**-2.0_dp, real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
pos = (/ -10.0_dp**(-2.0_dp), real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp /)
|
|
|
|
|
case(6)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp, (esize-1)+10.0_dp**-2.0_dp /)
|
|
|
|
|
pos = (/ real(esize-1,dp)/2.0_dp, real(esize-1,dp)/2.0_dp, (esize-1)+10.0_dp**(-2.0_dp) /)
|
|
|
|
|
end select
|
|
|
|
|
|
|
|
|
|
!Now transform it to real space and adjust it to the position of the element in the first node.
|
|
|
|
|