*"表題 ベクトル描画 GTOOL3(GGVECT)
*
*"履歴 90/08/17 沼口  敦
*"     90/10/17 沼口  敦
*"     95/05/31 竹広真一 for dcl-5.0
*"     97/12/01 竹広真一 UGPSET -> UGPSTX
*
*********************************************************************
*"         << ベクトル描画 >>
*********************************************************************
      SUBROUTINE GGVECT
     I         ( HHEADU, GDATAU,
     I           HHEADV, GDATAV )
*
      CHARACTER  HHEADU ( * )*(*)        !" ヘッダー(u成分)
      CHARACTER  HHEADV ( * )*(*)        !" ヘッダー(v成分)
      REAL       GDATAU ( * )            !" データ(u成分)
      REAL       GDATAV ( * )            !" データ(v成分)
*
      LOGICAL    OUNIT
      LOGICAL    OEQRAT
*
      CALL GUSMIS ( HHEADU )
*
      CALL GUQSIZ
     I         ( HHEADU,
     O           IXSTR , IXEND , IXDIM ,
     O           IYSTR , IYEND , IYDIM ,
     O           IZSTR , IZEND , IZDIM  )
*
      CALL GHPGET ( HHEADU, 'MISS' , UMISS  )
      CALL GHPGET ( HHEADU, 'DMIN' , UMIN   )
      CALL GHPGET ( HHEADU, 'DMAX' , UMAX   )
      CALL GHPGET ( HHEADU, 'STYP' , ISTYPU )
*
      CALL GHPGET ( HHEADV, 'MISS' , VMISS  )
      CALL GHPGET ( HHEADV, 'DMIN' , VMIN   )
      CALL GHPGET ( HHEADV, 'DMAX' , VMAX   )
      CALL GHPGET ( HHEADV, 'STYP' , ISTYPV )
*
      CALL GGPGET ( 'VXINT'  , IXINT )
      CALL GGPGET ( 'VYINT'  , IYINT )
      CALL UGPSTX ( 'IXINT'  , IXINT )
      CALL UGPSTX ( 'IYINT'  , IYINT )
*
      CALL GGPGET ( 'LUNIT'  , OUNIT   )
      CALL UGPSTX ( 'LUNIT'  , OUNIT   )
      CALL GGPGET ( 'VXULOC' , VXULOC  )
      CALL GGPGET ( 'VYULOC' , VYULOC  )
      CALL UGPSTX ( 'VXULOC' , VXULOC  )
      CALL UGPSTX ( 'VYULOC' , VYULOC  )
      CALL GGPGET ( 'SREMK'  , SREMK   )
      CALL UGPSTX ( 'RSIZET' , SREMK   )
      CALL UGPSTX ( 'RSIZEUT', SREMK   )
*
      CALL GGPGET ( 'LEQRAT' , OEQRAT  )
      CALL UGPSTX ( 'LEQRAT' , OEQRAT  )
      CALL UGPSTX ( 'LNRMAL' , .FALSE. )
*
      CALL GGPGET ( 'VECFCT' , VECFCT )
*
      CALL SGQVPT ( VXMIN , VXMAX , VYMIN , VYMAX )
*
      IF ( UMIN .EQ. UMISS ) UMIN = RMIN( GDATAU, IXDIM*IYDIM, 1 )
      IF ( UMAX .EQ. UMISS ) UMAX = RMAX( GDATAU, IXDIM*IYDIM, 1 )
      AUMAX = MAX( ABS( UMIN ), ABS( UMAX ) )
      XFACT = VECFCT/AUMAX
     &        * ( VXMAX-VXMIN )/MAX( 1,IXDIM-1 ) * IXINT
      XFACT = RGNLE ( XFACT )
*
      IF ( VMIN .EQ. VMISS ) VMIN = RMIN( GDATAV, IXDIM*IYDIM, 1 )
      IF ( VMAX .EQ. VMISS ) VMAX = RMAX( GDATAV, IXDIM*IYDIM, 1 )
      AVMAX = MAX( ABS( VMIN ), ABS( VMAX ) )
      YFACT = VECFCT/AVMAX
     &        * ( VYMAX-VYMIN )/MAX( 1,IYDIM-1 ) * IYINT
      YFACT = RGNLE ( YFACT )
*
      IF ( OEQRAT ) THEN
         XFACT = MIN( XFACT, YFACT )
         YFACT = XFACT
      ENDIF
      IF ( ISTYPU .LT. 0 ) XFACT = - XFACT
      IF ( ISTYPV .LT. 0 ) YFACT = - YFACT
*
      CALL UGPSTX ( 'XFACT1', XFACT )
      CALL UGPSTX ( 'YFACT1', YFACT )
*
      CALL UGVECT ( GDATAU, IXEND-IXSTR+1,
     &              GDATAV, IXEND-IXSTR+1,
     &              IXEND-IXSTR+1, IYEND-IYSTR+1 )
*
      RETURN
      END
