Skip to content

Commit eb453f1

Browse files
committed
Merge branch 'development' into 'main'
Development See merge request hepplestone/artemis!11
2 parents ea835e3 + 46b3c04 commit eb453f1

3 files changed

Lines changed: 18 additions & 11 deletions

File tree

src/interfaces.f90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ subroutine gen_terminations(lat,bas,miller_plane,axis,directory,&
4343
thickness,udef_layer_sep)
4444
implicit none
4545
integer :: unit
46-
integer :: itmp1,j,iterm,term_start,term_end,iterm_step
46+
integer :: itmp1,iterm,term_start,term_end,iterm_step
4747
integer :: old_natom,ncells,thickness_val,ntrans
4848
double precision :: height
4949
character(len=1024) :: dirname,filename,pwd
@@ -264,9 +264,9 @@ end subroutine gen_interfaces_restart
264264
!!!#############################################################################
265265
subroutine gen_interfaces(tolerance,inlw_lat,inup_lat,inlw_bas,inup_bas)
266266
implicit none
267-
integer :: i,j,iterm,jterm,ntrans,ifit,iunique,old_natom,itmp1,old_intf
267+
integer :: j,iterm,jterm,ntrans,ifit,iunique,old_natom,itmp1,old_intf
268268
integer :: iterm_step,jterm_step
269-
integer :: lw_ncells,up_ncells,istep
269+
integer :: lw_ncells,up_ncells
270270
integer :: lw_layered_axis,up_layered_axis
271271
integer :: intf_start,intf_end
272272
integer :: lw_term_start,lw_term_end,up_term_start,up_term_end
@@ -872,7 +872,7 @@ subroutine gen_shifts_and_swaps(lat,bas,axis,intf_loc,bond,&
872872
!!!-----------------------------------------------------------------------------
873873
!!! Generates sets of shifts based on shift version
874874
!!!-----------------------------------------------------------------------------
875-
if(ishift.eq.0) allocate(output_shifts(nshift,3))
875+
if(ishift.eq.0.or.ishift.eq.1) allocate(output_shifts(nshift,3))
876876
select case(ishift)
877877
case(1)
878878
output_shifts(1,:3)=0.D0
@@ -1469,7 +1469,7 @@ subroutine prepare_slab(lat, bas, map, term, iterm, thickness, ncells, &
14691469
end if
14701470
end do ortho_check
14711471
end if
1472-
call normalise_basis(bas,dtmp=0.9999D0,lfloor=.true.)
1472+
call normalise_basis(bas,dtmp=0.9999D0,lfloor=.true.,zero_round=0.D0)
14731473

14741474

14751475
end subroutine prepare_slab

src/lib/mod_edit_geom.f90

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ function get_min_bulk_bond(lat,bas) result(min_bond)
180180

181181

182182
min_bond=huge(0.D0)
183+
if(bas%natom.eq.1)then
184+
min_bond = min(modu(lat(1,:3)),modu(lat(2,:3)),modu(lat(3,:3)))
185+
return
186+
end if
187+
183188
do is=1,bas%nspec
184189
do ia=1,bas%spec(is)%num
185190

@@ -199,7 +204,6 @@ function get_min_bulk_bond(lat,bas) result(min_bond)
199204
end do
200205
end do
201206

202-
203207
end function get_min_bulk_bond
204208
!!!#############################################################################
205209

@@ -891,12 +895,11 @@ end subroutine region_rot
891895
!!!#############################################################################
892896
!!! convert basis coordinates to be within +val -> val-1
893897
!!!#############################################################################
894-
!!! MAKE AN OPTIONAL SETTING TO MOVE CLOSES ATOM TO ZERO TO ACTUAL ZERO
895-
subroutine normalise_basis(bas,dtmp,lfloor,lround)
898+
subroutine normalise_basis(bas,dtmp,lfloor,lround,zero_round)
896899
implicit none
897900
integer :: is,ia,j
898901
double precision :: ceil,flr,dround
899-
double precision, optional :: dtmp
902+
double precision, optional :: dtmp, zero_round
900903
type(bas_type) :: bas
901904
logical :: lfloor1,lround1
902905
logical, optional :: lfloor,lround
@@ -926,6 +929,10 @@ subroutine normalise_basis(bas,dtmp,lfloor,lround)
926929
abs(bas%spec(is)%atom(ia,j)).lt.dround) &
927930
bas%spec(is)%atom(ia,j)=flr
928931
end if
932+
if(present(zero_round))then
933+
if(abs(bas%spec(is)%atom(ia,j)).lt.dround) &
934+
bas%spec(is)%atom(ia,j)=zero_round
935+
end if
929936
end do
930937
end do
931938
end do

src/mod_shifting.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,11 +745,11 @@ function get_shifts_DON(lat,bas,axis,intf_loc,nstore,c_scale,offset,&
745745
use edit_geom, only: get_bulk,wyck_spec_type,get_wyckoff
746746
use interface_identifier, only: gen_single_DON,nstep_default,den_of_neigh_type
747747
implicit none
748-
integer :: i,j,k,l,is,ia,ja,jb,jc,count1,itmp1,itmp2
748+
integer :: i,j,k,l,is,ia,ja,jb,jc,count1,itmp1
749749
integer :: ntrans,iatom,nneigh,ncheck
750750
real :: stepsize,max_sep,dist_max
751751
real :: rtmp1,rtmp2,rtmp3
752-
double precision :: bond,depth,cur_vac,c_shift,val,dtmp1,dtmp2
752+
double precision :: val,dtmp1,dtmp2
753753
logical :: lbulk, lpresent
754754
type(confine_type) :: confine
755755
integer, dimension(2) :: plane_loc

0 commit comments

Comments
 (0)