conv_get_seedname Subroutine

public subroutine conv_get_seedname()

Set the seedname from the command line

Arguments

None

Calls

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

Called by

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

Contents

Source Code


Source Code

  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