Working changes to boundary command

master
Alex Selimov 4 years ago
parent 80c931d77a
commit 0ad06a2d6b

@ -1,6 +1,6 @@
FC=ifort
FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
#FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
#FFLAGS=-mcmodel=large -g -O0 -stand f08 -fpe0 -traceback -check bounds,uninit -warn all -implicitnone -no-wrap-margin -heap-arrays
FFLAGS=-mcmodel=large -Ofast -no-wrap-margin -heap-arrays
MODES=mode_create.o mode_merge.o mode_convert.o
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.o
OBJECTS=main.o elements.o io.o subroutines.o functions.o atoms.o call_mode.o box.o $(MODES) $(OPTIONS) call_option.o

@ -6,6 +6,7 @@ module box
real(kind=dp) :: box_bd(6) !Global box boundaries
character(len=3) :: box_bc !Box boundary conditions (periodic or shrinkwrapped)
logical :: bound_called
!The subbox variables contain values for each subbox, being the boxes read in through some
!command. Currently only mode_merge will require sub_boxes, for mode_create it will always
!allocate to only 1 sub_box
@ -27,6 +28,7 @@ module box
!Initialize some box functions
box_bd(:) = 0.0_dp
box_bc = 'ppp'
bound_called=.false.
end subroutine box_init
subroutine alloc_sub_box(n)

@ -28,6 +28,7 @@ subroutine call_option(option, arg_pos)
arg_pos=arg_pos+1
call get_command_argument(arg_pos, box_bc)
arg_pos=arg_pos+1
bound_called = .true.
case('-delete')
call run_delete(arg_pos)
case default

@ -479,15 +479,16 @@ module elements
do j = 1, 3
if (r_node(j,ibasis,inod,i) > max_bd(j)) max_bd(j) = r_node(j,ibasis,inod,i) + lim_zero
if (r_node(j,ibasis,inod,i) < min_bd(j)) min_bd(j) = r_node(j,ibasis,inod,i) -lim_zero
end do
end do
end do
end do
do j = 1, 3
box_bd(2*j) = max_bd(j)
box_bd(2*j-1) = min_bd(j)
if(box_bc(j:j) == 's') then
box_bd(2*j) = max_bd(j)
box_bd(2*j-1) = min_bd(j)
end if
end do
end subroutine

@ -101,6 +101,9 @@ program main
!If wrap flag was passed then call the wrap atoms command
if(wrap_flag) call wrap_atoms
!If we called the boundary command then we adjust the box bounds
if(bound_called) call def_new_box
!Check to make sure a file was passed to be written out and then write out
! Before building do a check on the file
if (outfilenum == 0) then

@ -230,11 +230,13 @@ module subroutines
integer :: j
real(kind=dp) ::box_len
do j = 1, 3
box_len = box_bd(2*j) - box_bd(2*j-1)
if (r(j) > box_bd(2*j)) then
r(j) = r(j) - box_len
else if (r(j) < box_bd(2*j-1)) then
r(j) = r(j) + box_len
if(box_bc(j:j) == 'p') then
box_len = box_bd(2*j) - box_bd(2*j-1)
if (r(j) > box_bd(2*j)) then
r(j) = r(j) - box_len
else if (r(j) < box_bd(2*j-1)) then
r(j) = r(j) + box_len
end if
end if
end do
end subroutine

Loading…
Cancel
Save