diff --git a/README.md b/README.md index 346fa58..fe71ed0 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,14 @@ Delete requires the usage of additional keywords to specify which delete action This command will delete all overlapping atoms within a specific cutoff radius `rc_off`. This currently does not affect elements. +### Option sbox_ori + +``` +-sbox_ori sbox [hkl] [hkl] [hkl] +``` + +This option is primarily used when reading data from non .mb formats. This code simply sets the orientation variable for the specified sub box `sbox`. + **** ## Position Specification diff --git a/src/call_option.f90 b/src/call_option.f90 index 73cd1de..ead7af0 100644 --- a/src/call_option.f90 +++ b/src/call_option.f90 @@ -29,6 +29,8 @@ subroutine call_option(option, arg_pos) call get_command_argument(arg_pos, box_bc) arg_pos=arg_pos+1 bound_called = .true. + case('-sbox_ori') + call sbox_ori(arg_pos) case('-delete') call run_delete(arg_pos) case default diff --git a/src/opt_orient.f90 b/src/opt_orient.f90 index 812754f..0f0dea9 100644 --- a/src/opt_orient.f90 +++ b/src/opt_orient.f90 @@ -133,4 +133,29 @@ module opt_orient box_bd = orig_box_bd end subroutine unorient + subroutine sbox_ori(arg_pos) + integer, intent(inout) :: arg_pos + + integer :: i, sbox_in, arg_len + real(kind = dp) :: new_orient(3,3) + character(len=100) :: textholder + character(len=8) :: ori_string + + arg_pos = arg_pos + 1 + call get_command_argument(arg_pos, textholder,arg_len) + if (arg_len== 0) stop 'Missing sbox in sbox_ori command' + read(textholder,*) sbox_in + + do i = 1, 3 + arg_pos = arg_pos + 1 + call get_command_argument(arg_pos, ori_string, arg_len) + if (arg_len == 0) print *, "Missing orientation vector in -orient option" + call parse_ori_vec(ori_string, new_orient(i,:)) + new_orient(i,:) = new_orient(i,:) / norm2(new_orient(i,:)) + end do + + sub_box_ori(:,:,sbox_in) = new_orient + arg_pos = arg_pos + 1 + + end subroutine sbox_ori end module opt_orient \ No newline at end of file