Added ability to have spaces in orient string if passed with quotes

master
Alex Selimov 5 years ago
parent 66670671b5
commit ffbe83f2f5

@ -165,7 +165,7 @@ module mode_create
integer, intent(out) :: arg_pos integer, intent(out) :: arg_pos
integer :: ori_pos, i, j, arglen, stat integer :: ori_pos, i, j, arglen, stat
character(len=100) :: textholder character(len=100) :: textholder
character(len=8) :: orient_string character(len=20) :: orient_string
logical :: isortho, isrighthanded logical :: isortho, isrighthanded
@ -518,4 +518,4 @@ module mode_create
end subroutine error_message end subroutine error_message
end module mode_create end module mode_create

@ -51,7 +51,7 @@ module opt_disl
integer :: i,arglen integer :: i,arglen
character(len=100) :: textholder character(len=100) :: textholder
character(len=8) :: ori_string character(len=20) :: ori_string
!Parse all of the commands !Parse all of the commands
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
@ -601,4 +601,4 @@ module opt_disl
return return
end subroutine vacancy_disloop end subroutine vacancy_disloop
end module opt_disl end module opt_disl

@ -76,7 +76,7 @@ module opt_orient
integer :: i, arg_len integer :: i, arg_len
logical :: isortho, isrighthanded logical :: isortho, isrighthanded
character(len=8) :: ori_string character(len=20) :: ori_string
!Pull out the new user orientation !Pull out the new user orientation
do i = 1, 3 do i = 1, 3
@ -139,7 +139,7 @@ module opt_orient
integer :: i, sbox_in, arg_len integer :: i, sbox_in, arg_len
real(kind = dp) :: new_orient(3,3) real(kind = dp) :: new_orient(3,3)
character(len=100) :: textholder character(len=100) :: textholder
character(len=8) :: ori_string character(len=20) :: ori_string
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
call get_command_argument(arg_pos, textholder,arg_len) call get_command_argument(arg_pos, textholder,arg_len)
@ -158,4 +158,4 @@ module opt_orient
arg_pos = arg_pos + 1 arg_pos = arg_pos + 1
end subroutine sbox_ori end subroutine sbox_ori
end module opt_orient end module opt_orient

@ -149,13 +149,16 @@ module subroutines
subroutine parse_ori_vec(ori_string, ori_vec) subroutine parse_ori_vec(ori_string, ori_vec)
!This subroutine parses a string to vector in the format [ijk] !This subroutine parses a string to vector in the format [ijk]
character(len=8), intent(in) :: ori_string character(len=20), intent(in) :: ori_string
real(kind=dp), dimension(3), intent(out) :: ori_vec real(kind=dp), dimension(3), intent(out) :: ori_vec
integer :: i, ori_pos, stat integer :: i, ori_pos, stat
ori_pos=2 ori_pos=2
do i = 1,3 do i = 1,3
do while(ori_string(ori_pos:ori_pos)==' ')
ori_pos=ori_pos+1
end do
if (ori_string(ori_pos:ori_pos) == '-') then if (ori_string(ori_pos:ori_pos) == '-') then
ori_pos = ori_pos + 1 ori_pos = ori_pos + 1
read(ori_string(ori_pos:ori_pos), *, iostat=stat) ori_vec(i) read(ori_string(ori_pos:ori_pos), *, iostat=stat) ori_vec(i)

Loading…
Cancel
Save