tem_start Subroutine

public subroutine tem_start(codeName, 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

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


Source Code

  subroutine tem_start(codeName, general, comm, simControl)
    ! ----------------------------------------------------------------------
    !> name of code
    character(len=*), intent(in) :: codeName
    !> 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        )

    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