* PACKAGE 
*
*"  [HIS] 90/11/02 (numaguti)
*"        93/02/25 (takepiro) patch for IRIS
*********************************************************************
      SUBROUTINE GDREAD          
     O         ( GDATA , IEOD  ,
     O           IT    , IDATE , ISTEP , ITDUR ,
     I           IFILE , HITSEL, IOMODE, HCORD  )
*
*   [PARAM] 





* PACKAGE  ZXT10L32 !" 格子点数，波数 X-Z
*
      INTEGER     IMAX           !" 経度格子数
      INTEGER     JMAX           !" 緯度格子数
      INTEGER     IDIM           !" 経度配列サイズ
      INTEGER     JDIM           !" 緯度配列サイズ
      INTEGER     MMAX           !" 最大東西波数
      INTEGER     LMAX           !" 最大南北波数
      INTEGER     NMAX           !" 最大全波数
      INTEGER     MINT           !" 東西波数間隔
      INTEGER     KMAX           !" 鉛直層数
      INTEGER     KDIM           !" 鉛直配列サイズ
      INTEGER     NMDIM          !" 水平波数成分数
      INTEGER     JMXHF          !" JMAX/2+1
      INTEGER     NWORK          !" ワーク領域大きさ
*
      PARAMETER ( IMAX  = 32,     JMAX =  1,
     &            IDIM  = IMAX+1, JDIM = JMAX,
     &            MMAX  = 10,     LMAX =  0,    NMAX = MMAX, MINT = 1,
     &            KMAX  = 32,     KDIM = KMAX,
     &            NMDIM = (MMAX/MINT+1)*(2*(NMAX+1)-MMAX)
     &                  - (NMAX-LMAX)/MINT*(NMAX-LMAX+1),
     &            JMXHF = JMAX/2+1,
     &            NWORK = IDIM*JDIM*KMAX*12                       )

* PACKAGE ZHDIM  !" 文字列文字数 
*
*"  [HIS]  90/08/31(numaguti)
*
      INTEGER     NCC
      INTEGER     NDC
      INTEGER     NFILN
*
      PARAMETER ( NCC   = 16, NDC   = 64 ,
     &            NFILN = 38              )

*
*    [OUTPUT]    
      ReaL*8       GDATA ( IDIM, JDIM, *     ) 
      INTEGER    IEOD                        
*
*    [INPUT]    
      INTEGER    IT                          
      INTEGER    IDATE ( * )                 
      INTEGER    ISTEP                       
      INTEGER    ITDUR                       
      CHARACTER  HITSEL*(*)                  
      INTEGER    IFILE                       
      INTEGER    IOMODE                      
      CHARACTER  HCORD  *(*)                 
*
*    [INTERNAL WORK]
      CHARACTER  HHEAD ( NDC )*(NCC)         
      CHARACTER  HUTIMD       *(NCC)         
      INTEGER    I, J, K, KLEVS
      INTEGER    ITD, ITDURD
*
*" << REDSET : 読み込み, 余白セット >>
*
      CALL GZDBRD                 
     O            ( HHEAD , GDATA , IEOD  ,
     O              ITD   , IDATE , ISTEP , ITDURD,
     I              IFILE , HITSEL, IOMODE          )
*
      IF( IEOD.NE. 0 ) RETURN     
*
      CALL HQCORL
     I         ( HCORD ,
     O           KLEVS   )
*
      DO 3100 K = 1, KLEVS
         DO 3130 I = IMAX+1, IDIM
            DO 3130 J = 1, JDIM
               GDATA( I,J,K ) = GDATA( 1,J,K )
 3130    CONTINUE
         DO 3140 J = JMAX+1, JDIM
            DO 3140 I = 1, IDIM
               GDATA( I,J,K ) = GDATA( I,1,K )
 3140    CONTINUE
 3100 CONTINUE
*     
*" << CHGTIM : 時刻単位変換 >>
*
      CALL GHCGET ( HHEAD , 'UTIM' , HUTIMD )
      CALL ACTIME
     I            ( ITD   , HUTIMD , '#'    ,
     O              IT                        )
      CALL ACTIME
     I            ( ITDURD, HUTIMD , '#'    ,
     O              ITDUR                     )
*
      RETURN
      END
*********************************************************************
      SUBROUTINE GDWRIT      
     I         ( GDATA ,
     I           HITEM , HTITL , HUNIT ,
     I           IT    , IDATE , ISTEP , ITDUR ,
     I           JFILE , IOMODE, NOEND , HCORD , HDFMT  )
*
*   [PARAM] 





* PACKAGE  ZXT10L32 !" 格子点数，波数 X-Z
*
      INTEGER     IMAX           !" 経度格子数
      INTEGER     JMAX           !" 緯度格子数
      INTEGER     IDIM           !" 経度配列サイズ
      INTEGER     JDIM           !" 緯度配列サイズ
      INTEGER     MMAX           !" 最大東西波数
      INTEGER     LMAX           !" 最大南北波数
      INTEGER     NMAX           !" 最大全波数
      INTEGER     MINT           !" 東西波数間隔
      INTEGER     KMAX           !" 鉛直層数
      INTEGER     KDIM           !" 鉛直配列サイズ
      INTEGER     NMDIM          !" 水平波数成分数
      INTEGER     JMXHF          !" JMAX/2+1
      INTEGER     NWORK          !" ワーク領域大きさ
*
      PARAMETER ( IMAX  = 32,     JMAX =  1,
     &            IDIM  = IMAX+1, JDIM = JMAX,
     &            MMAX  = 10,     LMAX =  0,    NMAX = MMAX, MINT = 1,
     &            KMAX  = 32,     KDIM = KMAX,
     &            NMDIM = (MMAX/MINT+1)*(2*(NMAX+1)-MMAX)
     &                  - (NMAX-LMAX)/MINT*(NMAX-LMAX+1),
     &            JMXHF = JMAX/2+1,
     &            NWORK = IDIM*JDIM*KMAX*12                       )

* PACKAGE ZHDIM  !" 文字列文字数 
*
*"  [HIS]  90/08/31(numaguti)
*
      INTEGER     NCC
      INTEGER     NDC
      INTEGER     NFILN
*
      PARAMETER ( NCC   = 16, NDC   = 64 ,
     &            NFILN = 38              )

*
*    [INPUT]     
      ReaL*8       GDATA ( IDIM, JDIM, * )     
      CHARACTER  HITEM  *(*)                 
      CHARACTER  HTITL  *(*)                 
      CHARACTER  HUNIT  *(*)                 
      INTEGER    IT                          
      INTEGER    IDATE ( * )                 
      INTEGER    ISTEP                       
      INTEGER    ITDUR                       
      INTEGER    JFILE                       
      INTEGER    IOMODE                      
      INTEGER    NOEND                       
      CHARACTER  HCORD  *(*)                 
      CHARACTER  HDFMT        *(NCC)         
*
*    [INTERNAL WORK]
      CHARACTER  HHEAD ( NDC )*(NCC)         
      ReaL*8       VMISS
      INTEGER    ISIZE
*
      CALL GZDBGT( 'MISS' , VMISS )
      CALL HSTHED                    
     O         ( HHEAD , ISIZE ,
     I           HCORD , ' '   ,
     I           HITEM , HTITL , HUNIT ,
     I           HDFMT , VMISS ,
     I           VMISS , VMISS , VMISS , VMISS , 1      )
*
      CALL GZDBWT                     
     O            ( HHEAD , GDATA ,
     O              IT    , IDATE , ISTEP , ITDUR ,
     I              JFILE , IOMODE, NOEND , HDFMT   )
*
      RETURN
      END
