*"表題 第１次元と第２次元を交換 GTOOL3(GPEYXZ)
*
*"履歴 90/12/20 沼口  敦
*
*
*********************************************************************
*"         << 第１次元と第２次元を交換 >>
*********************************************************************
      SUBROUTINE GPEYXZ
     I         ( HHEAD , GDATA ,
     I           HEDIT , HETTL ,
     O           HHEADO, GDATAO  )
*
      CHARACTER  HHEAD  ( * )*(*)        !" ヘッダー(入力)
      REAL       GDATA  ( * )            !" データ(入力)
      CHARACTER  HEDIT       *(*)        !" 編集略記号
      CHARACTER  HETTL       *(*)        !" 編集タイトル
      CHARACTER  HHEADO ( * )*(*)        !" ヘッダー(出力)
      REAL       GDATAO ( * )            !" データ(出力)
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
#else
#include         "gzsize.F"              !" NCC, NDC
#endif
      CHARACTER  HAXIS1      *(NCC)      !" 軸名称
      CHARACTER  HAXIS2      *(NCC)      !" 軸名称
*
*"         < 1. 大きさの取得 >
*
      CALL GUSMIS ( HHEAD )
*
      CALL GUQSIZ
     I         ( HHEAD ,
     O           IXSTR , IXEND , IXDIM ,
     O           IYSTR , IYEND , IYDIM ,
     O           IZSTR , IZEND , IZDIM  )
*
      CALL GUSZCK ( HHEADO, IXDIM*IYDIM*IZDIM )
*
*"         < 2. データ詰め替え >
*
      DO 2100 IZ = 1, IZDIM
         DO 2100 IY = 1, IYDIM
            CALL VRSET
     I         ( GDATA ( IXDIM*IYDIM*(IZ-1)+IXDIM*(IY-1)+1  ),
     O           GDATAO( IXDIM*IYDIM*(IZ-1)             +IY ),
     I           IXDIM, 1     , IYDIM                          )
 2100 CONTINUE
*
*"         < 3. ヘッダー変更 >
*
      CALL GHCOPY ( HHEAD, HHEADO )
      CALL GHPSET ( HHEADO, 'ASTR1', IYSTR  )
      CALL GHPSET ( HHEADO, 'AEND1', IYEND  )
      CALL GHPSET ( HHEADO, 'ASTR2', IXSTR  )
      CALL GHPSET ( HHEADO, 'AEND2', IXEND  )
      CALL GHCGET ( HHEADO, 'AITM1', HAXIS1 )
      CALL GHCGET ( HHEADO, 'AITM2', HAXIS2 )
      CALL GHCSET ( HHEADO, 'AITM1', HAXIS2 )
      CALL GHCSET ( HHEADO, 'AITM2', HAXIS1 )
*
      IF (  ( HEDIT .NE. ' ' ).AND.( HEDIT .NE.'NUL' )  ) THEN
         CALL GHEADD ( HHEADO, HEDIT, HETTL )
      ENDIF
*
      RETURN
      END
*********************************************************************
*"         << 第１次元と第２次元を交換 >>
*********************************************************************
      SUBROUTINE GMEYXZ
     M         ( HHEAD , GDATA ,
     I           HEDIT , HETTL  )
*
      CHARACTER  HHEAD  ( * )*(*)        !" ヘッダー(入力)
      REAL       GDATA  ( * )            !" データ(入力)
      CHARACTER  HEDIT       *(*)        !" 編集略記号
      CHARACTER  HETTL       *(*)        !" 編集タイトル
*
      COMMON     /GMWORK/ GDATAW
      REAL       GDATAW ( 1 )            !" データ(ワーク)
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
#else
#include         "gzsize.F"              !" NCC, NDC
#endif
      CHARACTER  HHEADW ( NDC )*(NCC)    !" ヘッダー(ワーク)
*
      CALL       GMCSIZ ( HHEADW )
      CALL       GPEYXZ
     I         ( HHEAD , GDATA ,
     I           HEDIT , HETTL ,
     O           HHEADW, GDATAW  )
*
      CALL       GPFSET
     I         ( HHEADW, GDATAW,
     I           ' '   , ' '   ,
     O           HHEAD , GDATA   )
*
      RETURN
      END
