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 AttributesName
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 proc~aot_table_open aot_table_open proc~tem_abortcriteria_load->proc~aot_table_open proc~tem_convergence_load tem_convergence_load proc~tem_abortcriteria_load->proc~tem_convergence_load proc~aot_table_close aot_table_close proc~tem_abortcriteria_load->proc~aot_table_close interface~aot_get_val~2 aot_get_val proc~tem_abortcriteria_load->interface~aot_get_val~2 proc~tem_convergence_load->proc~aot_table_open proc~tem_convergence_load->proc~aot_table_close proc~aot_table_length aot_table_length proc~tem_convergence_load->proc~aot_table_length proc~tem_load_convergenceheader tem_load_convergenceHeader proc~tem_convergence_load->proc~tem_load_convergenceheader proc~tem_horizontalspacer tem_horizontalSpacer proc~tem_convergence_load->proc~tem_horizontalspacer proc~tem_load_convergenceheader->proc~aot_table_close interface~tem_load_shape tem_load_shape proc~tem_load_convergenceheader->interface~tem_load_shape proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_load_convergenceheader->proc~tem_timecontrol_dump proc~tem_load_condition tem_load_condition proc~tem_load_convergenceheader->proc~tem_load_condition proc~upper_to_lower upper_to_lower proc~tem_load_convergenceheader->proc~upper_to_lower proc~tem_abort tem_abort proc~tem_load_convergenceheader->proc~tem_abort proc~tem_load_reduction_spatial tem_load_reduction_spatial proc~tem_load_convergenceheader->proc~tem_load_reduction_spatial proc~tem_timecontrol_load tem_timeControl_load proc~tem_load_convergenceheader->proc~tem_timecontrol_load interface~aot_get_val aot_get_val proc~tem_load_convergenceheader->interface~aot_get_val proc~tem_load_shapes tem_load_shapes interface~tem_load_shape->proc~tem_load_shapes proc~tem_load_shape_single tem_load_shape_single interface~tem_load_shape->proc~tem_load_shape_single proc~tem_time_dump tem_time_dump proc~tem_timecontrol_dump->proc~tem_time_dump proc~tem_load_condition->proc~aot_table_open proc~tem_load_condition->proc~aot_table_close proc~tem_load_condition->proc~aot_table_length proc~tem_load_cond_single tem_load_cond_single proc~tem_load_condition->proc~tem_load_cond_single mpi_abort mpi_abort proc~tem_abort->mpi_abort proc~tem_load_reduction_spatial->proc~aot_table_open proc~tem_load_reduction_spatial->proc~aot_table_close proc~tem_load_reduction_spatial->proc~aot_table_length proc~tem_load_reduction_single tem_load_reduction_single proc~tem_load_reduction_spatial->proc~tem_load_reduction_single proc~tem_timecontrol_load->proc~aot_table_open proc~tem_timecontrol_load->proc~aot_table_close proc~tem_timecontrol_load->interface~aot_get_val 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 proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero

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 proc~load_env load_env proc~load_env->proc~tem_load_general proc~check_serial_multilevel_facedesc check_serial_multilevel_faceDesc proc~check_serial_multilevel_facedesc->proc~tem_load_general program~tem_spacetime_fun_test tem_spacetime_fun_test program~tem_spacetime_fun_test->proc~load_env program~tem_variable_evaltype_test tem_variable_evaltype_test program~tem_variable_evaltype_test->proc~load_env program~tem_varsys_stfunvar_test tem_varSys_stfunVar_test program~tem_varsys_stfunvar_test->proc~load_env program~tem_varsys_derivevar_test tem_varSys_deriveVar_test program~tem_varsys_derivevar_test->proc~load_env proc~check_serial_singlelevel_facedesc check_serial_singlelevel_faceDesc proc~check_serial_singlelevel_facedesc->proc~load_env program~tem_variable_extract_test tem_variable_extract_test program~tem_variable_extract_test->proc~load_env program~tem_varsys_statevar_test tem_varSys_stateVar_test program~tem_varsys_statevar_test->proc~load_env proc~check_parallel_singlelevel_facedesc check_parallel_singlelevel_faceDesc proc~check_parallel_singlelevel_facedesc->proc~load_env proc~check_variableoperations check_variableOperations proc~check_variableoperations->proc~load_env program~tem_varsys_test tem_varSys_test program~tem_varsys_test->proc~load_env program~tem_variable_combine_test tem_variable_combine_Test program~tem_variable_combine_test->proc~load_env program~tem_face_test~3 tem_face_test program~tem_face_test~3->proc~check_serial_multilevel_facedesc program~tem_varsys_opvar_test tem_varSys_opVar_test program~tem_varsys_opvar_test->proc~load_env

Contents


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