*"表題 ヘッダーパック GTOOL3(GHPACK)
*
*"履歴 90/08/21 沼口  敦
*
*
***********************************************************************
*"         << 識別記述子のパック >>
**********************************************************************
      SUBROUTINE GHPACK
     O         ( HHEAD ,
     I           HDSET , HITEM , IFNUM , IDNUM ,
     I           HTITL , HUNIT ,
     I           ITIME , HDATE , HUTIM , ITDUR ,
     I           HAITM1, IASTR1, IAEND1,
     I           HAITM2, IASTR2, IAEND2,
     I           HAITM3, IASTR3, IAEND3,
     I           HDFMT , VMISS ,
     I           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP ,
     I           HCDATE, HCSIGN                         )
*
      CHARACTER  HHEAD ( * )*(*)
*
      CHARACTER  HDSET  *(*)             !" データセット名
      CHARACTER  HITEM  *(*)             !" 識別名称
      INTEGER    IFNUM                   !" ファイル番号
      INTEGER    IDNUM                   !" データ番号
*
      CHARACTER  HTITL  *(*)             !" タイトル
      CHARACTER  HUNIT  *(*)             !" 単位
*
      INTEGER    ITIME                   !" 時刻(通し)
      CHARACTER  HDATE  *(*)             !" 時刻(yyyymmddhhmmss)
      CHARACTER  HUTIM  *(*)             !" 時刻単位
      INTEGER    ITDUR                   !" 代表する時間
*
      CHARACTER  HAITM1 *(*)             !" 軸1の格子名称
      INTEGER    IASTR1                  !" 軸1の格子始め
      INTEGER    IAEND1                  !" 軸1の格子終り
      CHARACTER  HAITM2 *(*)             !" 軸2の格子名称
      INTEGER    IASTR2                  !" 軸2の格子始め
      INTEGER    IAEND2                  !" 軸2の格子終り
      CHARACTER  HAITM3 *(*)             !" 軸3の格子名称
      INTEGER    IASTR3                  !" 軸3の格子始め
      INTEGER    IAEND3                  !" 軸3の格子終り
*
      CHARACTER  HDFMT  *(*)             !" データフォーマット
      REAL       VMISS                   !" 欠損値の値
*
      REAL       DMIN                    !" レンジ(最小)
      REAL       DMAX                    !" レンジ(最大)
      REAL       DIVS                    !" 間隔(小)
      REAL       DIVL                    !" 間隔(大)
      INTEGER    ISTYP                   !" スケーリングタイプ
*
      CHARACTER  HCDATE *(*)             !" データ作成日付
      CHARACTER  HCSIGN *(*)             !" データ作成者
*
      CHARACTER  HMDATE *(*)             !" データ変更日付
      CHARACTER  HMSIGN *(*)             !" データ変更者
*
#ifdef SYS_IBMS
      INCLUDE    (GZSIZE)                !" NCC, NDC
#else
#include         "gzsize.F"              !" NCC, NDC
#endif
      CHARACTER  HDDSET *(NCC)
      CHARACTER  HDATEZ *(NCC)
      CHARACTER  HSIGNZ *(NCC)
*
*"         < 1. 全てパック >
*
      DO 1100 II = 1, NDC-1
         HHEAD( II ) = ' '
 1100 CONTINUE
*
      CALL GHPSET ( HHEAD , 'IDFM    ' , 0      )
*
      IF ( HDSET .NE. ' ' ) THEN
         CALL GHCSET ( HHEAD , 'DSET    ' , HDSET  )
      ELSE
         CALL GTCGET ('DDSET', HDDSET )
         CALL GHCSET ( HHEAD , 'DSET    ' , HDDSET )
      ENDIF
*
      CALL GHCSET ( HHEAD , 'ITEM    ' , HITEM  )
      CALL GHPSET ( HHEAD , 'FNUM    ' , IFNUM  )
      CALL GHPSET ( HHEAD , 'DNUM    ' , IDNUM  )
*
      CALL GHCSTS ( HHEAD , 'TITL    ' , HTITL  )
      CALL GHCSET ( HHEAD , 'UNIT    ' , HUNIT  )
*
      CALL GHPSET ( HHEAD , 'TIME    ' , ITIME  )
      CALL GHCSET ( HHEAD , 'DATE    ' , HDATE  )
      CALL GHCSET ( HHEAD , 'UTIM    ' , HUTIM  )
      CALL GHPSET ( HHEAD , 'TDUR    ' , ITDUR  )
*
      CALL GHCSET ( HHEAD , 'AITM1   ' , HAITM1 )
      CALL GHPSET ( HHEAD , 'ASTR1   ' , IASTR1 )
      CALL GHPSET ( HHEAD , 'AEND1   ' , IAEND1 )
*
      CALL GHCSET ( HHEAD , 'AITM2   ' , HAITM2 )
      CALL GHPSET ( HHEAD , 'ASTR2   ' , IASTR2 )
      CALL GHPSET ( HHEAD , 'AEND2   ' , IAEND2 )
*
      CALL GHCSET ( HHEAD , 'AITM3   ' , HAITM3 )
      CALL GHPSET ( HHEAD , 'ASTR3   ' , IASTR3 )
      CALL GHPSET ( HHEAD , 'AEND3   ' , IAEND3 )
*
      CALL GHCSET ( HHEAD , 'DFMT    ' , HDFMT  )
      CALL GHPSET ( HHEAD , 'MISS    ' , VMISS  )
*
      CALL GHPSET ( HHEAD , 'DMIN    ' , DMIN   )
      CALL GHPSET ( HHEAD , 'DMAX    ' , DMAX   )
      CALL GHPSET ( HHEAD , 'DIVS    ' , DIVS   )
      CALL GHPSET ( HHEAD , 'DIVL    ' , DIVL   )
      CALL GHPSET ( HHEAD , 'STYP    ' , ISTYP  )
*
      CALL GUQNOW ( HDATEZ )
      CALL GTCGET ( 'MYSIGN', HSIGNZ )
*
      IF ( HCDATE .EQ. ' ' ) THEN
         CALL GHCSET ( HHEAD , 'CDATE   ' , HDATEZ )
      ELSE
         CALL GHCSET ( HHEAD , 'CDATE   ' , HCDATE )
      ENDIF
*
      IF ( HCSIGN .EQ. ' ' ) THEN
         CALL GHCSET ( HHEAD , 'CSIGN   ' , HSIGNZ  )
      ELSE
         CALL GHCSET ( HHEAD , 'CSIGN   ' , HCSIGN )
      ENDIF
      CALL GHCSET ( HHEAD , 'MDATE   ' , HDATEZ  )
      CALL GHCSET ( HHEAD , 'MSIGN   ' , HSIGNZ  )
*
      RETURN
*=====================================================================
*"         << 識別記述子のアンパック >>
*====================================================================
      ENTRY      GHUPAC
     I         ( HHEAD ,
     O           HDSET , HITEM , IFNUM , IDNUM ,
     O           HTITL , HUNIT ,
     O           ITIME , HDATE , HUTIM , ITDUR ,
     O           HAITM1, IASTR1, IAEND1,
     O           HAITM2, IASTR2, IAEND2,
     O           HAITM3, IASTR3, IAEND3,
     O           HDFMT , VMISS ,
     O           DMIN  , DMAX  , DIVS  , DIVL  , ISTYP ,
     O           HCDATE, HCSIGN, HMDATE, HMSIGN         )
*
*"         < 2. 全てアンパック >
*
      CALL GHCGET ( HHEAD , 'DSET    ' , HDSET  )
      CALL GHCGET ( HHEAD , 'ITEM    ' , HITEM  )
      CALL GHPGET ( HHEAD , 'FNUM    ' , IFNUM  )
      CALL GHPGET ( HHEAD , 'DNUM    ' , IDNUM  )
*
      CALL GHCGTS ( HHEAD , 'TITL    ' , HTITL  )
      CALL GHCGET ( HHEAD , 'UNIT    ' , HUNIT  )
*
      CALL GHPGET ( HHEAD , 'TIME    ' , ITIME  )
      CALL GHCGET ( HHEAD , 'DATE    ' , HDATE  )
      CALL GHCGET ( HHEAD , 'UTIM    ' , HUTIM  )
      CALL GHPGET ( HHEAD , 'TDUR    ' , ITDUR  )
*
      CALL GHCGET ( HHEAD , 'AITM1   ' , HAITM1 )
      CALL GHPGET ( HHEAD , 'ASTR1   ' , IASTR1 )
      CALL GHPGET ( HHEAD , 'AEND1   ' , IAEND1 )
*
      CALL GHCGET ( HHEAD , 'AITM2   ' , HAITM2 )
      CALL GHPGET ( HHEAD , 'ASTR2   ' , IASTR2 )
      CALL GHPGET ( HHEAD , 'AEND2   ' , IAEND2 )
*
      CALL GHCGET ( HHEAD , 'AITM3   ' , HAITM3 )
      CALL GHPGET ( HHEAD , 'ASTR3   ' , IASTR3 )
      CALL GHPGET ( HHEAD , 'AEND3   ' , IAEND3 )
*
      CALL GHCGET ( HHEAD , 'DFMT    ' , HDFMT  )
      CALL GHPGET ( HHEAD , 'MISS    ' , VMISS  )
*
      CALL GHPGET ( HHEAD , 'DMIN    ' , DMIN   )
      CALL GHPGET ( HHEAD , 'DMAX    ' , DMAX   )
      CALL GHPGET ( HHEAD , 'DIVS    ' , DIVS   )
      CALL GHPGET ( HHEAD , 'DIVL    ' , DILV   )
      CALL GHPGET ( HHEAD , 'STYP    ' , ISTYP  )
*
      CALL GHCGET ( HHEAD , 'CDATE   ' , HCDATE )
      CALL GHCGET ( HHEAD , 'CSIGN   ' , HCSIGN )
*
      CALL GHCGET ( HHEAD , 'MDATE   ' , HMDATE )
      CALL GHCGET ( HHEAD , 'MSIGN   ' , HMSIGN )
*
      RETURN
      END
