Timeloop Derived Type

type, public, extends(Object) :: Timeloop

Object responsible for the main integration loop


Components

Type Visibility Attributes Name Initial
logical, public :: userDefined = .false.

True only if user explicitly sets it to true

integer(kind=ik), private :: modeTimeloop

Loop mode: 0 - fixed step number, 1 - target elapsed time (default 0)

integer(kind=ik), private :: numTimesteps

Fixed step number for loop mode 0

real(kind=rk), private :: targetTime

Target time value for loop mode 1

integer(kind=ik), private :: modeSave

Save mode: 0 - fixed save frequency, 1 - save with minimum time interval

integer(kind=ik), private :: saveSteps

Fixed step number for save mode 0

real(kind=rk), private :: minSaveInterval

Minimum time interval between saves for save mode 1

logical, private :: loadRestart

True if restart files should be loaded at the start of the loop

logical, private :: loadSerial

True if initial values are loaded from a serial file

logical, private :: saveRestart

True if restart files should be saved

logical, private :: resetTimeRestart

True if on loaded restart the time variable (if present) should be reset to 0

integer(kind=ik), private :: restartFrequency

Number of steps between restart saves

character(len=:), private, allocatable :: loadFilename

Serial load filename - default "ReMKiT1DVarInput"

type(VariableContainer), private, allocatable :: bufferVars
type(HDF5Controller), private, allocatable :: inputHDF5Controller

Controller used to input variables


Type-Bound Procedures

procedure, public :: isDefined => isDefinedObject

  • interface

    private pure module function isDefinedObject(this) result(defined)

    Getter for userDefined

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(in) :: this

    Return Value logical

procedure, public :: makeDefined => makeDefinedObject

  • interface

    private pure module subroutine makeDefinedObject(this)

    Set userDefined to .true.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: makeUndefined => makeUndefinedObject

  • interface

    private pure module subroutine makeUndefinedObject(this)

    Set userDefined to .false.

    Arguments

    Type IntentOptional Attributes Name
    class(Object), intent(inout) :: this

procedure, public :: init => initStandardTimeloop

  • interface

    private module subroutine initStandardTimeloop(this, envObj, normObj)

    Initialize timeloop parameters using config file and time normalization from normObj

    Arguments

    Type IntentOptional Attributes Name
    class(Timeloop), intent(inout) :: this
    class(EnvironmentWrapper), intent(inout) :: envObj
    class(Normalization), intent(in) :: normObj

procedure, public :: loop

  • interface

    private module subroutine loop(this, envObj, modellerObj)

    Perform loop based on timeloop parameters and using passed modeller and environment

    Arguments

    Type IntentOptional Attributes Name
    class(Timeloop), intent(inout) :: this
    class(EnvironmentWrapper), intent(inout) :: envObj
    type(Modeller), intent(inout) :: modellerObj