time_object Derived Type

type, public :: time_object

type~~time_object~~InheritsGraph type~time_object time_object type~error_object error_object type~error_object->type~time_object error
Help


Time object class.

Class designed to handle the timing data of the simulation.

Inherited By

type~~time_object~~InheritedByGraph type~time_object time_object type~simulation_object simulation_object type~time_object->type~simulation_object time
Help

Source Code


Components

TypeVisibility AttributesNameInitial
real(kind=R8P), public :: CFL =0.3_R8P

Courant-Friedrichs-Lewy stability coefficient.

type(error_object), public :: error

Errors handler.

logical, public :: is_unsteady =.true.

Type of simulation: unsteady or steady.

integer(kind=I8P), public :: n =0

Time steps counter.

integer(kind=I8P), public :: n_max =0

Maximum number of time steps computed.

real(kind=R8P), public :: t =0._R8P

Time.

real(kind=R8P), public :: t_max =0._R8P

Maximum time of integration, ignored if n_max>0.


Type-Bound Procedures

generic, public :: assignment(=) => time_assign_time

Overload =.

  • private pure subroutine time_assign_time(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: lhs

    Left hand side.

    type(time_object), intent(in) :: rhs

    Right hand side.

procedure, public, pass(self) :: description

Return a pretty-formatted description of time parameters.

  • private pure function description(self, prefix) result(desc)

    Return a pretty-formatted description of time parameters.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(in) :: self

    Time object.

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

    Prefixing string.

    Return Value character(len=:), allocatable

    Description.

procedure, public, pass(self) :: destroy

Destroy time.

  • private elemental subroutine destroy(self)

    Destroy time.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

procedure, public, pass(self) :: initialize

Initialize time.

  • private elemental subroutine initialize(self)

    Initialize time.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

procedure, public, pass(self) :: is_the_end

Return true if the end of simulation is reached.

  • private elemental function is_the_end(self) result(yes)

    Return true if the end of simulation is reached.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(in) :: self

    Time object.

    Return Value logical

    Test result.

procedure, public, pass(self) :: load_from_file

Load from file.

  • private subroutine load_from_file(self, fini, go_on_fail)

    Load from file.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

    type(file_ini), intent(in) :: fini

    Simulation parameters ini file handler.

    logical, intent(in), optional :: go_on_fail

    Go on if load fails.

procedure, public, pass(self) :: progress

Return the progress of simulation.

  • private elemental function progress(self) result(prog)

    Return the progress of simulation.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(in) :: self

    Time object.

    Return Value real(kind=R8P)

    Actual progress value.

procedure, public, pass(self) :: save_into_file

Save into file.

  • private subroutine save_into_file(self, fini)

    Save into file.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

    type(file_ini), intent(inout) :: fini

    Simulation parameters ini file handler.

procedure, public, pass(self) :: set_stop

Set simulation stop condition.

  • private elemental subroutine set_stop(self)

    Set simulation stop condition.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

procedure, public, pass(lhs) :: time_assign_time

Operator =.

  • private pure subroutine time_assign_time(lhs, rhs)

    Operator =.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: lhs

    Left hand side.

    type(time_object), intent(in) :: rhs

    Right hand side.

procedure, public, pass(self) :: update

Update time.

  • private elemental subroutine update(self, global_min_dt)

    Update time.

    Arguments

    Type IntentOptional AttributesName
    class(time_object), intent(inout) :: self

    Time object.

    real(kind=R8P), intent(inout) :: global_min_dt

    Global (all processes/images, all blocks) minimum time step.

Source Code

type :: time_object
   !< Time object class.
   !<
   !< Class designed to handle the timing data of the simulation.
   type(error_object) :: error              !< Errors handler.
   logical            :: is_unsteady=.true. !< Type of simulation: unsteady or steady.
   integer(I8P)       :: n=0                !< Time steps counter.
   real(R8P)          :: t=0._R8P           !< Time.
   integer(I8P)       :: n_max=0            !< Maximum number of time steps computed.
   real(R8P)          :: t_max=0._R8P       !< Maximum time of integration, ignored if `n_max>0`.
   real(R8P)          :: CFL=0.3_R8P        !< Courant-Friedrichs-Lewy stability coefficient.
   contains
      ! public methods
      procedure, pass(self) :: description    !< Return a pretty-formatted description of time parameters.
      procedure, pass(self) :: destroy        !< Destroy time.
      procedure, pass(self) :: initialize     !< Initialize time.
      procedure, pass(self) :: is_the_end     !< Return true if the end of simulation is reached.
      procedure, pass(self) :: progress       !< Return the progress of simulation.
      procedure, pass(self) :: load_from_file !< Load from file.
      procedure, pass(self) :: save_into_file !< Save into file.
      procedure, pass(self) :: set_stop       !< Set simulation stop condition.
      procedure, pass(self) :: update         !< Update time.
      ! operators
      generic :: assignment(=) => time_assign_time !< Overload `=`.
      ! private methods
      procedure, pass(lhs) :: time_assign_time !< Operator `=`.
endtype time_object