io_get_seedname Subroutine

public subroutine io_get_seedname()

Get the seedname from the commandline

Arguments

None

Contents

Source Code


Source Code

  subroutine io_get_seedname()
    !=======================================
    !
    !! Get the seedname from the commandline
    !=======================================

    implicit none

    integer :: num_arg
    character(len=50) :: ctemp

    post_proc_flag = .false.

    num_arg = command_argument_count()
    if (num_arg == 0) then
      seedname = 'wannier'
    elseif (num_arg == 1) then
      call get_command_argument(1, seedname)
      if (index(seedname, '-pp') > 0) then
        post_proc_flag = .true.
        seedname = 'wannier'
      end if
    else
      call get_command_argument(1, seedname)
      if (index(seedname, '-pp') > 0) then
        post_proc_flag = .true.
        call get_command_argument(2, seedname)
      else
        call get_command_argument(2, ctemp)
        if (index(ctemp, '-pp') > 0) post_proc_flag = .true.
      end if

    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

  end subroutine io_get_seedname