From ffbe83f2f51eeadf1c50e85a608eefcd047953a8 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Tue, 19 May 2020 15:42:38 -0400 Subject: [PATCH] Added ability to have spaces in orient string if passed with quotes --- src/mode_create.f90 | 4 ++-- src/opt_disl.f90 | 4 ++-- src/opt_orient.f90 | 6 +++--- src/subroutines.f90 | 5 ++++- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/mode_create.f90 b/src/mode_create.f90 index ffdfc05..4e92492 100644 --- a/src/mode_create.f90 +++ b/src/mode_create.f90 @@ -165,7 +165,7 @@ module mode_create integer, intent(out) :: arg_pos integer :: ori_pos, i, j, arglen, stat character(len=100) :: textholder - character(len=8) :: orient_string + character(len=20) :: orient_string logical :: isortho, isrighthanded @@ -518,4 +518,4 @@ module mode_create end subroutine error_message -end module mode_create \ No newline at end of file +end module mode_create diff --git a/src/opt_disl.f90 b/src/opt_disl.f90 index 75adcc1..19f8ed8 100644 --- a/src/opt_disl.f90 +++ b/src/opt_disl.f90 @@ -51,7 +51,7 @@ module opt_disl integer :: i,arglen character(len=100) :: textholder - character(len=8) :: ori_string + character(len=20) :: ori_string !Parse all of the commands arg_pos = arg_pos + 1 @@ -601,4 +601,4 @@ module opt_disl return end subroutine vacancy_disloop -end module opt_disl \ No newline at end of file +end module opt_disl diff --git a/src/opt_orient.f90 b/src/opt_orient.f90 index 0f0dea9..4ec4b4c 100644 --- a/src/opt_orient.f90 +++ b/src/opt_orient.f90 @@ -76,7 +76,7 @@ module opt_orient integer :: i, arg_len logical :: isortho, isrighthanded - character(len=8) :: ori_string + character(len=20) :: ori_string !Pull out the new user orientation do i = 1, 3 @@ -139,7 +139,7 @@ module opt_orient integer :: i, sbox_in, arg_len real(kind = dp) :: new_orient(3,3) character(len=100) :: textholder - character(len=8) :: ori_string + character(len=20) :: ori_string arg_pos = arg_pos + 1 call get_command_argument(arg_pos, textholder,arg_len) @@ -158,4 +158,4 @@ module opt_orient arg_pos = arg_pos + 1 end subroutine sbox_ori -end module opt_orient \ No newline at end of file +end module opt_orient diff --git a/src/subroutines.f90 b/src/subroutines.f90 index ece2294..1015968 100644 --- a/src/subroutines.f90 +++ b/src/subroutines.f90 @@ -149,13 +149,16 @@ module subroutines subroutine parse_ori_vec(ori_string, ori_vec) !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 integer :: i, ori_pos, stat ori_pos=2 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 ori_pos = ori_pos + 1 read(ori_string(ori_pos:ori_pos), *, iostat=stat) ori_vec(i)