tem_abort Subroutine

public subroutine tem_abort(errorMsg)

Abort the program with finalization of the environment

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: errorMsg

An optional error message to print a reason for the abort.


Source Code

  subroutine tem_abort( errorMsg )
    ! -------------------------------------------------------------------- !
    !> An optional error message to print a reason for the abort.
    character(len=*), intent(in), optional :: errorMsg
    ! -------------------------------------------------------------------- !
    integer :: iError
    ! -------------------------------------------------------------------- !

    ! @todo JZ: commented out the the tem_finalize here: In case that one rank
    ! while the other ranks are still waiting for communication the solver
    ! will not terminate.
    !call tem_finalize()
    if( present( errorMsg ) ) write(logUnit(1),*) errorMsg
    write(logUnit(1),*)
    write(logUnit(1),*) " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    write(logUnit(1),*) "               Aborting. "
    write(logUnit(1),*) " !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    write(logUnit(1),*)
    flush(logUnit(1))
    call mpi_abort(MPI_COMM_WORLD, 1, iError)

  end subroutine tem_abort