conv_get_seedname Subroutine

public subroutine conv_get_seedname()

Set the seedname from the command line

Arguments

None

Calls

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

Called by

proc~~conv_get_seedname~~CalledByGraph proc~conv_get_seedname conv_get_seedname program~w90chk2chk w90chk2chk program~w90chk2chk->proc~conv_get_seedname

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