ProgressBar Derived Type

type, public :: ProgressBar

A progress bar that displays a moving counter with percentage and optional estimated time remaining Print the progress Bar

Initialize the Progress Bar



Constructor

public interface ProgressBar

  • private function ProgressBar_i1(N, title, time) result(res)

    Interfaced with class instantiation ProgressBar()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i32), intent(in) :: N

    Maximum expected number of iterations

    character(len=*), intent(in), optional :: title

    Title to give the progress bar

    logical, intent(in), optional :: time

    Show an estimated time to completion?

    Return Value type(ProgressBar)

  • private function ProgressBar_id1(N, title, time) result(res)

    Interfaced with class instantiation ProgressBar()

    Arguments

    Type IntentOptional AttributesName
    integer(kind=i64), intent(in) :: N

    Maximum expected number of iterations

    character(len=*), intent(in), optional :: title

    Title to give the progress bar

    logical, intent(in), optional :: time

    Show an estimated time to completion?

    Return Value type(ProgressBar)


Type-Bound Procedures

generic, public :: print => print_i1_ProgressBar_, print_id1_ProgressBar_

Print the progress Bar

  • private subroutine print_i1_ProgressBar(this, i)

    Interfaced with ProgressBar%print()

    Arguments

    Type IntentOptional AttributesName
    class(ProgressBar) :: this

    ProgressBar Class

    integer(kind=i32), intent(in) :: i

    Current iteration number

  • private subroutine print_id1_ProgressBar(this, i)

    Interfaced with ProgressBar%print()

    Arguments

    Type IntentOptional AttributesName
    class(ProgressBar) :: this

    ProgressBar Class

    integer(kind=i64), intent(in) :: i

    Current iteration number