conv_get_seedname Subroutine

public subroutine conv_get_seedname(stdout, seedname)

Set the seedname from the command line

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: stdout
character(len=50), intent(inout) :: seedname

Calls

proc~~conv_get_seedname~~CallsGraph proc~conv_get_seedname conv_get_seedname proc~io_error io_error proc~conv_get_seedname->proc~io_error proc~print_usage print_usage proc~conv_get_seedname->proc~print_usage

Called by

proc~~conv_get_seedname~~CalledByGraph proc~conv_get_seedname conv_get_seedname program~w90spn2spn w90spn2spn program~w90spn2spn->proc~conv_get_seedname

Source Code

  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