* PACKAGE IPRIN  
*
*"  [HIS]  90/11/03(numaguti)
*******************************************************************
      SUBROUTINE PRINTD       
     I         ( JFILE, HFMT  , GDATA ,
     I           ISTR , IEND  , IINT  , JSEL ,
     I           IDIM , JDIM  , NCOLS          )
*
*   [PARAM] 
      INTEGER    IDIM, JDIM
*
*   [INPUT] 
      INTEGER    JFILE
      CHARACTER  HFMT  *(*)
      ReaL*8       GDATA ( IDIM, JDIM )
      INTEGER    ISTR
      INTEGER    IEND
      INTEGER    IINT
      INTEGER    JSEL
      INTEGER    NCOLS
*
*   [INTERNAL WORK] 
      INTEGER    NCMAX
      PARAMETER ( NCMAX=300 )
      CHARACTER  HNUM   *30
      CHARACTER  HLINE *(NCMAX)
      INTEGER    NCH, I, IL, ILS, IL2
*
*   [EXTERNAL FUNC] 
      INTEGER    LENC
*
*
      WRITE ( HNUM , HFMT ) 999.999
      NCH  = LENC( HNUM )
      IF ( NCH+3 .GT. NCOLS ) THEN
         CALL MSGDMP( 'W', 'PRINTD', 'TOO NARROW COLUMNS' )
      ENDIF
*
      HLINE = ' '
      WRITE ( HLINE(1:3), '(I3)' ) JSEL
      ILS   = 5
      IL    = ILS
*
      DO 1100 I = ISTR, IEND, IINT
         WRITE ( HNUM, HFMT ) GDATA( I,JSEL )
         IL2 = IL+NCH-1
*
         IF ( IL2 .GT. NCOLS ) THEN
            WRITE ( JFILE, '(A)' ) HLINE(1:NCOLS)
            HLINE = ' '
            IL = ILS
            IL2 = IL+NCH-1
         ENDIF
*
         HLINE ( IL:IL2 ) = HNUM
         IL = IL2 + 1
 1100 CONTINUE
*
      WRITE ( JFILE, '(A)' ) HLINE(1:NCOLS)
*
      RETURN
      END
