Your layout, your fields
One template lays the line out, '{bar:30} {percent:yellow} ETA {eta}'; a field of your own shows the residual of your solver, or anything else.
Layout templates
Bars, spinners, ETA and messages for long-running Fortran programs: one object, three calls, pure Fortran 2008. On a terminal it animates; in a batch log it writes clean lines.

A (pretend) CFD run: nested bars, messages above the bar, ETA and summary. Every frame is drawn by forbear.
Initialize the bar, start it, update it at every step: this is a whole program.
program minimal
!< The smallest progress bar: the default range is [0, 1].
use, intrinsic :: iso_fortran_env, only : R8P=>real64
use forbear, only : bar_object
implicit none
type(bar_object) :: bar ! the progress bar
real(R8P) :: x ! progress, in [0, 1]
integer :: i ! counter
integer :: j ! counter
real(R8P) :: y ! work result
x = 0._R8P
call bar%initialize(filled_char_string='+', prefix_string='progress |', suffix_string='|', &
add_progress_percent=.true.)
call bar%start
do i = 1, 20
x = x + 0.05_R8P
do j = 1, 1000000
y = sqrt(x) ! just spend some time
enddo
call bar%update(current=x)
enddo
if (y < 0._R8P) print *, y
endprogram minimal$ minimal
progress |++++++++++++++++++++++++++++++++| 100%Segments lit and unlit, a redline, a rising tachometer, a scanner and seven-segment numbers: theme, bar_zones, bar_profile, pulse_trail and digits.

All of it in chapter 11 of the tutorial.
Every spinner of forbear is a bar too: here eighteen of them, each one a bar on its own line.

The whole catalogue is in Spinners.
Every kind of output forbear draws, each the real output of a program of the docs (on a terminal, at the end of the run or while running); the title leads to its recipe in the cookbook.
$ minimal
progress |++++++++++++++++++++++++++++++++| 100%A bar over the steps of a loop
$ march
********************************
march: 50 time steps done$ many
records ******************************** 100%$ march
march ββββββββββββββββββββ β$ march
march ββββββββββββββββββββββββββββββββββββββββββ$ march
march [ββββββββββββββββββββββββββββββββββββββββ] time steps$ march
march ββββββββββββββββββββββββββββββββββββββββ 50%A redline: colours by position
$ tach
RPM ββββββββββββββββββββββββββββββββββββββββ 80%$ tach
RPM ββββββββββββββββββββββββ
β
β
β
β
ββββββββββββ 80%$ march
march ββββββββββββββββββββββββββββββ π―Έπ―Έπ―΅% π―Έπ―Έπ―·/π―±π―²π―°$ march
vfd ββββββββββββββββββββββββββββββ 58%
amber ββββββββββββββββββ
β
β
β
βββββββββ 58%
kitt ββββββββββββββββββββββββββββββ 29Percent, count, speed, ETA, scale, times, summary
$ march
[ 0.00 (min) (max) 50.00]
march [##############################] 100% 50/50 ( nn.nn%/s) ETA hh:mm:ss
[yyyy/mm/dd hh:mm:ss - yyyy/mm/dd hh:mm:ss]
[done in n.nn s, nn.nn/s]$ march
solve [***********************-------] 78%$ march
march [####################....................] β ΄$ march
march [########################################] β
march β ΄$ march
march [########################################] β
march β
march 50%Lines above the bar, a message at its end
$ march
step 10: solution saved
step 20: solution saved
step 30: solution saved
step 40: solution saved
step 50: solution saved
march [##############################] 100% residual 8.88E-16Output of a library while the bar runs
$ march
io_library: writing solution_0020.h5
io_library: done, 2.1 MB
io_library: writing solution_0040.h5
io_library: done, 2.1 MB
march [##############################] 100%$ march
time step [ββββββββββββ ] 2/5
newton [ββββββββββββββββββ ] 6/10Several bars one after another
$ sequence
mesh ********************************
solve ********************************
write ********************************
mesh [==============================] 100%
solve [==============================] 100%
write [==============================] 100%$ layout
load 50% [**********----------] 6/12 files, hh:mm:ss left$ march
march ββββββββββββββββββββββββββββββ 100% step 50/50 ETA hh:mm:ss res 8.9E-16$ march
solve β [........#####.......] 8 iterations, hh:mm:ssA scanner for a loop of unknown length
$ solve
solve β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬ 31$ march
solve β [####################] 20 iterations, hh:mm:ss
march [##################............] 60% steady state$ march > run.log; cat run.log
march [..............................] 0% 0/50 ETA --:--:--
march [###...........................] 10% 5/50 ETA hh:mm:ss
march [######........................] 20% 10/50 ETA hh:mm:ss
march [#########.....................] 30% 15/50 ETA hh:mm:ss
march [############..................] 40% 20/50 ETA hh:mm:ss
march [###############...............] 50% 25/50 ETA hh:mm:ss
march [##################............] 60% 30/50 ETA hh:mm:ss
march [#####################.........] 70% 35/50 ETA hh:mm:ss
march [########################......] 80% 40/50 ETA hh:mm:ss
march [###########################...] 90% 45/50 ETA hh:mm:ss
march [##############################] 100% 50/50 ETA hh:mm:ss
[done in n.nn s, nn.nn/s]
march: done$ march > run.log; cat run.log
solve 0 iterations, hh:mm:ss elapsed
solve 2 iterations, hh:mm:ss elapsed
solve 4 iterations, hh:mm:ss elapsed
solve 6 iterations, hh:mm:ss elapsed
solve 8 iterations, hh:mm:ss elapsed
solve 10 iterations, hh:mm:ss elapsed$ FORBEAR_DISABLE=1 march
march: done$ stderr > results.txt
march [########################################] 100%$ scale_narrow
ERROR STOP error: for adding scale bar the bar width must be at least 22 chars
[exit status 1]Learn forbear step by step in the tutorial, find quick answers in the cookbook, look up every keyword in the reference.
Contributions are welcome β see the Contributing page.