Added sbox_ori option for when reading in restart files

master
Alex Selimov 4 years ago
parent 4868a30e57
commit a9b266d757

@ -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

@ -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

@ -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
Loading…
Cancel
Save