SUBROUTINE OUTP4 
      IMPLICIT REAL*8(A-H,O-Z),INTEGER(I-N)
C ---------------------------------------------------------------
C ---------------------- C_A      -------------------------------
C ---------------------------------------------------------------
      DOUBLEPRECISION HA,BR,TWMTM 
      CHARACTER FE*26,WA*16 
      CHARACTER TABHDG*300,  TABROW*300,  FMTBLK*40,FMTPGR*20
      LOGICAL NOSLAB,NORCYL,YESSLB,YESRCL,NOG,YESG,NEWRAD,NOFUEL,LDUEQN,
     1 COOLZN,SEL
      COMMON/A/HA,BR 
      COMMON/A/ABURN ,AIR ,AIRBD ,AIREX ,AIRQ4 ,AIRT ,AIRTH ,AIRTT 
     1 ,AIRVC ,AIRX4 ,AK ,AK0 ,AKLNL ,AKR ,ALMDF(6) ,AMT, AMTV ,AMU 
     2 ,AMW(20) ,AREAI ,AVMW ,AVTS ,BTUPT ,BTUU ,BURND ,BW, ENDIA 
     3 ,C(5,43) ,CF ,CLAIR ,CTG1 ,CTG2 ,DCO2 ,DELTA ,DIAM ,DIAMD(10) 
     4 ,DIAMU ,DLTOA ,DMAX ,DQ ,DZ, EPS1, EPS2, EPS3, EXN2, EXO2, FEED 
     5 ,FLAM0 ,FLAML ,FLUDZ ,FRH2O ,FRH2R ,FRRCY ,FRSLB ,FTCO2, ENDBR 
     6 ,GASIN0(15,8) ,GASVL ,GM(6) ,GR(6) ,HGC ,HGW ,HL ,HP
     7 ,HS ,PBTUI(15,2) ,PCO2V ,PH2OV ,PHI ,PHIA ,PI ,PL, QME1
     8 ,PLOD ,PNDFD(15,5,2) ,PO2V ,POUNF ,PP ,PPHG ,PPHGJ(20) ,PPHM 
     9 ,PPHMT ,PRAIR ,PRATM ,PRINC ,PROPK(50,93) ,Q9T ,QAA ,QINF(2) ,QMA
     C ,QO ,QQ ,QRADL ,RPM ,SCO2 ,SECDI ,SL ,SLABW ,SLOPE ,SMAX ,STHIK 
     1 ,STHKM ,TA ,TDU ,TEDU ,TETS ,TETW ,TG ,TGO ,THRNG ,TL ,TM ,TME 
     2 ,TMI ,TMO ,TP ,TPOTH ,TSAIR ,TT1 ,TT2 ,YESG ,YESRCL ,YESSLB 
     3 ,IFLAM, DQXDZ0, DQFLZ0, TO ,HWAGV, QWAGV, TAGV, VAG, FEEDR,
     4 INTRC,NIJRC,AMRIN,AMMOUT,DUSTR,AMROUT,TAA,TAA2,TAA3,TAA4,TGVMTM,
     5 TGVOTM,SV1(25,12),DQXDZ,WTRIN0(4),WATRIN,GEVTOT(6)
      COMMON/A/IA ,IPAGE ,L7(70) ,LBDC(12,50) ,LINE ,LQG3(12,25),
     1 LQM3(12,25),LSHR(6,40),LTG3(36,14),LTM3(36,2),NBREAK,NLPAGE
     2 ,NOG,NORCYL ,NOSLAB,N10,IFLDZ,DSRC,DMASS,SDSRC,SDMASS
     3 ,DVLIN(6),DVLOUT(6),VCOOKM(6),VCOOKR(6),TGAV
      COMMON/A/TABROW,TABHDG,FMTBLK,FMTPGR
      COMMON/CA/ FE,WA
      COMMON/CCA/TWMTM,IFHWGV,NEWRAD,NOFUEL,LDUEQN,KOOLZN,COOLZN,
     1 TLOW,ZLOW,THI,ZHI,HTUPRT
      COMMON/SEL1/SEL(1000)

C ---------------------------------------------------------------
C ---------------------- C_D      -------------------------------
C ---------------------------------------------------------------
      COMMON/D/IBRK,ICASE,ICNSV,IDU,IEQNQA,IFT(6),IGOF ,IHA ,IJ ,IK 
     1 ,IK0,IKK,IKN,IMIX ,INDP(10) ,INGAS ,INT1 ,INTL ,INTLX ,INTNL
     2 ,INTO2 ,INTT  ,IPROB ,IV ,JBED ,JDST ,JF(5,2) ,JLOC ,JRCY ,IJ0
     3 ,JSLB ,LAM ,LDZ ,LUMIN ,MGR ,MO2 ,MSLAB ,NAMU ,NAR ,NBED ,NBEDM 
     4 ,NBR ,NBRKW ,NCASE ,NCH4 ,NCO,NCO2,NCO2B,NCO2G ,NCOM1(5,2) ,NCP 
     5 ,NCVOL ,NDIA2 ,NDIA3 ,NDIA4 ,NDIAM ,NDST ,NDSTM ,NEP ,NF(2) 
     5 ,NFGAS
     6 ,NFGSP ,NFLA ,NFZAR ,NG(8,2) ,NGASC ,NGASM ,NGF ,NGS, MN2 
     7 ,NGSIN ,NGSM1 ,NH2 ,NH2O ,NNH3 ,NHVOL ,NINTL ,NITER(3) ,NKGAS 
     8 ,NKGSP ,NLIN ,NN2 ,NO2 ,NPROP ,NPVOL ,NPVOLB ,NQGV ,NQAMB ,NQFL 
     9 ,NQG ,NQM ,NQT2 ,NR1 ,NRCY ,NRCYM ,NREC ,NREGN ,NRHO ,NRO ,NSLB 
     C ,NSLBM ,NSO2 ,NSTHK ,NSTOR ,NTGV ,NTBL2(30) ,NTG ,NTIME ,NTM 
     1 ,NVLS ,NZ ,MZ,NVZN,PROPM(93),NBRKH,NKGDS,NPHIA

C ---------------------------------------------------------------
C ---------------------- C_SAVE1  -------------------------------
C ---------------------------------------------------------------
      COMMON/SAVE1/SAVE(320,1000),SAVEWM(320,1000),VARBL(20) 

C ---------------------------------------------------------------
C ---------------------- C_FLAG   -------------------------------
C ---------------------------------------------------------------
      LOGICAL FLAGS,GRRRRR,TESTAR
      COMMON/FLAG/FLAGS(400),GRRRRR,TESTAR 

C ---------------------------------------------------------------
C ---------------------- C_CMAIND -------------------------------
C ---------------------------------------------------------------
      INTEGER PGASA 
      COMMON/RMAIND/GTMI(6,2),PPHGI(20),FNC(2),NNN(3,2), 
     1 GM1(6),GR1(6),FBS(3,2),FBS1(3,2),NN1(4,2),VLTO(7,7),
     1 VLOU(7,7), 
     2 VLBR(7,7),VBUR(6),VOUTX(6),VOL1(6),VOL2(6),
     2 GSI(6), 
     3 GMDST(6),GRDST(6),PGASB(13),AIRFU,PGASA(13),INDX(13) 
      CHARACTER GASNAM*8,GNAM*8,FMT*100 
      COMMON/CMAIND/GASNAM(13),GNAM(13),FMT 

C ---------------------------------------------------------------
C ---------------------- C_GENTABLE -------------------------------
C ---------------------------------------------------------------
      INTEGER WWIDTH(30),LHARG(30)
      DOUBLEPRECISION F5Z(320)
      CHARACTER HARG(30)*20,ZEROCOL*100,WARG(30)*30,DEFFMT(30)*30
      LOGICAL PRTCOL(30),COLNT0

C ---------------------------------------------------------------
C ---------------------- C_IO1    -------------------------------
C ---------------------------------------------------------------
      INTEGER RCHART,WHTML,WCSV,WTEMP,PIXLX,PIXLY
      EQUIVALENCE (IN,IIN),(RCHART,IOUT2),(IOUT3,WHTML)
      LOGICAL DFLAGS(1500)
      CHARACTER INFILE*80,OUTFIL*80,WHERE1*30,BLANKS*100,VERSION*15,
     1  PAGEBRK*45,DEFPTH*255,BASNAM*50,
     2  PROGNAME*40,DATE*20,COMPANY*48,CONTD*13
      COMMON/INOUT/IOUT,IN,IOUT2, WCSV,IOUT3,NPTSX,  NPTSY, NABSC, 
     1  LNPTSX,  LNPTSY, LNABSC,   INLINE, MARKR, LMARKR,LANNOT,LPIXLX,
     2  LPIXLY,PIXLX,PIXLY,NARGS,DFLAGS
      COMMON/INOUT1/INFILE,OUTFIL,WHERE1,BLANKS,VERSION,PAGEBRK,DEFPTH, !   PARXXX
     1  BASNAM,PROGNAME,DATE,COMPANY,CONTD
      LOGICAL REHEAD
      COMMON/CA1/INEWPG,REHEAD,WTEMP

      IF(COLNT0(22)
     C   .OR.COLNT0(23)
     C   .OR.COLNT0(24)
     C   .OR.COLNT0(25)
     C   .OR.COLNT0(26)
     C   .OR.COLNT0(27)
     C   .OR.COLNT0(28)
     C   .OR.COLNT0(29)
     C   .OR.COLNT0(30)
     C   .OR.COLNT0(21)) THEN
C -----------------------------------------------------------------------------------------
        NTROWS=50
        NCOLSW=110
        NBLANK=1
        NCOLS =11
        PRTCOL(1)=COLNT0(104)
        PRTCOL(2)=COLNT0(43)
        PRTCOL(3)=COLNT0(68)
        PRTCOL(4)=COLNT0(77)
        PRTCOL(5)=COLNT0(201)
        PRTCOL(6)=COLNT0(76)
        PRTCOL(7)=COLNT0(283)
        PRTCOL(8)=COLNT0(202)
        PRTCOL(9)=COLNT0(214)
        PRTCOL(10)=COLNT0(215)
        PRTCOL(11)=COLNT0(283)
        WARG(1)=' '
        WARG(2)=' '
        WARG(3)=' '
        WARG(4)=' '
        WARG(5)=' '
        WARG(6)=' '
        WARG(7)=' '
        WARG(8)=' '
        WARG(9)=' '
        WARG(10)=' '
        WARG(11)=' '
        HARG(1)='   IJ'
        HARG(2)='      Z'
        HARG(3)='     TGV'
        HARG(4)='      TG'
        HARG(5)='     TGC'
        HARG(6)='      TM'
        HARG(7)='     THG'
        HARG(8)='      TH'
        HARG(9)='    TGBR'
        HARG(10)='   TMBAR'
        HARG(11)='     THG'
        WWIDTH(1)=5
        WWIDTH(2)=7
        WWIDTH(3)=8
        WWIDTH(4)=8
        WWIDTH(5)=8
        WWIDTH(6)=8
        WWIDTH(7)=8
        WWIDTH(8)=8
        WWIDTH(9)=8
        WWIDTH(10)=8
        WWIDTH(11)=8
        CALL SETSEL(NTROWS)
        FMTPGR='(A,/)'
        FMTSET=.TRUE.
        CALL PAGER(LINE,0,IPAGE,1,5,IOUT,10124)
        TABHDG ='  TMPS'
        LENG=6
        DO I=1,NCOLS
          IF(PRTCOL(I)) THEN
            TABHDG=TABHDG(1:LENG) // HARG(I)(1:WWIDTH(I))
            LENG=LENG+WWIDTH(I)
          ENDIF
        END DO
        WRITE(IOUT,'(A)') TABHDG(1:LC(TABHDG))
        WRITE(IOUT,'( 2X,88(1H-) )' )
        DO I=IJ0,IKN
          SEL(I)=.TRUE.
          IF(SEL(I)) THEN
            CALL PAGER(LINE,NLPAGE,IPAGE,1,5,IOUT,10124)
            IF(REHEAD) THEN
              WRITE(IOUT,'(A)') TABHDG(1:LC(TABHDG))
              WRITE(IOUT,'( 6X,88(1H-) )' )
            ENDIF
             ENCODE(5, '(F5.0)',WARG(1)) SAVEWM(104,I)
             ENCODE(7, '(F7.2)',WARG(2)) SAVEWM(43,I)
             ENCODE(8, '(F8.2)',WARG(3)) SAVEWM(68,I)
             ENCODE(8, '(F8.2)',WARG(4)) SAVEWM(77,I)
             ENCODE(8, '(F8.2)',WARG(5)) SAVEWM(201,I)
             ENCODE(8, '(F8.2)',WARG(6)) SAVEWM(76,I)
             ENCODE(8, '(F8.2)',WARG(7)) SAVEWM(283,I)
             ENCODE(8, '(F8.2)',WARG(8)) SAVEWM(202,I)
             ENCODE(8, '(F8.2)',WARG(9)) SAVEWM(214,I)
             ENCODE(8, '(F8.2)',WARG(10)) SAVEWM(215,I)
             ENCODE(8, '(F8.2)',WARG(11)) SAVEWM(283,I)
            LENG=6
            TABROW='      '
            DO J=1,NCOLS
              IF(PRTCOL(J)) THEN
                TABROW=TABROW(1:LENG) // WARG(J)(1:WWIDTH(J))
                LENG=LENG+WWIDTH(J)
              ENDIF
            END DO
            WRITE(IOUT,'(A)') TABROW(1:LENG)
          ENDIF
        END DO
        FMTSET=.FALSE.
      ENDIF
      IF(COLNT0(288)
     C   .OR.COLNT0(289)
     C   .OR.COLNT0(292)
     C   .OR.COLNT0(293)
     C   .OR.COLNT0(287)
     C   .OR.COLNT0(291)
     C   .OR.COLNT0(283)
     C   .OR.COLNT0(290)
     C   .OR.COLNT0(286)
     C   .OR.COLNT0(294)
     C   .OR.COLNT0(285)
     C   .OR.COLNT0(295)) THEN
C -----------------------------------------------------------------------------------------
        NTROWS=50
        NCOLSW=110
        NBLANK=1
        NCOLS =15
        PRTCOL(1)=COLNT0(104)
        PRTCOL(2)=COLNT0(43)
        PRTCOL(3)=COLNT0(283)
        PRTCOL(4)=COLNT0(284)
        PRTCOL(5)=COLNT0(285)
        PRTCOL(6)=COLNT0(286)
        PRTCOL(7)=COLNT0(287)
        PRTCOL(8)=COLNT0(288)
        PRTCOL(9)=COLNT0(289)
        PRTCOL(10)=COLNT0(290)
        PRTCOL(11)=COLNT0(291)
        PRTCOL(12)=COLNT0(292)
        PRTCOL(13)=COLNT0(293)
        PRTCOL(14)=COLNT0(294)
        PRTCOL(15)=COLNT0(295)
        WARG(1)=' '
        WARG(2)=' '
        WARG(3)=' '
        WARG(4)=' '
        WARG(5)=' '
        WARG(6)=' '
        WARG(7)=' '
        WARG(8)=' '
        WARG(9)=' '
        WARG(10)=' '
        WARG(11)=' '
        WARG(12)=' '
        WARG(13)=' '
        WARG(14)=' '
        WARG(15)=' '
        HARG(1)='   IJ'
        HARG(2)='      Z'
        HARG(3)='     THG'
        HARG(4)='        QHG'
        HARG(5)='   HSNCO2'
        HARG(6)='   HSNH2O'
        HARG(7)='    HSNN2'
        HARG(8)='   HSNSO2'
        HARG(9)='   HSNH2S'
        HARG(10)='    HSNCO'
        HARG(11)='    HSNO2'
        HARG(12)='  HSNCVOL'
        HARG(13)='  HSNHVOL'
        HARG(14)='    HSNH2'
        HARG(15)=' HSNCVOL1'
        WWIDTH(1)=5
        WWIDTH(2)=7
        WWIDTH(3)=8
        WWIDTH(4)=11
        WWIDTH(5)=9
        WWIDTH(6)=9
        WWIDTH(7)=9
        WWIDTH(8)=9
        WWIDTH(9)=9
        WWIDTH(10)=9
        WWIDTH(11)=9
        WWIDTH(12)=9
        WWIDTH(13)=9
        WWIDTH(14)=9
        WWIDTH(15)=9
        CALL SETSEL(NTROWS)
        FMTPGR='(A,/)'
        FMTSET=.TRUE.
        CALL PAGER(LINE,0,IPAGE,1,5,IOUT,10144)
        TABHDG ='  HSNG1'
        LENG=7
        DO I=1,NCOLS
          IF(PRTCOL(I)) THEN
            TABHDG=TABHDG(1:LENG) // HARG(I)(1:WWIDTH(I))
            LENG=LENG+WWIDTH(I)
          ENDIF
        END DO
        WRITE(IOUT,'(A)') TABHDG(1:LC(TABHDG))
        WRITE(IOUT,'( 2X,135(1H-) )' )
        DO I=IJ0,IKN
          SEL(I)=.TRUE.
          IF(SEL(I)) THEN
            CALL PAGER(LINE,NLPAGE,IPAGE,1,5,IOUT,10144)
            IF(REHEAD) THEN
              WRITE(IOUT,'(A)') TABHDG(1:LC(TABHDG))
              WRITE(IOUT,'( 6X,135(1H-) )' )
            ENDIF
             ENCODE(5, '(F5.0)',WARG(1)) SAVEWM(104,I)
             ENCODE(7, '(F7.2)',WARG(2)) SAVEWM(43,I)
             ENCODE(8, '(F8.2)',WARG(3)) SAVEWM(283,I)
             ENCODE(11, '(F11.0)',WARG(4)) PPHM*SAVEWM(284,I)
             ENCODE(9, '(F9.2)',WARG(5)) PPHM*SAVEWM(285,I)
             ENCODE(9, '(F9.2)',WARG(6)) PPHM*SAVEWM(286,I)
             ENCODE(9, '(F9.2)',WARG(7)) PPHM*SAVEWM(287,I)
             ENCODE(9, '(F9.2)',WARG(8)) PPHM*SAVEWM(288,I)
             ENCODE(9, '(F9.2)',WARG(9)) PPHM*SAVEWM(289,I)
             ENCODE(9, '(F9.2)',WARG(10)) PPHM*SAVEWM(290,I)
             ENCODE(9, '(F9.2)',WARG(11)) PPHM*SAVEWM(291,I)
             ENCODE(9, '(F9.2)',WARG(12)) PPHM*SAVEWM(292,I)
             ENCODE(9, '(F9.2)',WARG(13)) PPHM*SAVEWM(293,I)
             ENCODE(9, '(F9.2)',WARG(14)) PPHM*SAVEWM(294,I)
             ENCODE(9, '(F9.2)',WARG(15)) PPHM*SAVEWM(295,I)
            LENG=7
            TABROW='       '
            DO J=1,NCOLS
              IF(PRTCOL(J)) THEN
                TABROW=TABROW(1:LENG) // WARG(J)(1:WWIDTH(J))
                LENG=LENG+WWIDTH(J)
              ENDIF
            END DO
            WRITE(IOUT,'(A)') TABROW(1:LENG)
          ENDIF
        END DO
        FMTSET=.FALSE.
      ENDIF
      RETURN
      END