      Subroutine UnpackTEWord( TEWord, Energy, Time )
* ===================================================
*

*                               Author: A.Kruse
*
      Implicit None
      Integer TEWord, Energy, Time

      Integer Bit1To24
      Parameter (Bit1To24='00FFFFFF'x)
      Integer Bit24
      Parameter (Bit24='00800000'x)
      Integer Bit25To32
      Parameter (Bit25To32='FF000000'x)

      Integer IOr, IAnd, IShft

*
      Energy = IAnd(TEWord,Bit1To24)
      if( IAnd(TEWord,Bit24).ne.0 ) then
         Energy = IOr(Energy,Bit25To32)
      endif
      Time = IShft(TEWord,-24)

      return
      end
