C
C
      SUBROUTINE OUTPUT (IPT,MARKX,MARKC,MARKN,MARKY,ITT,MADJC)
C
C     ------------------------------------------------------------------
C
C       SUBROUTINE PURPOSE:
C       OUTPUT OF NORMAL CALCULATION RESULTS.
C
C     ------------------------------------------------------------------
C
      INCLUDE 'CMMNW.DAT'
C
      DIMENSION HBN(NMX),IRE(NMX),LST(NMX),TQR(NMX),HFN(5),QFN(5)
C
C  ** CALCULATION OF VARIATION IN AIR STATIC PRESSURES IN AIRWAYS.
C
      IF (IPT.NE.1) THEN
         PP=0.0
         DO 10 L=1,NB
            IF (NWTYP(L).LE.0.OR.NWTYP(L).EQ.10) THEN
               P(L)=R(L)*Q(L)*ABS(Q(L))*1.E-10
            ELSE
               P(L)=R(L)
            ENDIF
            PP=PP+P(L)
10       CONTINUE
         PCRIT=PP/FLOAT(NB)
         IF ((ITT.GE.ITN.OR.MADJC.GE.MADJ).AND.IPT.EQ.4) THEN
            DO 1520 I=1,NB
               TTMN=0.0
               DO 1500 J=1,10
                  TTMN=TTMN+TMRCD(I,J)
1500           CONTINUE
               TTMN=TTMN/10.0
               TQR(I)=0.0
               DO 1510 J=1,10
                  TQR(I)=TQR(I)+(TMRCD(I,J)-TTMN)**2
1510           CONTINUE
1520        CONTINUE
            IZ=0
            LL=0
1530        II=0
            DO 1540 I=1,NB
               IF (NO(I).GT.0) THEN
                  IF (TQR(I).GT.TSR.OR.II.EQ.0) THEN
                     TSR=TQR(I)
                     II=I
                  ENDIF
               ENDIF
1540        CONTINUE
            IF (II.EQ.0) GO TO 1590
            IF (LL.GT.0) THEN
               KK=0
               DO 1550 J=1,LL
                  K=LST(J)
                  IF (TQR(II).GT.TQR(K)) KK=KK+1
1550           CONTINUE
               IF (KK.GE.(LL-2).AND.TQR(II).GT.20.0) GO TO 1560
               GO TO 1590
            ENDIF
1560        LL=LL+1
            LST(LL)=II
            NO(II)=-NO(II)
            JSS=JS(II)
            JFF=JF(II)
1570        DO 1580 I=1,NB
               IF (NO(I).GT.0) THEN
                  IF ((JS(I).EQ.JSS.OR.JF(I).EQ.JSS.OR.JS(I).EQ.JFF.OR.
     .               JF(I).EQ.JFF).AND.(TQR(I).GT.20.0)) THEN
                     LL=LL+1
                     LST(LL)=I
                     NO(I)=-NO(I)
                     IF (JS(I).EQ.JSS) THEN
                        JSS=JF(I)
                     ELSE IF (JF(I).EQ.JSS) THEN
                        JSS=JS(I)
                     ELSE IF (JS(I).EQ.JFF) THEN
                        JFF=JF(I)
                     ELSE
                        JFF=JS(I)
                     ENDIF
                     GO TO 1570
                  ENDIF
               ENDIF
1580        CONTINUE
            IZ=IZ+1
            IF (IZ.LE.3) GO TO 1530
1590        ICRT=0
            DO 1598 I=1,LL
               K=LST(I)
               DO 1596 J1=2,9
                  ERR1=ABS(TMRCD(K,J1-1)-TMRCD(K,J1))
                  ERR2=ABS(TMRCD(K,J1)-TMRCD(K,J1+1))
                  RATIO=ERR2/ERR1
                  IF (RATIO.GT.0.99) ICRT=1
1596           CONTINUE
1598        CONTINUE
            IF (ICRT.EQ.0) THEN
               ICYCLE=-1
               GO TO 1635
            ENDIF
            CRT1=0.0
            CRT2=0.0
            CRT3=0.0
            DO 1630 I=1,LL
               K=LST(I)
               NO(K)=IABS(NO(K))
               CRT=0.0
               DO 1600 J=10,3,-1
                  CRT=CRT+(TMRCD(K,J)-TMRCD(K,J-2))**2
1600           CONTINUE
               CRT1=CRT1+CRT/8.0
               CRT=0.0
               DO 1610 J=10,4,-1
                  CRT=CRT+(TMRCD(K,J)-TMRCD(K,J-3))**2
1610           CONTINUE
               CRT2=CRT2+CRT/7.0
               CRT=0.0
               DO 1620 J=10,5,-1
                  CRT=CRT+(TMRCD(K,J)-TMRCD(K,J)-TMRCD(K,J-4))**2
1620           CONTINUE
               CRT3=CRT3+CRT/6.0
1630        CONTINUE
            CRT1=CRT1/LL
            CRT2=CRT2/LL
            CRT3=CRT3/LL
            LSG=LL
            IF (AMIN1(CRT1,CRT2,CRT3)*10.0.LE.MAX(CRT1,CRT2,CRT3)) THEN
               ICYCLE=2
               IF (CRT2.LT.0.95*CRT1) ICYCLE=3
               IF (CRT3.LT.0.9*CRT1.AND.CRT3.LT.CRT2) ICYCLE=4
            ELSE
               ICYCLE=0
            ENDIF
1635        CONTINUE
         ENDIF
      ENDIF
C
      IF (IPT.EQ.1) THEN
C
C  ** LIST OF INPUT DATA ON NETWORK STRUCTURE.
C
         IF (MARKY.EQ.0) WRITE (8,285) TR,DR,NHM
         DO 9 I=1,NMX
            HBN(I)=0.0
            IRE(I)=0
            LST(I)=0
            TQR(I)=0.0
9        CONTINUE
         IF ((IOUT.NE.0.AND.MARKY.EQ.0).OR.IOUT.LE.(-1)) THEN
            WRITE (8,490)
            WRITE (8,500) (NO(K),JS(K),JF(K),Q(K),NWTYP(K),LA(K),
     .                    A(K),R(K),KF(K),O(K),K=1,NB)
            IF (NVPN.LE.0) THEN
               WRITE (8,980)
               WRITE (8,990) (JNO(K),T(K),Z(K),CH4C(K),K=1,NJ)
            ENDIF
         ENDIF
C
      ELSE IF (IPT.EQ.2) THEN
C
C  ** OUTPUT OF THE NETWORK PART.
C
         WRITE (8,110)
         WRITE (8,120)
         L=0
         DO 20 K=1,NB
            IF (NWTYP(K).GT.0) THEN
               L=L+1
            ELSE
               WRITE (8,130) NO(K),JS(K),JF(K),NWTYP(K),R(K),Q(K),P(K)
            ENDIF
20       CONTINUE
         IF (L.LE.0) THEN
            WRITE (8,140)
         ELSE
            WRITE (8,150)
            DO 30 K=1,NB
               IF (NWTYP(K).LE.0) GO TO 30
               WRITE (8,160) NO(K),JS(K),JF(K),Q(K),P(K)
30          CONTINUE
            IF (NFNUM.GT.0) THEN
               WRITE (8,170) (NOF(K),K=1,NFNUM)
               WRITE (8,175)
               DO 40 K=1,NFNUM
                  L=MPTS(K)
                  WRITE (8,180) (QF(K,I)/1000.0,PF(K,I),I=1,L)
40             CONTINUE
               IF (IOUT.LE.(-2).AND.MARKY.LE.0) THEN
                  WRITE (8,1040)
                  DO 45 K=1,NFNUM
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
                     INDEX=MPTS(K)
                     N1A=NCOF(K)
                     IF (INDEX.GT.1.OR.N1A.GT.1) THEN
                        IF (NSWT(K).EQ.1) THEN
                           WRITE (8,1044) NOF(K)
C                           DO 42 K1=1,N1A
                              WRITE (8,1046) (COF(K,II),II=1,N1A)
                              WRITE (8,*) (COF(K,II),II=1,N1A)
C42                         CONTINUE
                        ELSEIF (NSWT(K).EQ.2) THEN
                           WRITE (8,1045) NOF(K)
                           DO 43 K1=1,INDEX-1
                              WRITE (8,1050) (FKQ(K,K1,K2),K2=1,4),
     .                                       QF(K,K1),QF(K,K1+1)
43                         CONTINUE
                        ENDIF
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
                        WRITE (8,1085)
                        DO 441 K1=1,INDEX-1
                           QZZ=(QF(K,K1+1)-QF(K,K1))/5.0
                           DO 44 K2=1,5
                              QZZ1=QF(K,K1)+(K2-1)*QZZ
                              NFCWZ=NFCW(K)
                              IF (NSWT(K).EQ.2) THEN
C                             ======================
                                 CALL SPLINE (K,QZZ1,HZZ,TR,1)
                              ELSEIF (NSWT(K).EQ.1) THEN
C                             ==========================
                                 CALL LSFAN (K,QZZ1,HZZ,TR,1,0)
C                                ==============================
                              ENDIF
C                             =====
                              NFCW(K)=NFCWZ
                              HFN(K2)=HZZ
                              QFN(K2)=QZZ1
44                         CONTINUE
                           WRITE (8,1090) (QFN(K4)/1000.,HFN(K4),K4=1,5)
441                     CONTINUE
                     ENDIF
45                CONTINUE
               ENDIF
            ENDIF
         ENDIF
         WRITE (8,190) NB,NJ
         IF (NFNUM.GT.0) THEN
            DO 50 K=1,NFNUM
               DO 46 KK=1,NB
                  IF (NO(KK).EQ.NOF(K)) GO TO 47
46             CONTINUE
               GO TO 50
47             IF (NFCW(K).GT.0) WRITE (8,200) NOF(K)
               IF ((Q(KK).LT.0.0.AND.IABS(JS(KK)).EQ.JSB(KK)).OR.
     .            (Q(KK).GT.0.0.AND.IABS(JS(KK)).NE.JSB(KK)))
     .            WRITE (8,840) NOF(K)
50          CONTINUE
         ENDIF
      ELSE IF (IPT.EQ.3) THEN
C
C  ** LIST OF ADDITIONAL INFORMATION AND INPUT DATA FOR THE TEMP. AND
C     DYNAMIC SIMULATION PARTS OF MAIN PROGRAM.
C
         WRITE (8,1230)
         IF (IOUT.NE.0) THEN
            IF (NHM.GE.1) THEN
               WRITE (8,210)
               WRITE (8,220) (NO(I),JS(I),JF(I),DZRD(I),TROCK(I),PSI(I),
     .                        CH4V(I),HK(I),HA(I),I=1,NB)
            ELSE
               WRITE (8,800)
               WRITE (8,810) (NO(I),JS(I),JF(I),DZRD(I),TROCK(I),
     .                        CH4V(I),HK(I),HA(I),I=1,NB)
            ENDIF
         ENDIF
         WRITE (8,240) TSTART,JSTART
         IF (IOUT.NE.0) THEN
            IKL=0
            DO 14 I=1,NJ
               IF (JNO(I).NE.JSTART.AND.JNO(I).GE.900.AND.JNO(I).LE.950)
     .            IKL=1
14          CONTINUE
            IF (IKL.EQ.1) THEN
               WRITE (8,1210)
               DO 15 I=1,NJ
                  IF (JNO(I).NE.JSTART.AND.JNO(I).GE.900.
     .            AND.JNO(I).LE.950) THEN
                     WRITE (8,1220) JNO(I),T(I)
                  ENDIF
15             CONTINUE
            ENDIF
         ENDIF
         IF (INFLOW.GT.0) THEN
            WRITE (8,250)
            WRITE (8,260) (NCENT(I),CONT(I),CONC(I),HEAT(I),O2MIN(I),
     .                    SMPO2(I),HTPO2(I),TPR(I),QCENT(I),I=1,INFLOW)
         ELSE
            WRITE (8,270)
         ENDIF
         IAC=0
      ELSE IF (IPT.EQ.4) THEN
C
C  ** OUTPUT OF THE TEMPERATURE PART.
C
         IF (MARKX.GE.1.AND.MARKY.EQ.0) THEN
            IF (IAC.GT.0) THEN
               WRITE (8,860)
               DO 51 I=1,IAC
                  I1=IOMIT(I)
                  WRITE (8,870) NO(I1),JS(I1),ROMIT(I,1),ROMIT(I,2),
     .                          ROMIT(I,3)
51             CONTINUE
               IAC=0
            ENDIF
         ENDIF
         IF (MARKX.GE.1) THEN
            ITL=ITT
            JTL=ITN
         ELSE
            ITL=MADJC
            JTL=MADJ
         ENDIF
         IF (ITL.GE.JTL) THEN
            WRITE (8,690) SUMFNV/MNO
            KTL=0
            DO 52 I=1,NB
               NREVA=NREV(I)
               IF (MARKX.EQ.0) NREVA=NNREV(I)
               IF (NREVA.GE.JTL/3) THEN
                  IF (KTL.EQ.0) THEN
                     WRITE (8,700)
                     KTL=1
                  ENDIF
                  IF (NWTYP(I).EQ.1) THEN
                     PP=R(I)
                  ELSE
                     PP=R(I)*Q(I)*ABS(Q(I))*1.E-10
                  ENDIF
                  WRITE (8,710) NO(I),Q(I),PP,NREVA,ITL
               ENDIF
52          CONTINUE
         ELSE
            IF (SUMFNV/MNO.LE.2.E-4) WRITE (8,770) SUMFNV/MNO,ITL
            IF (SUMFNV/MNO.GT.2.E-4) WRITE (8,780) SUMFNV/MNO,ITL
         ENDIF
         IF (ITT.GE.ITN.OR.MADJC.GE.MADJ) THEN
            IZ=MADJ-9
            IF (MARKX.GT.0.AND.MARKY.EQ.0) IZ=ITN-9
            IF (ICYCLE.LE.0) THEN
               WRITE (8,890) (IJ,IJ=IZ,IZ+9)
            ELSE
               WRITE (8,900) ICYCLE,(IJ,IJ=IZ,IZ+9)
            ENDIF
            DO 1640 I=1,LSG
               K=LST(I)
               IF (JSB(K).EQ.JS(K)) THEN
                  JSS=JS(K)
                  JFF=JF(K)
               ELSE
                  JSS=JF(K)
                  JFF=JS(K)
               ENDIF
               WRITE (8,910) NO(K),JSS,JFF,(TMRCD(K,J),J=1,10)
               WRITE (8,920) (QRCD(K,J)/1000.0,J=1,10)
1640        CONTINUE
         ENDIF
         IF (MARKN.GT.0) WRITE (8,280) ITL
         IF (MARKC.GT.0) WRITE (8,290) ITL
         IF (MARKX.LE.0) THEN
            TT1 = TIME*3600.0
            IF (TACC.GT.TINC) THEN
               WRITE (8,520) TIME
            ENDIF
            WRITE(8,300)
            WRITE (8,310) (NO(I),IABS(JS(I)),IABS(JF(I)),Q(I),TMRD(I),
     .                     TRD(I),RDPROP(I),RDCH4(I),P(I),I=1,NB)
            WRITE (8,650)
            WRITE (8,660) (JNO(I),T(I),PROP(I),PRCH4(I),I=1,NJ)
         ELSE
C
C  ** OUTPUT OF THE DYNAMIC SIMULATION PART.
C
            WRITE (8,320) TACC
C
C     EVALUATION OF RELATIVE HUMIDITY AT AIRWAY ENDING.
C
            IF (NHM.GT.0) THEN
               DO 55 I=1,NB
                  TY=TRD(I)
                  IF (TY.GT.210.0) TY=210.0
                  IF (TY.LE.122.0) THEN
                     HU=-1.0682+0.07946*TY-0.00129*TY*TY+1.26E-5*TY**3
                  ELSE
                     HU=-33.786+0.97*TY-9.305E-3*TY*TY+3.65E-5*TY**3
                  ENDIF
                  PV=RDH2O(I)*101.35/(RDH2O(I)+0.622)
                  HBN(I)=PV/HU
                  IF (HBN(I).GE.1.0.AND.TY.GE.210.0) HBN(I)=1.E10
55             CONTINUE
               WRITE (8,330)
               WRITE (8,340) (NO(I),INT(DELTAQ(I)),INT(Q(I)),TMRD(I),
     .                        TRD(I),RDPROP(I),RDCH4(I),RDH2O(I),HBN(I),
     .                        P(I),I=1,NB)
            ELSE
               WRITE (8,750)
               WRITE (8,760) (NO(I),JS(I),JF(I),DELTAQ(I),Q(I),TMRD(I),
     .                        TRD(I),RDPROP(I),RDCH4(I),P(I),I=1,NB)
            ENDIF
            LI=0
            DO 60 I=1,NB
               IF (NSAC(I,1).EQ.1) THEN
                  LK=IBTN(I)
                  LM=0
                  IF (DPPA(LK,2,3).GE.1.E-4) LM=2
                  IF (DPPA(LK,1,3).GE.1.E-4) LM=1
                  IF (LM.GT.0) THEN
                     IF (LI.NE.1) THEN
                        LI=1
                        WRITE (8,350)
                     ENDIF
                     WRITE (8,360) NO(I),DPPA(LK,LM,1),JS(I),
     .                     DPPA(LK,LM,2),DPPA(LK,LM,3),DPPA(LK,LM,4)
                  ENDIF
               ENDIF
60          CONTINUE
            IF (INFLOW.GT.0) THEN
               IF (NHM.GT.0) THEN
                  WRITE (8,610)
               ELSE
                  WRITE (8,820)
               ENDIF
               DO 135 LRW=1,INFLOW
                  DO 132 JRW=1,NB
                     IF (NCENT(LRW).EQ.NO(JRW)) THEN
                        IF (NHM.GT.0) THEN
                           WRITE (8,620) NO(JRW),Q(JRW),TJS(JRW),
     .                           RDPROP(JRW),O2BEH(LRW),RDH2O(JRW)
     .                           ,HTAD(LRW)
                        ELSE
                           WRITE (8,830) NO(JRW),Q(JRW),TJS(JRW),
     .                                   RDPROP(JRW),O2BEH(LRW),
     .                                   HTAD(LRW)
                        ENDIF
                        GO TO 135
                     ENDIF
132               CONTINUE
135            CONTINUE
            ENDIF
C
C     EVALUATION OF RELATIVE HUMIDITY IN JUNCTIONS.
C
            IF (NHM.GT.0) THEN
               DO 65 I=1,NJ
                  TSS=T(I)
                  IF (TSS.GT.210.0) TSS=210.0
                  IF (TSS.LE.122.0) THEN
                     HU=-1.0682+0.07946*TSS-0.00129*TSS*TSS+
     .                  1.26E-5*TSS**3
                  ELSE
                     HU=-33.786+0.97*TSS-9.305E-3*TSS*TSS+3.65E-5*TSS**3
                  ENDIF
                  PV=PRH2O(I)*101.35/(PRH2O(I)+0.622)
                  HJN(I)=100.0*PV/HU
                  IF (HJN(I).GT.100.0) HJN(I)=100.0
65             CONTINUE
               WRITE (8,370)
               WRITE (8,380) (JNO(I),T(I),PROP(I),PRCH4(I),
     .                       PRH2O(I),HJN(I),I=1,NJ)
            ELSE
               WRITE (8,650)
               WRITE (8,660) (JNO(I),T(I),PROP(I),PRCH4(I),I=1,NJ)
            ENDIF
         ENDIF
         IF (NFNUM.GT.0) THEN
            DO 68 K=1,NFNUM
               IF (NFCW(K).GT.0.OR.NEGQ(K).GT.0) WRITE (8,200) NOF(K)
               IF (NEGQ(K).GT.0) WRITE (8,840) NOF(K)
68          CONTINUE
         ENDIF
         L=0
         DO 70 I=1,NB
            IF (JF(I).LT.0.OR.JS(I).LT.0) THEN
               IF (L.EQ.0) WRITE (8,720)
               L=L+1
               IRE(L)=NO(I)
            ENDIF
70       CONTINUE
         IF (L.GT.0) WRITE (8,730) (IRE(I),I=1,L)
         KTL=0
         DO 90 I=1,NB
            IF (MARKX.EQ.0) THEN
               NNREVA=NNREV(I)
            ELSE
               NNREVA=NREV(I)
            ENDIF
            IF ((NNREVA/2)*2.NE.NNREVA) THEN
               IF (KTL.EQ.0) THEN
                  WRITE (8,470)
                  KTL=1
               ENDIF
               IF (Q(I).GT.0.0) THEN
C              =====================
                  WRITE (8,480) NO(I),IABS(JS(I)),IABS(JF(I))
               ENDIF
C              =====
            ENDIF
90       CONTINUE
C
      ELSE IF (IPT.EQ.6) THEN
         WRNSUM=WRNPR+WRNGS+WRNSM+WRNHT
         IF (WRNSUM.LE.0.) THEN
            WRITE (8,410)
         ELSE
            J=0
            WRNP=WRNPR
            IF (PCRIT*0.05.LE.0.5*WRNPR) WRNP=PCRIT*0.05
            DO 75 I=1,NB
               K=0
               L=0
               M=0
               N=0
               IF ((100.*RDCH4(I)).GE.WRNGS) K=K+1
               IF ((100.*RDPROP(I)).GE.WRNSM) L=L+1
               IF (TRD(I).GE.WRNHT) M=M+1
               IF (P(I).LT.WRNP) N=N+1
               IF ((K+L+M+N).GT.0) THEN
                  IF (J.EQ.0) THEN
                     WRITE (8,420) WRNGS,WRNSM,WRNHT,WRNP
                     J=J+1
                  ENDIF
                  WRITE (8,430) NO(I),IABS(JS(I)),IABS(JF(I)),RDCH4(I),
     .                          RDPROP(I),TRD(I),P(I)
               ENDIF
75          CONTINUE
            IF (J.LE.0) WRITE (8,440)
            J=0
            DO 80 I=1,NJ
               K=0
               L=0
               M=0
               IF ((100.*PRCH4(I)).GE.WRNGS) K=K+1
               IF ((100.*PROP(I)).GE.WRNSM) L=L+1
               IF (T(I).GE.WRNHT) M=M+1
               IF ((K+L+M).GT.0) THEN
                  IF (J.EQ.0) THEN
                     WRITE (8,450) WRNGS,WRNSM,WRNHT,WRNGS,WRNSM,WRNHT
                     J=J+1
                  ENDIF
                  IF (J.EQ.1) THEN
                     JJ1=JNO(I)
                     PR1=PRCH4(I)
                     PR2=PROP(I)
                     PR3=T(I)
                     J=-J
                  ELSE
                     WRITE (8,460) JJ1,PR1,PR2,PR3,JNO(I),PRCH4(I),
     .                             PROP(I),T(I)
                     J=-J
                  ENDIF
               ENDIF
80          CONTINUE
            IF (J.LT.0) WRITE (8,460) JJ1,PR1,PR2,PR3
            IF (J.EQ.0) WRITE (8,445)
         ENDIF
      ELSE IF (IPT.EQ.5) THEN
         NRW=0
         DO 95 L=1,NB
            LL=IBTN(L)
            IF (LL.GT.0) THEN
               IF (NRW.EQ.0) THEN
                  WRITE (8,570)
                  NRW=1
               ENDIF
               LL1=NSAC(L,2)
               IF (LL1.GT.0) THEN
                  WRITE (8,580) NO(L),(DPPA(LL,JQ,1),JS(L),DPPA(LL,JQ,2)
     .                          ,TAUXA(LL,JQ),(DPPA(LL,JQ,JP),JP=3,5),
     .                          JQ=LL1,1,-1)
               ELSE
                  WRITE (8,640) NO(L),TJS(L),TRD(L),RDPROP(L)
               ENDIF
            ENDIF
95       CONTINUE
      ELSE
         NRW=0
         DO 100 L=1,NB
            LL=IBTN(L)
            IF (LL.GT.0) THEN
               IF (NRW.EQ.0) THEN
                  WRITE (8,590)
                  NRW=1
               ENDIF
               JLE=NSP(L)
               MRW=0
               DO 98 J=1,JLE
                  DIS=LA(L)*(J-1.0)/JLE
                  IF (MRW.EQ.0) THEN
                     WRITE (8,600) NO(L),DIS,JS(L),TDA(LL,J),STV(LL,J),
     .                             HABS(LL,J),WMTR(LL,J),GFF(LL,J),
     .                             WTCORR(LL,J)
                     MRW=1
                  ELSE
                     WRITE (8,740) DIS,JS(L),TDA(LL,J),STV(LL,J),
     .                             HABS(LL,J),WMTR(LL,J),GFF(LL,J),
     .                             WTCORR(LL,J)
                  ENDIF
98             CONTINUE
            ENDIF
100      CONTINUE
      ENDIF
C
      RETURN
C
110   FORMAT (///,22X,'NETWORK CALCULATION RESULTS ',/)
120   FORMAT (1X,'AIRWAY',2X,'FROM',4X,'TO',3X,'TYPE',8X,'RESISTANCE',
     .       7X,'AIRFLOW',6X,'HEADLOSS',/)
130   FORMAT (I5,I7,I6,I7,8X,E9.4,6X,F10.0,3X,F10.3)
140   FORMAT (//,' NETWORK CONTAINS NO FANS')
150   FORMAT (///,T20,'FANS'//' AIRWAY  FROM    TO      AIRFLOW    FAN',
     .       ' PRESSURE',/)
160   FORMAT (I5,I7,I7,F13.0,F13.3)
170   FORMAT (///,' THESE CHARACTERISTICS WERE STORED FOR FANS',5I5,/
     .        T45,5I5)
175   FORMAT (//,5('  Q*1000   PF '),/)
180   FORMAT (5(F8.1,F6.2)/,5(F8.1,F6.2),/)
190   FORMAT (///' THE STATED NUMBER OF AIRWAYS WAS',I9,/,' THE ',
     .       'STATED NUMBER OF JUNCTIONS WAS',I7,/)
200   FORMAT (/,1X,'FAN CHARACTERISTICS ARE EXCEEDED FOR FAN NO',I5)
210   FORMAT (///,T7,' INPUT DATA FOR CONCENTRATION AND TEMPERATURE',
     .       ' CALCULATION',//,T2,'AIRWAY  FROM  TO',T20,'ELEV DIFF',
     .       T31,'ROCK T',T40,'WETNESS',T50,'CH4 PROD.',T60,'COND.',T68,
     .       'DIFF.',/)
220   FORMAT (I5,I7,I4,T20,F8.1,T30,F7.1,T39,F7.2,T49,F8.2,T58,
     .       F7.2,T66,F7.3)
230   FORMAT (///,T10,' TIME AFTER BEGINNING OF EVENT',F7.2,'   HOURS')
240   FORMAT (///,' A TEMPERATURE OF',F7.1,'  WAS ASSIGNED TO ',
     .       'STARTING JUNCTION NO',I7)
250   FORMAT (///,T18,'THE FOLLOWING HEAT/CONTAMI. WAS ASSUMED',//,
     .       12X,'FIXED INFLUX',T31,'O2-RICH',T41,'FUEL-RICH',T55,
     .       'LEADING T',T67,'REF. Q',/,' AIRWAY  FLUX  %CONC',
     .       3X,'HEAT',5X,'%O2',4X,'FUMES',2X,'HEAT',/)
260   FORMAT (I5,F8.1,F6.2,1X,E9.3,F7.2,F7.2,F7.1,F10.2,F12.0)
270   FORMAT (///,1X,' NO HEAT/CONTAMINATION WAS SPECIFIED')
280   FORMAT (///,' THE NETWORK CALCULATION WAS NOT COMPLETED IN',
     .       I5,' ITERATIONS.')
285   FORMAT (///,' REF.TEMP.(TR): ',F6.1,' DEG.F',11X,'REF. DENSITY',
     .        ' (DR): ',F6.4,' LBM/FT3',///,' LIST OF UNITS USED IN ',
     .        'THIS OUTPUT FILE:',//,' LENGTH:  FT.;',T25,'AREA:    ',
     .        'FT2;',T42,'VOLUME:   FT3;',T61,'MASS:   LBM;',/,
     .        ' AIRFLOW: ','FT3/MIN;',T25,'TEMP.      F;',
     .        T42,'RESISTANCE:',1X,'1.E-10IN.W.G./CFM2;',/,' FRICTION',
     .        ' FACTOR:',1X,'1.E-10LBM*MIN2/FT4;',T42,'THERMAL DIFFUSI',
     .        'VITY:    FT2/HR;',/,' THERMAL CONDUCTIVITY:   BTU/HR*FT',
     .        '*F;',T42,'CONCENTRATION',7X,'PERCENTAGE;',/,' PRESSURE ',
     .        'DROP:',14X,'IN.W.G.;',T42,'HEAT INPUT:',12X,'BTU/MIN;',/,
     .        ' CH4 PRODUCTION:',13X,'FT3/MIN;',/,1X,
     .        'MARK FOR WALL CONDITIONS (NHM):',I2,' (0 DRY, 1 WET)')
290   FORMAT (///,' THE CALCULATION OF CONCENTRATIONS AND TEMPERA',
     .       'TURES WAS NOT',/,' COMPLETED IN',I5,' ITERATIONS.')
300   FORMAT (///,T8,'TEMP. AND CONCENTRA. AT AIRWAY ENDS, HEADLOSS IN'
     .       ,' AIRWAYS',//,' AIRWAY',T9,'FROM',T15,'TO',T20,'AIRFLOW',
     .       T31,'AVE. T',T40,'T AT END',T50,'FUMES',T57,'METHANE',T66,
     .       'P DROP',/)
310   FORMAT (I5,I6,I5,T18,0PF9.0,T30,0PF7.2,T40,0PF7.2,T49,2PF6.2,
     .       T56,2PF6.2,T66,0PF6.3)
320   FORMAT (///,T24,'AT',F7.0,' SEC. AFTER EVENT')
330   FORMAT (///,T4,'TEMPERATURE AND CONCENTRATION AT AIRWAY ENDS,',
     .       ' PRESSURES IN AIRWAYS',/,T16,'(BY THE END OF THE ',
     .       'CURRENT TIME INTERVAL)',//,2X,' NO',T7,'DELTA Q',T15,
     .       'AIRFLOW',T23,'AVE T',T30,'T AT END',T39,'FUMES',T45,
     .       'CH4',T50,'HUM RATIO',T60,'REL HUM',T70,'P',/)
340   FORMAT (1X,I4,T7,I7,T14,I7,T21,0PF7.1,T30,0PF7.1,T37,
     .       2PF6.2,T43,2PF6.2,T52,0PF7.5,T60,2PF6.2,T67,0PF6.3)
350   FORMAT (///,T21,'DATA FOR THE FUME FRONT IN AIRWAYS',
     .       //,1X,'AIRWAY',T11,'POSITION',T26,'FROM',
     .       T37,'TEMPERATURE',T51,'FUME',T61,'METHANE',/)
360   FORMAT (1X,I5,T11,0PF7.2,T25,I5,T38,0PF8.2,T49,2PF6.2,T61,2PF6.2)
370   FORMAT (///,T3,'PARAMETERS OF AIR IN JUNCTIONS AT ',
     .       'BEGINNING OF CURRENT TIME INTERVAL',//,' JUNCTION',
     .       T15,'T',T25,'FUMES',T38,'CH4',T47,'HUM. RATIO',T65,
     .       'REL. HUM',/)
380   FORMAT (I5,T11,0PF7.2,T22,2PF8.2,T35,2PF6.2,T49,0PF7.5,
     .       T65,0PF7.2)
410   FORMAT (///,1X,'NO THRESHOLD FOR CRITICAL STATES ',
     .       'WERE SPECIFIED.')
420   FORMAT (///,9X,'IN THE FOLLOWING AIRWAYS EXIST CRITICAL ',
     .       'CONDITIONS',//,1X,'AIRWAY',T10,'FROM',T16,'TO',T22,'CH4 %'
     .       ,T33,'FUMES %',T45,'TEMPERATURE',T61,'HEADLOSS',/,
     .       T22,'>',F5.3,T33,'>',F6.3,T46,'>',F5.0,' F',T59,
     .       '<',F6.3,' IN.WG.',/)
430   FORMAT (I5,I7,I5,T21,2PF6.2,T32,2PF8.3,T45,0PF8.1,T62,0PF6.3)
440   FORMAT (///,1X,'NO CRITICAL CONDITIONS AT AIRWAY ENDS ',
     .       'WERE DETECTED')
445   FORMAT (///,1X,'NO CRITICAL CONDITIONS IN JUNCTIONS WERE ',
     .       'DETECTED.')
450   FORMAT (///,10X,'IN THE FOLLOWING JUNCTIONS EXIST CRITICAL ',
     .       'CONDITIONS',//,' JUNCTION',T11,'CH4  %',T19,'FUMES %',T28
     .       ,'TEMP. F',T40,'JUNCTION',T49,'CH4  %',T57,'FUMES %',T66,
     .       'TEMP. F',/,T11,'>',F5.2,T19,'>',F6.3,T29,'>',F5.0,T49,
     .       '>',F5.2,T57,'>',F6.3,T67,'>',F5.0,/)
460   FORMAT (I6,T11,2PF5.2,T17,2PF8.2,T27,0PF7.1,T39,I6,T49,2PF5.2,
     .       T55,2PF8.2,T65,0PF7.1)
470   FORMAT (///,' REVERSAL OF AIRFLOW HAS OCCURRED IN THE ',
     .       'FOLLOWING PLACES',//)
480   FORMAT (' AIRWAY',I6,' IS NOW CARRYING AIR FROM ',I6,' TO ',I6)
490   FORMAT (///,15X,'BASIC DATA FOR AIRWAYS IN THE NETWORK',
     .       //,' AIRWAY FROM',T15,'TO',T22,'AIRFLOW',T30,'TYPE',T37,
     .       'LENGTH',T47,'AREA',T57,'R',T64,'K',T68,'PERI.',/)
500   FORMAT (I5,I6,T13,I4,T19,F10.0,T30,I3,T36,F7.1,T44,F7.1,T53,E8.3,
     .       T62,I4,F7.1)
520   FORMAT (///,T24,'AT',F5.1,' HR. AFTER EVENT',//,T12,'(ASSUMING',
     .       1X,'QUASI-EQUALIBRIUM AND DRY CONDITIONS)')
570   FORMAT (///,23X,'DATA RECORD IN AIRWAYS',//,1X,'AIRWAY',T12,
     .       'DIST.',T19,'FROM',T26,'FRONT T',T37,'REAR T',
     .       T47,'FUME',T57,'CH4',T63,'AIR M (LB)',/)
580   FORMAT (1X,I5,11(T8,0PF9.2,T17,I5,T24,0PF9.2,T34,0PF9.2,T44,
     .       2PF7.2,T53,2PF7.2,T62,0PF9.2,/))
590   FORMAT (///,18X,'WATER EVAPO./CONDEN. DATA IN AIRWAYS',/,T16,
     .       'EVAPO. (LB/100FT2); CONDEN. (LB/100LB AIR)',//,
     .       ' AIRWAY',T10,'DIST.',T16,'FROM',T22,'AIR T',
     .       T29,'WALL T',T37,'HUM. RATIO',T49,'EVAPO.',T57,
     .       'CONDEN.',T66,'T CORR.',/)
600   FORMAT (/,T2,I5,T8,0PF7.1,T15,I5,T20,0PF7.1,T27,0PF8.1,
     .       T37,0PF8.5,T46,2PF8.4,T55,2PF8.4,T64,0PF8.2)
610   FORMAT (///,28X,'DATA FOR FIRE SOURCES',//,T2,'AIRWAY',T11,
     .       'AIRFLOW',T24,'TEMP.',T34,'FUME',T43,'O2 LEFT',T53,
     .       'H2O VAPOR',T66,'HEAT IN',/,T4,'NO.',T11,'FT3/MIN',
     .       T25,'(F)',T35,'(%)',T45,'(%)',T53,'LB/LB AIR',T66,
     .       'BTU/MIN',/)
620   FORMAT (T2,I5,T10,0PF8.0,T21,0PF8.2,T32,2PF6.3,T44,0PF6.3,
     .       T54,0PF6.4,T64,0PF9.0)
630   FORMAT (///,' ')
640   FORMAT (1X,I5,T9,'NO C.V. T(BGG)=',0PF7.1,', T(END)=',0PF7.1,',
     .       FUME=',2PF5.2,'%.',/)
650   FORMAT (///,16X,'PARAMETERS OF AIR IN JUNCTIONS',//,1X,'JUNCTION'
     .       ,T13,'TEMP.',T20,'FUMES',T27,'METHANE',T39,'JUNCTION',T50,
     .       'TEMP.',T57,'FUMES',T64,'METHANE',/)
660   FORMAT (I6,T9,0PF9.2,T18,2PF7.2,T26,2PF7.2,T38,I6,T47,0PF8.1,T55,
     .       2PF7.2,T63,2PF7.2)
690   FORMAT (///,1X,'THE CALCULATION WAS NOT COMPLETED SINCE',1X,
     .       'THE NUMBER OF ',/,' EXCHANGES BETWEEN NETWORK AND',
     .       ' TEMPERATURE PARTS BECAME EXCESSIVE.',/,
     .       1X,'CRITERIA: NVP CORR. < 0.0002 IN.W.G., CURRENT:',
     .       ' NVP CORR. ',F7.4)
700   FORMAT (//,1X,'THE FOLLOWING UNSTABLE AIRWAYS WERE',1X,
     .       'DETECTED:')
710   FORMAT (/,1X,'AIRWAY',I6,' OF AIRFLOW ',F7.0,' (CFM) & P. ',
     .       'DROP',F6.3,' IN.W.G. HAD ITS',/,' AIRFLOW REVERSED',I3,
     .       ' TIMES IN',I3,' ITERATIONS.')
720   FORMAT (///,' RECIRCULATION WAS DETECTED IN THE SYSTEM. ',
     .       1X,'THE FOLLOWING AIRWAYS',/,' WERE INVOLVED ',
     .       'IN THE RECIRCULATION PATH(ES):',/)
730   FORMAT (1X,10I7)
740   FORMAT (T8,0PF7.1,T15,I5,T20,0PF7.1,T27,0PF8.1,T37,0PF8.5,T46,
     .       2PF8.4,T55,2PF8.4,T64,0PF8.2)
750   FORMAT (///,T3,'TEMPERATURES AND CONCENTRATIONS AT AIRWAY ',
     .       'ENDS, PRESSURES IN AIRWAYS',/,T15,'(BY THE END OF THE ',
     .       'CURRENT TIME INTERVAL)',//,' AIRWAY',T9,'FROM',T15,
     .       'TO',T20,'DELTA Q',T29,'AIRFLOW',T38,'AVE. T',T46,
     .       'T AT END',T56,'FUMES',T64,'CH4',T70,'P',/)
760   FORMAT (1X,I5,I6,I5,T19,0PF8.0,T27,0PF8.0,T37,0PF7.2,T46,
     .       0PF7.2,T55,2PF6.2,T61,2PF6.2,T67,0PF6.3)
770   FORMAT (///,' THRESHOLD IN ACCURACY (SUM OF NVP CORRECTIONS ',
     .       'PER MESH < 2.E-4 IN.W.G.)',/,' SATISFIED. CURRENT ',
     .       'SUMFNV PER MESH',F9.6,' IN.W.G.,   ITERATIONS ',I5)
780   FORMAT (///,1X,'THRESHOLD IN ACCURACY (SUM OF NVP',1X,
     .       'CORRECTIONS PER MESH<2.E-4 IN. W.G.)',/,' NOT ',
     .       'SATISFIED. CURRENT SUMFNV:',F9.6,' IN.W.G., ITER.',I5)
800   FORMAT (///,T2,' INPUT DATA FOR CONCENTRATION AND TEMPERATURE',
     .       ' CALCULATION',//,T2,'AIRWAY  FROM  TO',T20,'ELEV DIFF',
     .       T31,'ROCK T',T41,'CH4 PROD.',T51,'COND.',T61,'DIFF.',/)
810   FORMAT (I5,I7,I4,T20,F8.1,T30,F7.1,T41,F7.2,T49,F7.2,T59,F7.3)
820   FORMAT (///,28X,'DATA FOR FIRE SOURCES',//,T2,'AIRWAY',T11,
     .       'AIRFLOW',T24,'TEMP.',T34,'FUME',T48,'O2 LEFT',
     .                   T66,'HEAT IN',/,T4,'NO.',T11,'FT3/MIN',
     .       T25,'(F)',T35,'(%)',T50,'(%)',T66,'BTU/MIN',/)
830   FORMAT (T2,I5,T10,0PF8.0,T21,0PF8.2,T32,2PF6.3,T49,0PF6.3,
     .       T64,0PF9.0)
840   FORMAT (/,1X,'* WRN * AIRFLOW REVERSED FOR FAN NO.',I5)
850   FORMAT (//,1X,'HEAT SOURCE IN AIRWAY',I6,' HAD REDUCED HEAT INPUT'
     .       ,' AS',F9.0,' BTU/MIN',/,1X,'FOR THE HIGH TEMPERATURE IN',
     .       ' THE CURRENT TIME INTERVAL.')
860   FORMAT (///,1X,'THE FOLLOWING DATA RECORDS WERE OMITTED DUE TO ',
     .       'ARRAY CAPACITIES.',//,T2,'AIRWAY',T20,'PARAMETERS AT ',
     .       'STARTING JUNCTIONS IN THE CURRENT TIME INTERVAL',/,T27,
     .       'JS',T36,'TEMPERATURE',T51,'FUME %',T66,'CH4 %',/)
870   FORMAT (T2,I5,T24,I5,T36,F8.1,T49,F7.3,T64,F7.3)
890   FORMAT (///,1X,'THE FAILURE IN CONVERGING WAS NOT CAUSED BY A ',
     .       ' CYCLIC PATTERN.',/,' RELEVANT DATA ARE SHOWN BELOW:',
     .       ' ("ITR" STANDS FOR ITERATION)',//,' UNITS: Q: AIRFLOW ',
     .       'RATE IN 1000FT3/MIN;',17X,'T: TEMP. IN F;',/,8X,'H: NVP ',
     .       'CORRECTION PER MESH IN IN.W.G.',//,' ITR',T5,I5,9I7,/)
900   FORMAT (///,1X,'THE FAILURE IN CONVERGING WAS CAUSED BY A CYCLIC',
     .       ' PATTERN IN EVERY',I3,/,' ITERATIONS AS SHOWN BELOW:',
     .       ' ("ITR" STANDS FOR ITERATION)',//,' UNITS: Q: AIRFLOW ',
     .       'RATE IN 1000FT3/MIN;',17X,'T: TEMP. IN F;',/,8X,'H: NVP ',
     .       'CORRECTION PER MESH IN IN.W.G.',//,' ITR',T5,I5,9I7,/)
905   FORMAT (1X,'H',T3,10(1X,F6.4),/)
910   FORMAT (1X,'AIRWAY: ',I4,10X,'JS:',I4,6X,'JF:',I4,/,1X,
     .       'T',T3,10F7.1)
920   FORMAT (1X,'Q',T3,10F7.1,/)
980   FORMAT (///,T2,'JUNCTION',T12,'TEMP.',T20,'ELEVATION',T32,'CH4',
     .       T40,'JUNCTION',T50,'TEMP.',T58,'ELEVATION',T70,'CH4',/)
990   FORMAT (T2,I5,T10,F7.1,T19,F8.1,T30,F5.2,T40,I5,T48,F7.1,T57,F8.1
     .       ,T68,F5.2)
1040  FORMAT (///,15X,'COEFF. OF POLYNOMIAL OF FAN CURVES',/,20X,
     .       'PF=A0+A1*Q+A2*Q**2+A3*Q**3')
1044  FORMAT (/,T5,'FAN',I5,//,T7,'A0',T19,'A1',T31,'A2',T43,'A3',/)
C====================================================================
1045  FORMAT (/,T5,'FAN',I5,//,T7,'A0',T19,'A1',T31,'A2',T43,'A3',T52,
     .       'FROM QF',T65,'TO QF',/)
1046  FORMAT (T3,E9.3,T15,E9.3,T27,E9.3,T39,E9.3)
C=================================================
1050  FORMAT (T3,E9.3,T15,E9.3,T27,E9.3,T39,E9.3,T51,E9.3,T63,E9.3)
1085  FORMAT (/,2X,'INTERPOLATION:',/,5('  Q*1000   PF '),/)
1090  FORMAT (5(F8.1,F6.2))
1210  FORMAT (//,' THE FOLLOWING SURFACE JUNCTIONS ARE DECLARED:',/)
1220  FORMAT (' JUNCTION ',I5,' IN THE ATMOSPHERE WITH TEMPERATURE ',
     .        F8.1,' DEGREES F.')
1230  FORMAT (/,' * ATTN * A NEW BRANCH HAS BEEN SET UP FOR EACH HEAT ',
     .       'SOURCE.',//)
C
      END

