*"$BI=Bj(B $BCO?^Ej1F(B : $B:BI8$N@_Dj(B GTOOL3(GGAXES)
*
*"$BMzNr(B 90/08/16 $B>B8}(B  $BFX(B
*"     95/05/26 $BC]9-??0l(B for dcl-5.z.7
*"     95/05/31 $BC]9-??0l(B $B6K:BI8(B tickmark $B$r$D$1$k(B. 
*"     95/06/05 $BC]9-??0l(B for dcl-5.z.13
*"     95/11/01 $BC]9-??0l(B $BCO?^6-3&(B clipping 
*"     96/01/10 $BC]9-??0l(B minor $B=$@5(B
*"     97/12/01 $BC]9-??0l(B SET -> STX
*
*********************************************************************
*"         << $B<4$N%;%C%H(B $BCO?^Ej1F(B >>
*********************************************************************
      SUBROUTINE GGAXES
     I         ( HHEAD )
*
      CHARACTER  HHEAD ( * )*(*)         !" $B%X%C%@!<(B
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
      INCLUDE    (GZIWRK)                !" NW: $B<4%o!<%/$NBg$-$5(B
#else
#include         "gzsize.F"              !" NCC, NDC
#include         "gziwrk.F"              !" NW: $B<4%o!<%/$NBg$-$5(B
#endif
      CHARACTER  HHEADX( NDC )*(NCC)     !" X $B<4%U%!%$%k$N%X%C%@!<(B
      CHARACTER  HHEADY( NDC )*(NCC)     !" Y $B<4%U%!%$%k$N%X%C%@!<(B
      REAL       AXISX ( NW )            !" X $B:BI8CM(B
      REAL       AXISY ( NW )            !" Y $B:BI8CM(B
      LOGICAL    OSUBCK
*
      REAL       XMIN, XMAX, YMIN, YMAX    !" $BIA2hMQJQ?t(B
      REAL       RADI                      !" NC $B>e$NCO5eH>7B(B
*
      INTEGER    IPRJ                      !" $BEj1FK!(B
      REAL       ALAT, ALON                !" $BEj1FCf?40^EY79EY(B
      REAL       ROTA                      !" $B2sE>(B
      REAL       SIMFAC                    !" $BEj1F3HBgN((B
      CHARACTER  HPOS*30, HLAT*8, HLON*8
*
*"         < 1. $B<4%U%!%$%k$NFI$_9~$_(B >
*
      CALL GTPGET ( 'SUBCHK', OSUBCK )
      CALL GTSIZE ( HHEADX  ,  NW     )
      CALL GTSIZE ( HHEADY  ,  NW     )
      CALL GUQAXV
     I            ( HHEAD , 1     , 'LOC' ,
     O              HHEADX, AXISX , IEOD   )
      CALL GUQAXV
     I            ( HHEAD , 2     , 'LOC' ,
     O              HHEADY, AXISY , IEOD   )
      CALL GTPSET ( 'SUBCHK', OSUBCK )
*
*"         < 2. $BHO0O(B >
*
      CALL GHPGET ( HHEAD , 'ASTR1', IXSTR )
      CALL GHPGET ( HHEAD , 'AEND1', IXEND )
      CALL GHPGET ( HHEAD , 'ASTR2', IYSTR )
      CALL GHPGET ( HHEAD , 'AEND2', IYEND )
*
*"         < 3. $B:BI8$N@_Dj(B >
*
      CALL GGPGET( 'MAPPRJ', IPRJ )
*
      IF( IPRJ .EQ. 0 )THEN                     !" $BCO?^Ej1F$7$J$$(B <<X-Y>>
         CALL GGAXSZ
     I     ( HHEADX, AXISX , 'X'   )
         CALL GGAXSZ
     I     ( HHEADY, AXISY , 'Y'   )
      ENDIF
*
      CALL UWSGXA ( AXISX, IXEND-IXSTR+1 )
      CALL UWSGYA ( AXISY, IYEND-IYSTR+1 )
*
      IF( IPRJ .EQ. 0 ) RETURN                  !" $BCO?^Ej1F$7$J$$(B <<X-Y>>
*
*
*"         < 4. $BCO?^IA2h@_Dj(B >
*
      CALL GGPGET( 'MAPLON', ALON )
      CALL GGPGET( 'MAPLAT', ALAT )
      CALL GGPGET( 'MAPROT', ROTA )
      CALL GGPGET( 'MAPFAC', SIMFAC )
*
      CALL GGPGET( 'VXMIN', XMIN )
      CALL GGPGET( 'VXMAX', XMAX )
      CALL GGPGET( 'VYMIN', YMIN )
      CALL GGPGET( 'VYMAX', YMAX )
*
      IF( ( 5 .LE. IPRJ ) .AND. ( IPRJ .LE. 6 ) )THEN
         CALL GHPGET ( HHEADX , 'DMAX' , RADW )          !" $BF07B:GBgCM(B
         RADI = MIN( XMAX-XMIN, YMAX-YMIN ) / 2. * SIMFAC / RADW
      ENDIF
*
      CALL SGPSTX('LDEG',  .TRUE.)    !" $B3QEYC10L(B
      CALL SGPSTX('LLNINT',.TRUE.)
      CALL SGPSTX('LGCINT',.TRUE.)
      CALL SGPSTX('STLAT1', 45.0 )
      CALL SGPSTX('STLAT2', 30.0 )
*
      CALL SGSVPT( XMIN, XMAX, YMIN, YMAX )
*
      IF( ( 5 .LE. IPRJ ) .AND. ( IPRJ .LE. 6 ) )THEN
         CALL SGSSIM( RADI, 0., 0. )
         CALL SGSTRN(IPRJ)
         CALL SGSTRF
      ELSE IF( ( 10 .LE. IPRJ ) .AND. ( IPRJ .LE. 15 ) )THEN
         CALL GRSTRN(IPRJ)
         CALL UMSCNT( ALON, ALAT, ROT )
         CALL UMLSTX('LGLOBE', .TRUE. )
         CALL UMPFIT
         CALL GRSTRF
      ELSE IF( ( 20 .LE. IPRJ ) .AND. ( IPRJ .LE. 23 ) )THEN
         CALL GRSTRN(IPRJ)
         CALL UMSCNT( ALON, ALAT, ROT )
         CALL UMLSTX('LGLOBE', .TRUE. )
         CALL UMPFIT
         CALL GRSTRF
      ELSE IF( ( 30 .LE. IPRJ ) .AND. ( IPRJ .LE. 33 ) )THEN
         CALL GRSTRN(IPRJ)
         CALL UMSCNT( ALON, ALAT, ROT )
         CALL UMLSTX('LGLOBE', .TRUE. )
         CALL UMPFIT
         CALL GRSTRF
      ENDIF
*
*"         < 5. $BEj1FCf?40LCV$NI=<((B > 
*
      CALL GGPGET( 'SEDIT' , SEDIT )
*
      CALL CHVAL( '(F6.1)', ALON, HLON )
      IHLON = LENC( HLON )
      CALL CHVAL( '(F5.1)', ALAT, HLAT )
      IHLAT = LENC( HLAT )
      HPOS = '(lon,lat)=(' // HLON(1:IHLON) // ', '
     &                              // HLAT(1:IHLAT) // ')'
      IHPOS = LENC(HPOS)
*
      XP = ( XMIN + XMAX ) / 2
      YP = YMIN - SEDIT * 1.2
      CALL SGTXZV( XP , YP , HPOS(1:IHPOS), SEDIT, 0, 0, 3 )
*
*"         < 6. $BIA2h6-3&@~(B > 
*
      IF( ( 5 .LE. IPRJ ) .AND. ( IPRJ .LE. 6 ) )THEN
         CALL PORAXZ
     I          ( HHEADX , AXISX ,
     I            HHEADY , AXISY   )
      ELSE IF( ( 10 .LE. IPRJ ) .AND. ( IPRJ .LE. 33 ) )THEN
         CALL SGPSTX( 'LCLIP', .TRUE. )
         CALL UMPLIM
         CALL SGPSTX( 'LCLIP', .FALSE. )
      ENDIF
*
      RETURN
      END
**********************************************************************
      SUBROUTINE PORAXZ                  !" $B30OH0O$_(B($B6K:BI8(B)
     I             ( HHEADX , AXISX ,
     I               HHEADY , AXISY   )
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
#else
#include         "gzsize.F"              !" NCC, NDC
#endif
*
      CHARACTER  HHEADX( NDC )*(NCC)     !" $BF07B<4%X%C%@!<%U%!%$%k(B
      CHARACTER  HHEADY( NDC )*(NCC)     !" $BJ}0L3Q<4%X%C%@!<%U%!%$%k(B
      CHARACTER  HDSETY*(NCC)
*
      REAL       AXISX(*)                !" X $B:BI8CM(B
      REAL       AXISY(*)                !" Y $B:BI8CM(B
*
      REAL       RSIZE                   !" $B:BI8L\@9$ND9$5(B(V $B:BI8(B)
*
      PARAMETER ( N = 5 )
      REAL  X(N) , Y(N)
*
      CALL GHPGET ( HHEADX, 'ASTR1', IXSTR )
      CALL GHPGET ( HHEADX, 'AEND1', IXEND )
      CALL GHPGET ( HHEADY, 'ASTR1', IYSTR )
      CALL GHPGET ( HHEADY, 'AEND1', IYEND )
*
      CALL GHPGET ( HHEADX , 'DMIN' , DMINX )
      CALL GHPGET ( HHEADX , 'DMAX' , DMAXX )
      CALL GHPGET ( HHEADY , 'DMIN' , DMINY )
      CALL GHPGET ( HHEADY , 'DMAX' , DMAXY )
*
      CALL GHCGET ( HHEADY , 'DSET' , HDSETY )
*
      CALL UZRGET('RSIZET1',RSIZE)
      CALL STFTRF( DMINX, DMINY, VX, VY )
      CALL STFTRF( DMINX+1.0, DMINY, VXP, VYP )
      RTICKX = 1.0 * ABS( RSIZE )/ SQRT( (VXP-VX)**2 + (VYP-VY)**2 )
      CALL STFTRF( DMINX, DMINY+1.0, VXP, VYP )
      RTICKY = 1.0 * ABS( RSIZE )/ SQRT( (VXP-VX)**2 + (VYP-VY)**2 )
*
      IF ( HDSETY(1:1) .EQ. 'C' )THEN
         DO 100 I = 1, N
            X(I) = DMINX
            Y(I) = ( DMAXY - DMINY ) / REAL(N-1) * (I-1)
 100     CONTINUE 
         CALL SGPLZU( N, X, Y, 1, 3 )
*     
         DO 110 I = 1, N
            X(I) = DMAXX
            Y(I) = ( DMAXY - DMINY ) / REAL(N-1) * (I-1)
 110     CONTINUE 
         CALL SGPLZU( N, X, Y, 1, 3 )
*
         DO 120 I=1, IYEND-IYSTR+1
            CALL SZLNZU(DMAXX,AXISY(I),DMAXX-RTICKX, AXISY(I) )
            CALL SZLNZU(DMINX,AXISY(I),DMINX+RTICKX, AXISY(I) )
 120     CONTINUE 
*
         DO 130 I=1, IXEND-IXSTR+1
            CALL SZLNZU(AXISX(I),DMINY,AXISX(I),DMINY+RTICKY)
 130     CONTINUE 
      ELSE
         X(1) = DMINX
         Y(1) = DMINY
*
         X(2) = DMINX
         Y(2) = DMAXY
*
         X(3) = DMAXX
         Y(3) = DMAXY
*
         X(4) = DMAXX
         Y(4) = DMINY
*
         X(5) = X(1)
         Y(5) = Y(1)
*
         CALL SGPLZU( N, X, Y, 1, 3 )

         DO 140 I=1, IYEND-IYSTR+1
            CALL SZLNZU(DMAXX,AXISY(I),DMAXX-RTICKX , AXISY(I) )
            CALL SZLNZU(DMINX,AXISY(I),DMINX+RTICKX , AXISY(I) )
 140     CONTINUE 
*
         RTICK = (DMAXY - DMINY) / (IYEND-IYSTR+1)
         DO 150 I=1, IXEND-IXSTR+1
            CALL SZLNZU(AXISX(I),DMAXY,AXISX(I),DMAXY-RTICKY)
            CALL SZLNZU(AXISX(I),DMINY,AXISX(I),DMINY+RTICKY)
 150     CONTINUE 
      ENDIF
*     
      RETURN
      END
