Set the seedname from the command line
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | stdout | |||
| character(len=50), | intent(inout) | :: | seedname |
subroutine conv_get_seedname(stdout, seedname) !! Set the seedname from the command line implicit none integer, intent(in) :: stdout character(len=50), intent(inout) :: seedname 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(stdout) call io_error('Wrong command line arguments, see logfile for usage', stdout) 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(stdout) call io_error('Wrong command line arguments, see logfile for usage', stdout) end if end subroutine conv_get_seedname