* PACKAGE GTCON   !" スカラー値セット
*********************************************************************
      PROGRAM GTCON
*
#ifdef SYS_IBMS
      INCLUDE    (GTSINC)
      INCLUDE    (GZSIZE)
#else
#include         "gtsinc.F"
#include         "gzsize.F"
#endif
      COMMON     /GMWORK/ MWORK
      REAL       MWORK  ( IJKDIM )
*
      CHARACTER  HHEAD( NDC )*(NCC)
      REAL       GDATA( IJKDIM )
      CHARACTER  HFILE( 1 ) *(NFILN)
      DATA       HFILE  / '$GTTMPDIR/gtool.out' /
      INTEGER    IFILE
      DATA       IFILE  / 50 /
      DATA       JFILE  / 60 /
*
      REAL       VAL
      DATA       VAL    / 1.0 /
      CHARACTER  OUT    *(NFILN)
      DATA       OUT    / '$GTTMPDIR/gtool.out' /
      LOGICAL    APND
      DATA       APND   / .FALSE. /
      CHARACTER  ITEM   *(NCC)
      CHARACTER  UNIT   *(NCC)
      CHARACTER  TITLE  *(NCC*2)
      CHARACTER  DSET   *(NCC)
      CHARACTER  EDIT   *(NCC)
      CHARACTER  ETTL   *(NCC)
      DATA       ITEM, UNIT, TITLE, DSET /4*' '/
*
      DATA       EDIT, ETTL /'CON','<gtcon>'/
*
      LOGICAL    GRESET
      DATA       GRESET / .TRUE. /
      LOGICAL    HELP
      DATA       HELP   / .FALSE. /
*
      NAMELIST  /OPTION/ VAL , OUT,  APND,
     &                   ITEM, UNIT, TITLE, DSET, EDIT, ETTL, GRESET,
     &                   HELP, HFILE
*
      CALL OPTARG ( 91, 'OPTION', 'HFILE', NOPT, NFILE )
      READ (91,OPTION,IOSTAT=IOS)
      CLOSE(91)
      IF ( IOS.NE.0 .OR. HELP ) THEN
         WRITE(6,OPTION)
         STOP
      ENDIF
*
      CALL GTOPEN
      CALL GTSIZE ( HHEAD, IJKDIM )
      CALL GMSIZE ( IJKDIM  )
*
      CALL GURNTF ( HFILE( 1 ), OUT  , '$GTTMPDIR/gtool.in' )
*
      CALL GFROPN ( IFILE, HFILE( 1 ) )
      CALL GFOOPN ( JFILE,  OUT , APND )
*
      CALL GUNENV( OUT,'.',.FALSE. )
      IL=LENC(OUT)
      WRITE (6,*) 'output='//OUT(1:IL)
*
 1100 CONTINUE
*
         CALL   GFREAD
     O        ( HHEAD, GDATA, IEOD  ,
     I          IFILE , 1               )
*
         IF ( IEOD .EQ. 0 ) THEN
*
           CALL GMFCON
     I        ( HHEAD , GDATA, VAL ,
     I          EDIT  , ETTL         )
*
           IF ( ITEM .NE. ' ' ) THEN
              CALL GHCSET( HHEAD, 'ITEM', ITEM )
           ENDIF
           IF ( UNIT .NE. ' ' ) THEN
              CALL GHCSET( HHEAD, 'UNIT', UNIT )
           ENDIF
           IF ( TITLE .NE. ' ' ) THEN
              CALL GHCSTS( HHEAD, 'TITL', TITLE )
           ENDIF
           IF ( DSET .NE. ' ' ) THEN
              CALL GHCSET( HHEAD, 'DSET', DSET )
           ENDIF
*
           IF ( GRESET ) THEN
              CALL GHRSGP( HHEAD )
           ENDIF
*
           CALL  GFWRIT
     I         ( HHEAD , GDATA ,
     I           JFILE , 1     , 0       )
*
      GOTO 1100
         ENDIF
*
      STOP
      END
