Resets the progress bar to the beginning
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(progress_bar), | intent(inout) | :: | self | The progress bar object |
||
| integer(kind=I8B), | intent(in) | :: | loop_length | The length of the loop that the progress bar is attached to |
subroutine io_progress_bar_reset(self, loop_length)
!! author: David A. Minton
!!
!! Resets the progress bar to the beginning
implicit none
! Arguments
class(progress_bar),intent(inout) :: self
!! The progress bar object
integer(I8B), intent(in) :: loop_length
!! The length of the loop that the progress bar is attached to
! Internals
character(len=2) :: numchar
integer(I4B) :: k
if (.not.allocated(self%barstr)) then
allocate(character(self%PBARSIZE) :: self%barstr)
end if
do k = 1, self%PBARSIZE
self%barstr(k:k) = " "
end do
write(numchar,'(I2)') self%PBARSIZE
self%fmt = '(A1,"[",A' // numchar // ',"] ",A,$)'
self%loop_length = loop_length
self%bar_pos = 0
self%message = ""
write(*,fmt=self%fmt) char(13),self%barstr,trim(adjustl(self%message))
return
end subroutine io_progress_bar_reset