tem_simControl_load Subroutine

public subroutine tem_simControl_load(me, conf, parent, key, solverAborts)

Load sim control settings from a configuration script.

The sim control should be started beforhand to ensure a sane setting of the current time. The main setting here, is the time_control, which is also attempted to be read directly, if there is no sim_control table provided. Solvers may pass solverAborts to load additional abort criteria that are to be loaded from the configuration.

Arguments

Type IntentOptional Attributes Name
type(tem_simControl_type), intent(inout) :: me

Simulation control parameters to set.

type(flu_State) :: conf

Handle to the configuration script to load the settings from.

integer, intent(in), optional :: parent

Potential parent table, in which the simulation control table is to be found.

character(len=*), optional :: key

Name for the simulation control table. Default is 'sim_control'.

class(tem_solverAborts_type), intent(inout), optional :: solverAborts

Solver specific abort criteria to load.


Calls

proc~~tem_simcontrol_load~~CallsGraph proc~tem_simcontrol_load tem_simControl_load proc~aot_table_open aot_table_open proc~tem_simcontrol_load->proc~aot_table_open proc~tem_addtimer tem_addTimer proc~tem_simcontrol_load->proc~tem_addtimer proc~tem_abortcriteria_new tem_abortCriteria_new proc~tem_simcontrol_load->proc~tem_abortcriteria_new proc~aot_get_val~2 aot_get_val proc~tem_simcontrol_load->proc~aot_get_val~2 proc~tem_timecontrol_load tem_timeControl_load proc~tem_simcontrol_load->proc~tem_timecontrol_load proc~tem_abortcriteria_load tem_abortCriteria_load proc~tem_simcontrol_load->proc~tem_abortcriteria_load proc~aot_table_close aot_table_close proc~tem_simcontrol_load->proc~aot_table_close proc~tem_timecontrol_start_at_sim tem_timeControl_start_at_sim proc~tem_simcontrol_load->proc~tem_timecontrol_start_at_sim interface~append~9 append proc~tem_addtimer->interface~append~9 proc~tem_appendtimers tem_appendTimers proc~tem_addtimer->proc~tem_appendtimers proc~tem_timecontrol_load->proc~aot_table_open proc~tem_timecontrol_load->proc~aot_table_close proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_time_needs_reduce tem_time_needs_reduce proc~tem_timecontrol_load->proc~tem_time_needs_reduce proc~tem_time_never tem_time_never proc~tem_timecontrol_load->proc~tem_time_never proc~aot_get_val aot_get_val proc~tem_timecontrol_load->proc~aot_get_val proc~tem_time_load tem_time_load proc~tem_timecontrol_load->proc~tem_time_load proc~tem_abortcriteria_load->proc~aot_table_open proc~tem_abortcriteria_load->proc~aot_get_val~2 proc~tem_abortcriteria_load->proc~aot_table_close proc~tem_convergence_load tem_convergence_load proc~tem_abortcriteria_load->proc~tem_convergence_load proc~tem_timecontrol_start_at_sim->proc~tem_time_never proc~append_da_label append_da_label interface~append~9->proc~append_da_label proc~append_da_veclabel append_da_veclabel interface~append~9->proc~append_da_veclabel proc~tem_appendtimers->interface~append~9 proc~tem_time_load->proc~aot_table_open proc~tem_time_load->proc~aot_get_val~2 proc~tem_time_load->proc~aot_table_close mpi_wtime mpi_wtime proc~tem_time_load->mpi_wtime proc~tem_convergence_load->proc~aot_table_open proc~tem_convergence_load->proc~aot_table_close proc~tem_horizontalspacer tem_horizontalSpacer proc~tem_convergence_load->proc~tem_horizontalspacer proc~tem_load_convergenceheader tem_load_convergenceHeader proc~tem_convergence_load->proc~tem_load_convergenceheader proc~aot_table_length aot_table_length proc~tem_convergence_load->proc~aot_table_length interface~sortedposofval~5 sortedposofval proc~append_da_label->interface~sortedposofval~5 interface~expand~9 expand proc~append_da_label->interface~expand~9 proc~tem_load_convergenceheader->proc~tem_timecontrol_load proc~tem_load_convergenceheader->proc~aot_table_close proc~tem_load_convergenceheader->proc~aot_get_val proc~upper_to_lower upper_to_lower proc~tem_load_convergenceheader->proc~upper_to_lower proc~tem_load_reduction_spatial tem_load_reduction_spatial proc~tem_load_convergenceheader->proc~tem_load_reduction_spatial interface~tem_load_shape tem_load_shape proc~tem_load_convergenceheader->interface~tem_load_shape proc~tem_load_condition tem_load_condition proc~tem_load_convergenceheader->proc~tem_load_condition proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_load_convergenceheader->proc~tem_timecontrol_dump proc~tem_abort tem_abort proc~tem_load_convergenceheader->proc~tem_abort proc~append_da_veclabel->interface~expand~9

Called by

proc~~tem_simcontrol_load~~CalledByGraph proc~tem_simcontrol_load tem_simControl_load proc~tem_load_general tem_load_general proc~tem_load_general->proc~tem_simcontrol_load

Contents

Source Code


Source Code

  subroutine tem_simControl_load(me, conf, parent, key, solverAborts)
    ! -------------------------------------------------------------------- !
    !> Simulation control parameters to set.
    type(tem_simControl_type), intent(inout) :: me

    !> Handle to the configuration script to load the settings from.
    type(flu_state) :: conf

    !> Potential parent table, in which the simulation control table is to be
    !! found.
    integer, intent(in), optional :: parent

    !> Name for the simulation control table. Default is 'sim_control'.
    character(len=*), optional :: key

    !> Solver specific abort criteria to load.
    class(tem_solverAborts_type), intent(inout), optional :: solverAborts
    ! -------------------------------------------------------------------- !
    character(len=labelLen) :: loc_key
    integer :: thandle
    integer :: iErr
    ! -------------------------------------------------------------------- !

    loc_key = 'sim_control'
    if (present(key)) loc_key = key

    call aot_table_open( L       = conf,    &
      &                  parent  = parent,  &
      &                  thandle = thandle, &
      &                  key     = loc_key  )

    call aot_get_val(L       = conf,           &
      &              thandle = thandle,        &
      &              val     = me%delay_check, &
      &              key     = 'delay_check',  &
      &              default = .false.,        &
      &              ErrCode = iErr            )

    if (thandle /= 0) then
      ! There is a sim control table in the configuration.
      call tem_timeControl_load(me          = me%timeControl, &
        &                       conf        = conf,           &
        &                       parent      = thandle,        &
        &                       delay_check = me%delay_check  )

      call tem_abortCriteria_load( me     = me%abortCriteria,  &
        &                          conf   = conf,              &
        &                          parent = thandle,           &
        &                          solverAborts = solverAborts )
    else
      ! No sim control table found, try to load the time control table itself.
      call tem_timeControl_load(me%timeControl, conf, parent)
      me%abortCriteria = tem_abortCriteria_new()
    end if

    if (me%delay_check) then
      write(logUnit(1),*) 'Delaying status checks by one interval' &
        // '(delay_check=True).'
    end if

    call aot_table_close(L = conf, thandle = thandle)

    ! Overwrite the min of the simulation time range to point to the current
    ! simulation time.
    call tem_timeControl_start_at_sim(me = me%timeControl, now = me%now)

    call tem_addTimer( timerHandle = me%syncUpdate_timer, &
      &                timerName = 'tem_syncUpdate'       )

  end subroutine tem_simControl_load