Added fixes to redef_box and to writing pycac restart files

development
Alex Selimov 4 years ago
parent 0620a07847
commit f92e80f9db

@ -73,10 +73,15 @@ module box
integer :: i
do i = 1, 3
if(temp_box_bd(2*i-1) < box_bd(2*i-1)) box_bd(2*i-1) = temp_box_bd(2*i-1)
if(temp_box_bd(2*i) > box_bd(2*i)) box_bd(2*i) = temp_box_bd(2*i)
end do
if(all(abs(box_bd) < lim_zero)) then
box_bd = temp_box_bd
else
do i = 1, 3
if(temp_box_bd(2*i-1) < box_bd(2*i-1)) box_bd(2*i-1) = temp_box_bd(2*i-1)
if(temp_box_bd(2*i) > box_bd(2*i)) box_bd(2*i) = temp_box_bd(2*i)
end do
end if
return
end subroutine grow_box

@ -379,7 +379,7 @@ module io
!NOTE: This code doesn't work for arbitrary number of basis atoms per node. It assumes that the
!each element has only 1 atom type at the node.
character(len=100), intent(in) :: file
integer :: interp_max, i, j, inod, ibasis, ip, unique_index(50), unique_size(50), unique_num, &
integer :: interp_max, i, j, inod, ibasis, ip, unique_index(50), unique_size(50), unique_type(50), unique_num, &
etype
real(kind=dp) :: box_vec(3)
@ -426,6 +426,7 @@ module io
unique_num = unique_num + 1
unique_index(unique_num) = i
unique_size(unique_num) = size_ele(i)
unique_type(unique_num) = lat_ele(i)
end do eleloop
!Calculate the max number of atoms per element
@ -486,7 +487,7 @@ module io
do i = 1, ele_num
!Figure out the ele type
do j = 1, unique_num
if ( unique_size(j) == size_ele(i)) then
if ( (unique_size(j) == size_ele(i)).and.(unique_type(j) == lat_ele(i))) then
etype = j
exit
endif

@ -14,6 +14,7 @@ module mode_convert
character(len=100) :: infile
real(kind = dp) :: temp_box_bd(6)
!First read in the file
temp_box_bd(:) = 0.0_dp
call get_command_argument(2, infile)
call get_in_file(infile)
call read_in(1, (/0.0_dp,0.0_dp,0.0_dp/), temp_box_bd)

@ -25,6 +25,7 @@ module mode_merge
shift_flag = .false.
shift_vec(:) = 0.0_dp
temp_box_bd(:) = 0.0_dp
!First we parse the merge command
call parse_command(arg_pos)
@ -41,7 +42,6 @@ module mode_merge
if ((i==1).or.(trim(adjustl(dim)) == 'none')) then
call read_in(i, displace, temp_box_bd)
call grow_box(temp_box_bd)
else
select case(trim(adjustl(dim)))
case('x')
@ -53,7 +53,6 @@ module mode_merge
end select
call read_in(i, displace, temp_box_bd)
call grow_box(temp_box_bd)
end if
if(shift_flag) call shift(new_starts, i)

@ -20,6 +20,10 @@ module opt_redef_box
!First parse the argument
call parse_redef_box(arg_pos)
print *, '------------------------------------------------------------'
print *, 'Option redef_box'
print *, '------------------------------------------------------------'
!Now first filter atoms that don't fit in the new box bounds and delete them
delete_num = 0
do i = 1, atom_num
@ -68,6 +72,7 @@ module opt_redef_box
call delete_elements(delete_num, delete_list(1:delete_num))
print *, "Old box_bd: ", box_bd, " is redefined to new box boundaries: ", new_bd
box_bd=new_bd
box_bc = new_bc

Loading…
Cancel
Save