Set the seedname from the command line
subroutine conv_get_seedname
!! Set the seedname from the command line
implicit none
integer :: num_arg
character(len=50) :: ctemp
num_arg = command_argument_count()
if (num_arg == 1) then
seedname = 'wannier'
elseif (num_arg == 2) then
call get_command_argument(2, seedname)
else
call print_usage
call io_error('Wrong command line arguments, see logfile for usage')
end if
! If on the command line the whole seedname.win was passed, I strip the last ".win"
if (len(trim(seedname)) .ge. 5) then
if (seedname(len(trim(seedname)) - 4 + 1:) .eq. ".win") then
seedname = seedname(:len(trim(seedname)) - 4)
end if
end if
call get_command_argument(1, ctemp)
if (index(ctemp, '-import') > 0) then
export_flag = .false.
elseif (index(ctemp, '-f2u') > 0) then
export_flag = .false.
elseif (index(ctemp, '-export') > 0) then
export_flag = .true.
elseif (index(ctemp, '-u2f') > 0) then
export_flag = .true.
else
write (stdout, '(A)') 'Wrong command line action: '//trim(ctemp)
call print_usage
call io_error('Wrong command line arguments, see logfile for usage')
end if
end subroutine conv_get_seedname