utility_strip Function

public function utility_strip(string)

Uses

  • proc~~utility_strip~~UsesGraph proc~utility_strip utility_strip module~w90_io w90_io proc~utility_strip->module~w90_io module~w90_constants w90_constants module~w90_io->module~w90_constants

Strips string of all blank spaces

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: string

Return Value character(len=maxlen)


Called by

proc~~utility_strip~~CalledByGraph proc~utility_strip utility_strip proc~param_get_projections param_get_projections proc~param_get_projections->proc~utility_strip proc~param_read param_read proc~param_read->proc~param_get_projections program~wannier wannier program~wannier->proc~param_read proc~wannier_run wannier_run proc~wannier_run->proc~param_read proc~wannier_setup wannier_setup proc~wannier_setup->proc~param_read program~postw90 postw90 program~postw90->proc~param_read

Contents

Source Code


Source Code

  function utility_strip(string)!
    !=============================!
    !                             !
    !! Strips string of all blank spaces
    !                             !
    !=============================!

    use w90_io, only: maxlen

    implicit none

    character(len=*), intent(in) :: string
    character(len=maxlen) :: utility_strip

    integer :: ispc, ipos, ilett, icount

    ! Initialise
    utility_strip = repeat(' ', maxlen)

    ispc = ichar(' ')
    icount = 0
    do ipos = 1, len(string)
      ilett = ichar(string(ipos:ipos))
      if (ilett .ne. ispc) then
        icount = icount + 1
        utility_strip(icount:icount) = string(ipos:ipos)
      endif
    enddo

    utility_strip = trim(utility_strip)

    return

  end function utility_strip