C***********************************************************************
      SUBROUTINE CLEAR_ALPHA(TERMINAL_TYPE)
C
#include "fpreproc/byte_declare.h"
C
C...This routine was written by Harry H. Towner of the Princeton Plasma
C...Physics Lab. This routine will erase the alpha screen and put
C...cursor in the home position. If not in alpha mode a switch to
C...alpha mode will be done.
C
      CHARACTER TERMINAL_TYPE*(*)
C
      byte_declare ictrl_tk(2)
      byte_declare ictrl_vt(10)
C
C      data ictrl_tk/z'1B',z'0C'/
C      data ictrl_vt/z'1B', z'5B', z'32', z'4A', z'1B', z'5B',
C     >              z'31', z'3B', z'31', z'48'/
 
#if __CRAY
      data ictrl_tk/char(27), char(12)/
      data ictrl_vt/char(27), '[', '2', 'J', char(27), '[',
     >              '1', ';', '1', 'H'/
#elif __SX
      data ictrl_tk/'1B'x, '0C'x/
      data ictrl_vt/'1B'x, '[', '2', 'J', '1B'x, '[',
     >              '1', ';', '1', 'H'/
#else
      data ictrl_tk/27,12/
      data ictrl_vt/27, 91, 50, 74, 27, 91, 49, 59, 49, 72/
#endif
C
      if (terminal_type(1:2) .eq. 'TK') then
        call term_out(ictrl_tk, 2)
        call gosleep(2)
      else
        call term_out(ictrl_vt, 10)
      end if
C
      return
      end
 
