      subroutine showph (rec, line)

      character*(*) rec, line

      include 'basics.inc'
      
c piphas array upped to 0:150 from 0:100 - Oct 28th 2004

      common /piphas2/ piphas(0:150)
      character*7 piphas

      character*5 reshow
      character*2 chival0

c      call putout (mout, rec)

c identification of phase by station operator

      line(17:17) = rec(37:37)         ! component
      line(18:18) = rec(35:35)         ! first motion direction
      line(19:19) = rec(38:38)         ! e/i
      line(20:27) = rec(16:23)         ! op id

      if (rec(11:12) .ne. '99') then
        line(36:46) =
     2     rec(3:4)//':'//rec(5:6)//':'//rec(7:8)//'.'//rec(9:10)
        call exchange (line(36:46), ' ', '0')
      end if

c Residual from station operator's identification

      line(47:51) = reshow (rec(24:27))

c ISC identification of phase
      noph = itch(rec(28:30), ier)
      if (ier .ne. 3)
     2          call abort ('Bad phase number '//rec(28:30))
     
c piphas upped to 0:150 from 0:100 - Oct 28th 2004
     
      if (noph .ge. 0 .and. noph .le. 150) then
        line(28:34) = piphas(noph)

c ISC residual

        line(52:56) = reshow (rec(31:34))
      else if (noph .eq. 999) then
      else
        call abort ('Unusual phase number '//rec(28:30))
      end if
c     line(61:79) = rec(40:60)
      if (rec(40:42) .ne. ' ' .and. rec(43:44) .ne. '99') then
        line(58:) = 'LogA/T='//rec(40:41)//'.'//rec(42:42)
      else if (rec(51:52) .ne. '99') then
        iexp = itch(rec(49:50), ier)
        ip = itch(rec(51:52), ier)

c if the precision is a suitable value then print out
c     the amplitude and period

        if (ip .eq. 0 .or. ip .eq. 3) line(58:) =
     2             'A'//rec(45:45)//'.'//rec(46:47)
     2             //'E'//chival0(iexp+ip)
     2             //' T'//rec(53:55)//'.'//rec(56:56)
      end if
      call putout (mout, line(:len_trim(line)))
      return
      end
