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 Attributes Name
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~init_env init_env proc~tem_start->proc~init_env proc~tem_init_solvehead tem_init_solveHead proc~tem_start->proc~tem_init_solvehead proc~tem_starttimer tem_startTimer proc~tem_start->proc~tem_starttimer proc~tem_addtimer tem_addTimer proc~tem_start->proc~tem_addtimer proc~tem_simcontrol_start tem_simControl_start proc~tem_start->proc~tem_simcontrol_start proc~tem_comm_env_init tem_comm_env_init proc~tem_start->proc~tem_comm_env_init mpi_init mpi_init proc~init_env->mpi_init proc~init_random_seed init_random_seed proc~init_env->proc~init_random_seed mpi_comm_rank mpi_comm_rank proc~init_env->mpi_comm_rank proc~sys_is_little_endian Sys_is_Little_Endian proc~init_env->proc~sys_is_little_endian mpi_wtime mpi_wtime proc~tem_starttimer->mpi_wtime interface~append~9 append proc~tem_addtimer->interface~append~9 proc~tem_appendtimers tem_appendTimers proc~tem_addtimer->proc~tem_appendtimers proc~tem_status_clear tem_status_clear proc~tem_simcontrol_start->proc~tem_status_clear proc~tem_time_reset tem_time_reset proc~tem_simcontrol_start->proc~tem_time_reset proc~tem_comm_env_init->mpi_comm_rank mpi_comm_size mpi_comm_size proc~tem_comm_env_init->mpi_comm_size 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_reset->mpi_wtime interface~sortedposofval~5 sortedposofval proc~append_da_label->interface~sortedposofval~5 interface~expand~9 expand proc~append_da_label->interface~expand~9 proc~append_da_veclabel->interface~expand~9

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