Working changes to boundary command

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

@ -1,6 +1,6 @@
FC=ifort 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 -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 -Ofast -no-wrap-margin -heap-arrays
MODES=mode_create.o mode_merge.o mode_convert.o MODES=mode_create.o mode_merge.o mode_convert.o
OPTIONS=opt_disl.o opt_group.o opt_orient.o opt_delete.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 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 real(kind=dp) :: box_bd(6) !Global box boundaries
character(len=3) :: box_bc !Box boundary conditions (periodic or shrinkwrapped) 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 !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 !command. Currently only mode_merge will require sub_boxes, for mode_create it will always
!allocate to only 1 sub_box !allocate to only 1 sub_box
@ -27,6 +28,7 @@ module box
!Initialize some box functions !Initialize some box functions
box_bd(:) = 0.0_dp box_bd(:) = 0.0_dp
box_bc = 'ppp' box_bc = 'ppp'
bound_called=.false.
end subroutine box_init end subroutine box_init
subroutine alloc_sub_box(n) subroutine alloc_sub_box(n)

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

@ -479,15 +479,16 @@ module elements
do j = 1, 3 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) > 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 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
end do end do
end do end do
do j = 1, 3 do j = 1, 3
if(box_bc(j:j) == 's') then
box_bd(2*j) = max_bd(j) box_bd(2*j) = max_bd(j)
box_bd(2*j-1) = min_bd(j) box_bd(2*j-1) = min_bd(j)
end if
end do end do
end subroutine end subroutine

@ -101,6 +101,9 @@ program main
!If wrap flag was passed then call the wrap atoms command !If wrap flag was passed then call the wrap atoms command
if(wrap_flag) call wrap_atoms 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 !Check to make sure a file was passed to be written out and then write out
! Before building do a check on the file ! Before building do a check on the file
if (outfilenum == 0) then if (outfilenum == 0) then

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

Loading…
Cancel
Save