diff --git a/src/io/io_progress_bar.f90 b/src/io/io_progress_bar.f90 index d541ca99b..9a49ff935 100644 --- a/src/io/io_progress_bar.f90 +++ b/src/io/io_progress_bar.f90 @@ -7,7 +7,6 @@ module io_progress_bar implicit none public - character(len=1), dimension(4), parameter, private :: spinstr = ["\","-","|","/"] !! The progress spinner sequency character(len=1),parameter, private :: barchar = "#" !! The progress bar character type :: progress_bar @@ -16,21 +15,18 @@ module io_progress_bar !! Implements a class for a simple progress bar that can print on the screen. integer(I4B) :: PBARSIZE = 80 !! Number of characters acros for a whole progress bar integer(I8B) :: loop_length !! The total number of loops that the progrees bar is executing - integer(I8B) :: spinner_cycle_length !! The number of loop iterations it takes to execute a full spinner cycle - integer(I8B) :: spinner_skip !! The number of loop iterations to execute before updating the spinner character(len=:), allocatable :: barstr !! The string that prints out as the progress bar integer(I4B) :: bar_pos !! The current position of the progress bar - integer(I4B) :: spin_pos !! Position of the "spinner" that indicates that progress is being made character(len=32) :: fmt !! The format string that is used to define the progress bar itself character(len=64) :: message !! The current message displayed at the end of the progress bar contains procedure :: reset => io_pbar_reset !! Resets the progress bar to the beginning - procedure :: update => io_pbar_update !! Updates the progress bar with new values and causes the "spinner" to flip. + procedure :: update => io_pbar_update !! Updates the progress bar with new values end type progress_bar contains - subroutine io_pbar_reset(self, loop_length, spinner_cycle_length) + subroutine io_pbar_reset(self, loop_length) !! author: David A. Minton !! !! Resets the progress bar to the beginning @@ -38,7 +34,6 @@ subroutine io_pbar_reset(self, loop_length, spinner_cycle_length) ! 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 - integer(I8B), intent(in), optional :: spinner_cycle_length !! The number of iterations between a complete spinner cycle. If not passd, the default is to update the spinner each call ! Internals character(len=2) :: numchar integer(I4B) :: k @@ -54,14 +49,6 @@ subroutine io_pbar_reset(self, loop_length, spinner_cycle_length) self%loop_length = loop_length self%bar_pos = 0 self%message = "" - if (present(spinner_cycle_length)) then - self%spinner_cycle_length = spinner_cycle_length - self%spinner_skip = self%spinner_cycle_length / size(spinstr) - else - self%spinner_cycle_length = size(spinstr) - self%spinner_skip = 1 - end if - self%spin_pos = 1 write(*,fmt=self%fmt) char(13),self%barstr,trim(adjustl(self%message)) @@ -72,7 +59,7 @@ end subroutine io_pbar_reset subroutine io_pbar_update(self,i,message) !! author: David A. Minton !! - !! Updates the progress bar with new values and causes the "spinner" to flip. + !! Updates the progress bar with new values implicit none ! Arguments class(progress_bar), intent(inout) :: self !! Progres bar object @@ -80,7 +67,7 @@ subroutine io_pbar_update(self,i,message) character(len=*), intent(in), optional :: message !! An optional message to display to the right of the progress bar ! Internals real(DP) :: frac - integer(I4B) :: bar_pos, spin_pos !! The current integer position of the progress bar and spinner + integer(I4B) :: bar_pos !! The current integer position of the progress bar logical :: update = .false. ! Compute the current position @@ -94,14 +81,6 @@ subroutine io_pbar_update(self,i,message) self%bar_pos = bar_pos end if - ! Compute the current value of the spinner and set the spinner character - spin_pos = mod(i / self%spinner_skip, size(spinstr)) + 1 - if (spin_pos /= self%spin_pos) then - self%barstr(bar_pos+1:bar_pos+1) = spinstr(spin_pos) - self%spin_pos = spin_pos - update = .true. - end if - if (present(message)) then if (message /= self%message) then update = .true. diff --git a/src/main/swiftest_driver.f90 b/src/main/swiftest_driver.f90 index f93f2522a..7b97eea43 100644 --- a/src/main/swiftest_driver.f90 +++ b/src/main/swiftest_driver.f90 @@ -91,7 +91,7 @@ program swiftest_driver !$ write(*,'(a,i3,/)') ' Number of threads = ', nthreads !write(*, *) " *************** Main Loop *************** " if (param%lrestart .and. param%lenergy) call nbody_system%conservation_report(param, lterminal=.true.) - call pbar%reset(nloops, spinner_cycle_length=istep_out) + call pbar%reset(nloops) write(pbarmessage,fmt=pbarfmt) t0, tstop call pbar%update(1,message=pbarmessage) do iloop = 1, nloops