MODULE ABORT_TRANS_MOD
CONTAINS
SUBROUTINE ABORT_TRANS(CDTEXT)

USE TPM_GEN  , ONLY : NOUT,NERR
USE TPM_DISTR, ONLY : NPROC,MYPROC
!USE MPL_MODULE, ONLY : MPL_ABORT   ! MPL 1.12.08
USE SDL_MODULE, ONLY : SDL_TRACEBACK, SDL_SRLABORT

IMPLICIT NONE


CHARACTER(LEN=*),INTENT(IN) :: CDTEXT

WRITE(NOUT,'(1X,A)') 'ABORT_TRANS CALLED'

WRITE(NOUT,'(1X,A)') CDTEXT
WRITE(NERR,'(1X,A,1X,I3,1X,A)') 'ABORT! ',MYPROC,CDTEXT
CLOSE(NOUT)
IF (NPROC > 1) THEN
! CALL MPL_ABORT(CDTEXT)  ! MPL 1.12.08
  CALL ABOR1('DANS ABORT_TRANS_MOD')
ELSE
  CALL SDL_TRACEBACK
  CALL FLUSH(0)
  CALL SDL_SRLABORT
ENDIF

END SUBROUTINE ABORT_TRANS
END MODULE ABORT_TRANS_MOD
