tem_start Subroutine

public subroutine tem_start(codeName, version, general, comm, simControl)

Initialize the environment. Should be the very first call in the program.

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: codeName

name of code

character(len=*), intent(in) :: version

version of the code

type(tem_general_type), intent(out) :: general

encapsulates global parameters which are common for all solvers

integer, intent(in), optional :: comm

mpi communicator if it is predefined as in apesmate

type(tem_simControl_type), intent(out), optional :: simControl

simulation control to initialize


Calls

proc~~tem_start~~CallsGraph proc~tem_start tem_start proc~tem_init_solvehead tem_init_solveHead proc~tem_start->proc~tem_init_solvehead proc~tem_comm_env_init tem_comm_env_init proc~tem_start->proc~tem_comm_env_init proc~tem_simcontrol_start tem_simControl_start proc~tem_start->proc~tem_simcontrol_start proc~tem_addtimer tem_addTimer proc~tem_start->proc~tem_addtimer proc~tem_starttimer tem_startTimer proc~tem_start->proc~tem_starttimer proc~init_env init_env proc~tem_start->proc~init_env mpi_comm_rank mpi_comm_rank proc~tem_comm_env_init->mpi_comm_rank mpi_comm_size mpi_comm_size proc~tem_comm_env_init->mpi_comm_size proc~tem_time_reset tem_time_reset proc~tem_simcontrol_start->proc~tem_time_reset proc~tem_status_clear tem_status_clear proc~tem_simcontrol_start->proc~tem_status_clear interface~append~13 append proc~tem_addtimer->interface~append~13 proc~tem_appendtimers tem_appendTimers proc~tem_addtimer->proc~tem_appendtimers mpi_wtime mpi_wtime proc~tem_starttimer->mpi_wtime proc~init_env->mpi_comm_rank proc~init_random_seed init_random_seed proc~init_env->proc~init_random_seed proc~sys_is_little_endian Sys_is_Little_Endian proc~init_env->proc~sys_is_little_endian mpi_init mpi_init proc~init_env->mpi_init proc~tem_time_reset->mpi_wtime proc~append_da_label append_da_label interface~append~13->proc~append_da_label proc~append_da_veclabel append_da_veclabel interface~append~13->proc~append_da_veclabel proc~tem_appendtimers->interface~append~13 interface~sortedposofval~5 sortedposofval proc~append_da_label->interface~sortedposofval~5 interface~expand~11 expand proc~append_da_label->interface~expand~11 proc~append_da_veclabel->interface~expand~11

Called by

proc~~tem_start~~CalledByGraph proc~tem_start tem_start proc~load_env load_env proc~load_env->proc~tem_start program~tem_sparta_test tem_sparta_test program~tem_sparta_test->proc~tem_start proc~check_serial_multilevel_facedesc check_serial_multilevel_faceDesc proc~check_serial_multilevel_facedesc->proc~tem_start program~bin_search_test bin_search_test program~bin_search_test->proc~tem_start 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 program~tem_face_test tem_face_test program~tem_face_test->proc~check_parallel_singlelevel_facedesc program~tem_face_test~2 tem_face_test program~tem_face_test~2->proc~check_serial_singlelevel_facedesc program~tem_logical_opertor_test tem_logical_opertor_test program~tem_logical_opertor_test->proc~check_variableoperations

Contents

Source Code


Source Code

  subroutine tem_start(codeName, version, general, comm, simControl)
    ! ----------------------------------------------------------------------
    !> name of code
    character(len=*), intent(in) :: codeName
    !> version of the code
    character(len=*), intent(in) :: version
    !> encapsulates global parameters which are common for all solvers
    type(tem_general_type), intent(out) :: general
    !> mpi communicator if it is predefined as in apesmate
    integer, intent(in), optional :: comm
    !> simulation control to initialize
    type(tem_simControl_type), intent(out), optional :: simControl
    ! ----------------------------------------------------------------------
    integer :: nProcs, nThreads
    ! ----------------------------------------------------------------------

    ! Initialize all logunits to point to the stdout unit.
    logunit = stdoutunit

    ! if comm is present initialize environment already called
    ! so should not be called again
    if(.not. present(comm)) call init_env()

    ! initialize mpi environment
    call tem_comm_env_init(general%proc, comm)
    nProcs   = general%proc%comm_size
    nThreads = general%proc%nThreads

    ! initialize solverHead
    call tem_init_solveHead( me      = general%solver, &
      &                      solName = codeName,       &
      &                      version = version         )

    if (present(simControl)) call tem_simControl_start(simControl)

    if ( general%proc%isRoot ) then
      write(logUnit(1),*) "Starting up " // trim(codeName) &
        &                 // " with nprocs: ", nProcs
      !$ write(logUnit(1),*)"               and nThreads pp: ", nThreads
    end if

    call tem_addTimer( timerHandle = general%solver%timerHandle, &
      &                timerName   = trim(codeName)              )
    call tem_startTimer(timerHandle = general%solver%timerHandle )

  end subroutine tem_start