tem_timeformatter_init Function

public function tem_timeformatter_init(timeform, stamp) result(formatter)

Reading a timeformatter description from a Lua script given by conf.

Initializing a timeformatter * timeform defines the formatting string to be used for the timestamp this defaults to default_form * stamp defines the routine to use for the timestamp generation and defaults to tem_timeformatter_sim_stamp

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: timeform
procedure(timestamp), optional :: stamp

Return Value type(tem_timeformatter_type)


Source Code

  function tem_timeformatter_init(timeform, stamp) result(formatter)
    character(len=*), optional, intent(in) :: timeform
    procedure(timestamp), optional :: stamp
    type(tem_timeformatter_type) :: formatter

    if (present(timeform)) then
      formatter%timeform = timeform
    else
      formatter%timeform = default_form
    end if

    if (present(stamp)) then
      formatter%stamp => stamp
    else
      formatter%stamp => tem_timeformatter_sim_stamp
    end if

  end function tem_timeformatter_init