*"$@I=Bj(J $@%l%$%"%&%H(J GTOOL3(GGLAY1)
*
*"$@MzNr(J 90/08/21 $@>B8}(J  $@FX(J
*"$@MzNr(J 93/04/30 $@C]9-??0l(J 
*"     93/04/30 $@C]9-??0l(J  $@%a%bMsDI2C(J gamiras data $@MQ(J
*"     95/05/31 $@C]9-??0l(J  for dcl-5.0
*
*********************************************************************
*"         << $@%l%$%"%&%H(J, $@BjL>I=<((J >>
*********************************************************************
      SUBROUTINE GGLAY1
     I         ( HHEAD )
*
      CHARACTER  HHEAD ( * )*(*)         !" $@%X%C%@!<(J
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC, NED
#else
#include         "gzsize.F"              !" NCC, NDC, NED
#endif
      CHARACTER  HTITL   *(NCC*2)
      CHARACTER  HDSET   *(NCC)
      CHARACTER  HUNIT   *(NCC)
      CHARACTER  HITEM   *(NCC)
      CHARACTER  HUTIM   *4
      CHARACTER  HTIME   *(NCC)
c$$$      CHARACTER  HDATE   *(NCC)
c$$$      CHARACTER  HDATEX  *(NCC)
      CHARACTER  HDATIM  *(NCC*3)
      CHARACTER  HEDIT( NED )*(NCC)
      INTEGER    NHE  ( NED )
      CHARACTER  HFNUM   *(NCC)
      CHARACTER  HDNUM   *(NCC)
      CHARACTER  HAITM   *(NCC)
      CHARACTER  HS      *(NCC)
      CHARACTER  HE      *(NCC)
      CHARACTER  HRAN    *(NCC)
      CHARACTER  HEDS    *(100)
      CHARACTER  HP      *8
      LOGICAL    OLCNTL
      DATA       NDESC / 30 /
*
*"         < 1. $@=i4|2=(J >
*
      CALL GRFRM
      CALL GGAXRS
      CALL GGLTRS
*
      CALL UZPGET( 'RSIZET2', RSIZT2 )
      CALL UZPGET( 'ROFFXT' , ROFFXT )
      IF ( ROFFXT .LT. RSIZT2 ) CALL UZPSET( 'ROFFXT', RSIZT2 )
*
*"         < 2. $@%S%e!<%]!<%H(J($@2>:BI8(J)$@@_Dj(J >
*
      CALL GGPGET ( 'VRATIO' , VRATIO )
      CALL GGPGET ( 'VXMIN'  , VXMIN  )
      CALL GGPGET ( 'VXMAX'  , VXMAX  )
      CALL GGPGET ( 'VYMIN'  , VYMIN  )
      CALL GGPGET ( 'VYMAX'  , VYMAX  )
*
      CALL SGSVPT ( VXMIN, VXMAX , VYMIN , VYMAX )
      CALL SGSWND ( 0.   , 1.    , 0.    , 1.  )
      CALL SGSTRN (1)
      CALL SGSTRF
*
*"         < 3. $@JT=8%?%$%H%k(J >
*
      CALL GHCGET ( HHEAD, 'ITEM',  HITEM    )
      CALL GHCGET ( HHEAD, 'EDIT1', HEDIT(1) )
      CALL GHCGET ( HHEAD, 'EDIT2', HEDIT(2) )
      CALL GHCGET ( HHEAD, 'EDIT3', HEDIT(3) )
      CALL GHCGET ( HHEAD, 'EDIT4', HEDIT(4) )
      CALL GHCGET ( HHEAD, 'EDIT5', HEDIT(5) )
      CALL GHCGET ( HHEAD, 'EDIT6', HEDIT(6) )
      CALL GHCGET ( HHEAD, 'EDIT7', HEDIT(7) )
      CALL GHCGET ( HHEAD, 'EDIT8', HEDIT(8) )
      NHI = LENC( HITEM )
      DO 2100 II = 1, 8
         NHE ( II ) = LENC( HEDIT( II ) )
 2100 CONTINUE
      CALL GHCGET ( HHEAD, 'FNUM', HFNUM    )
      NHFL = LENB( HFNUM )
      NHF  = LENC( HFNUM )
      CALL GHCGET ( HHEAD, 'DNUM', HDNUM    )
      NHDL = LENB( HDNUM )
      NHD  = LENC( HDNUM )
*
      HEDS  =       HITEM(1:NHI)
     &       //' '//HEDIT(1)(1:NHE(1))
     &       //' '//HEDIT(2)(1:NHE(2))
     &       //' '//HEDIT(3)(1:NHE(3))
     &       //' '//HEDIT(4)(1:NHE(4))
     &       //' '//HEDIT(5)(1:NHE(5))
     &       //' '//HEDIT(6)(1:NHE(6))
     &       //' '//HEDIT(7)(1:NHE(7))
     &       //' '//HEDIT(8)(1:NHE(8))
     &       //'#'//HFNUM(NHFL+1:NHF)
     &       //'-'//HDNUM(NHDL+1:NHD)
*
      CALL GGPGET ( 'SEDIT'  , SEDIT )
      CALL UZPSET ( 'RSIZEC2', SEDIT )
*
      CALL SGPGET ( 'LCNTL', OLCNTL  )
      CALL SGPSET ( 'LCNTL', .FALSE. )
      CALL UXMTTL ( 'T', HEDS  , -1. )
      CALL SGPSET ( 'LCNTL', OLCNTL  )
*
*"         < 4. $@%?%$%H%kEy(J >
*
      CALL GHCGTS ( HHEAD, 'TITL',  HTITL  )
      CALL GHCGET ( HHEAD, 'DSET',  HDSET  )
      CALL GHCGET ( HHEAD, 'UNIT',  HUNIT  )
*
      CALL GUQTIM ( HHEAD , RT    , HUTIM  )
      IF ( RT .GT. 9999900.0 ) THEN
         CALL CHVAL  ( 'D'      , RT    , HTIME  )
      ELSE
         CALL CHVAL  ( '(F10.1)', RT    , HTIME  )
      ENDIF
      NHT = LENC( HTIME )
*
      CALL GGPGET ( 'STITL'  , STITL )
      CALL UZPSET ( 'RSIZEC2', STITL )
*
      CALL UZPGET ( 'ROFFXT', ROFF   )
      CALL UXMTTL ( 'T', HUNIT , -1. )
*
      HDATIM = HTIME(1:NHT)//HUTIM
c$$$      CALL GHCGET ( HHEAD, 'DATE',  HDATE  )
c$$$      IF ( HDATE .NE. ' ' ) THEN
c$$$         HDATEX        = ' ' 
c$$$         HDATEX(1:2)   = HDATE(3:4)
c$$$         HDATEX(3:3)   = '/'
c$$$         HDATEX(4:5)   = HDATE(5:6)
c$$$         HDATEX(6:6)   = '/'
c$$$         HDATEX(7:8)   = HDATE(7:8)
c$$$         NHT    = LENC( HDATIM )         
c$$$         HDATIM = HDATIM(1:NHT)//' '//HDATEX
c$$$      ENDIF
      CALL UZPSET ( 'ROFFXT', ROFF   )
      CALL UXMTTL ( 'T', HDATIM,  1. )
*
      CALL UZPGET ( 'ROFFXT', ROFF   )
      CALL UXMTTL ( 'T', HTITL , -1. )
      CALL UZPSET ( 'ROFFXT', ROFF   )
      CALL SGPGET ( 'LCNTL', OLCNTL  )
      CALL SGPSET ( 'LCNTL', .FALSE. )
      CALL UXMTTL ( 'T', HDSET ,  1. )
      CALL SGPSET ( 'LCNTL', OLCNTL  )
*
      CALL UZPSET ( 'ROFFXT' , 0. )
*
*"         < 5. $@$=$N$[$+$N>pJs(J >
*
      VX    = VXMAX + ( 1.-VXMAX ) *0.1 *XRATIO
      VY    = VYMAX
      DVY   = - ( VYMAX-VY0 ) / NDESC
*
      CALL GGPGET ( 'SDESC'  , SDESC )
      IF ( SDESC .LE. 0. ) RETURN
*
      CALL SGSTXS ( SDESC )
      CALL SGSTXC ( -1 )
      CALL SGSTXI ( 1 )
*
      HP = 'ETTL'
      DO 5100 II = 1, 8
         WRITE ( HP(5:5), '(I1)' ) II
         CALL GGCDSC ( HHEAD, HP, VX, VY )
         VY = VY + DVY
 5100 CONTINUE
*
      CALL GGCDSC ( HHEAD, 'DATE', VX, VY )
      VY = VY + DVY
*
      DO 5200 II = 1, 2
         HP = 'AITM'
         WRITE ( HP(5:5), '(I1)' ) II
         CALL GHCGET ( HHEAD, HP, HAITM  )
         CALL SGTXV  ( VX, VY, HAITM  )
         VY = VY + DVY
         IF ( HAITM .NE. ' ' ) THEN
            HP(1:4) = 'ASTR'
            CALL GHCGET ( HHEAD, HP, HS  )
            HP(1:4) = 'AEND'
            CALL GHCGET ( HHEAD, HP, HE  )
            NHSB = LENB( HS )
            NHSC = LENC( HS )
            NHEB = LENB( HE )
            NHEC = LENC( HE )
            HRAN = '('//HS(NHSB+1:NHSC)//','//HE(NHEB+1:NHEC)//')'
            CALL SGTXV  ( VX , VY, HRAN  )
         ENDIF
         VY = VY + DVY
 5200 CONTINUE
*
      CALL GGPDSC ( HHEAD, 'DMIN', VX   , VY    )
      VY = VY + DVY
      CALL GGPDSC ( HHEAD, 'DMAX', VX   , VY    )
      VY = VY + DVY
      CALL GGPDSC ( HHEAD, 'DIVS', VX   , VY    )
      VY = VY + DVY
      CALL GGPDSC ( HHEAD, 'DIVL', VX   , VY    )
      VY = VY + DVY
*
      CALL GGCDSC ( HHEAD, 'MDATE', VX   , VY    )
      VY = VY + DVY
      CALL GGCDSC ( HHEAD, 'MSIGN', VX   , VY    )
      VY = VY + DVY
*
*"         < 6. $@%a%b(J >
*
c$$$      VX    = VXMIN *0.1 *XRATIO
c$$$      VY    = VYMAX
*
      HP = 'MEMO'
      DO 6100 II = 1, 9
         WRITE ( HP(5:5), '(I1)' ) II
         CALL GGCDSC ( HHEAD, HP, VX, VY )
         VY = VY + DVY
 6100 CONTINUE
      HP = 'MEMO10'
      CALL GGCDSC ( HHEAD, HP, VX, VY )
*
      RETURN
      END
