tem_abortCriteria_load Subroutine

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

Load the abortCriteria from a given configuration.

The abort_critera are defined in a table as follows:

 abort_criteria = {stop_file='', steady_state=false}

stop_file indicates, which file should be checked for to stop the execution. A typical setting would for example be stop_file = 'stop'. If the string is empty, no checks are performed. The default is an empty string. Empty stop files will be deleted after they are encountered. Non-empty ones are kept.

steady_state indicates if the simulation should stop when a steady_state solution is found. Default ist false.

If steady_state is True then load convergence table for condition to check for steady state

Solvers may pass an additional solverAborts for specific abort parameters to be filled from the abort_criteria table.

Arguments

Type IntentOptional Attributes Name
type(tem_abortCriteria_type), intent(out) :: me

Abort criteria to load from the Lua table.

type(flu_State) :: conf

Handle for the Lua script.

integer, intent(in), optional :: parent

Parent table to read from.

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

Name of the time control table. Default: 'time_control'

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

Solver specific abort criteria to load.


Calls

proc~~tem_abortcriteria_load~~CallsGraph proc~tem_abortcriteria_load tem_abortCriteria_load aot_get_val aot_get_val proc~tem_abortcriteria_load->aot_get_val aot_table_close aot_table_close proc~tem_abortcriteria_load->aot_table_close aot_table_open aot_table_open proc~tem_abortcriteria_load->aot_table_open load load proc~tem_abortcriteria_load->load proc~tem_convergence_load tem_convergence_load proc~tem_abortcriteria_load->proc~tem_convergence_load proc~tem_convergence_load->aot_table_close proc~tem_convergence_load->aot_table_open aot_table_length aot_table_length proc~tem_convergence_load->aot_table_length 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~tem_load_convergenceheader->aot_get_val proc~tem_load_convergenceheader->aot_table_close interface~tem_load_shape tem_load_shape proc~tem_load_convergenceheader->interface~tem_load_shape proc~tem_abort tem_abort proc~tem_load_convergenceheader->proc~tem_abort proc~tem_load_condition tem_load_condition proc~tem_load_convergenceheader->proc~tem_load_condition proc~tem_load_reduction_spatial tem_load_reduction_spatial proc~tem_load_convergenceheader->proc~tem_load_reduction_spatial proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_load_convergenceheader->proc~tem_timecontrol_dump proc~tem_timecontrol_load tem_timeControl_load proc~tem_load_convergenceheader->proc~tem_timecontrol_load proc~upper_to_lower upper_to_lower proc~tem_load_convergenceheader->proc~upper_to_lower proc~tem_load_shape_single tem_load_shape_single interface~tem_load_shape->proc~tem_load_shape_single proc~tem_load_shapes tem_load_shapes interface~tem_load_shape->proc~tem_load_shapes mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_load_condition->aot_table_close proc~tem_load_condition->aot_table_open proc~tem_load_condition->aot_table_length proc~tem_load_cond_single tem_load_cond_single proc~tem_load_condition->proc~tem_load_cond_single proc~tem_load_reduction_spatial->aot_table_close proc~tem_load_reduction_spatial->aot_table_open proc~tem_load_reduction_spatial->aot_table_length proc~tem_load_reduction_single tem_load_reduction_single proc~tem_load_reduction_spatial->proc~tem_load_reduction_single proc~tem_time_dump tem_time_dump proc~tem_timecontrol_dump->proc~tem_time_dump proc~tem_timecontrol_load->aot_get_val proc~tem_timecontrol_load->aot_table_close proc~tem_timecontrol_load->aot_table_open proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_time_load tem_time_load proc~tem_timecontrol_load->proc~tem_time_load 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

Called by

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

Source Code

  subroutine tem_abortCriteria_load(me, conf, parent, key, solverAborts)
    ! -------------------------------------------------------------------- !
    !> Abort criteria to load from the Lua table.
    type(tem_abortCriteria_type), intent(out) :: me

    !> Handle for the Lua script.
    type(flu_state) :: conf

    !> Parent table to read from.
    integer, intent(in), optional :: parent

    !> Name of the time control table. Default: 'time_control'
    character(len=*), intent(in), 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 = 'abort_criteria'
    if (present(key)) loc_key = key

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

    if (thandle /= 0) then

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

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

      if (me%steady_state) then
        call tem_convergence_load( me           = me%convergence, &
          &                        conf         = conf,           &
          &                        parent       = thandle,        &
          &                        steady_state = me%steady_state )
      end if

      if (present(solverAborts)) then
        call solverAborts%load( conf        = conf,   &
          &                     abort_table = thandle )
      end if

    else

      me%stop_file = ''
      me%steady_state = .false.

    end if

    ! If no steady state is defined
    if (.not. me%steady_state) allocate(me%convergence(0))

    call aot_table_close( L       = conf,   &
      &                   thandle = thandle )

  end subroutine tem_abortCriteria_load