C
C
      SUBROUTINE  PREP (MRC,LST)
C
C     ------------------------------------------------------------------
C
C       SUBROUTINE PURPOSE:
C       PREPARATION OF CALCULATED INTERMEDIATE RESULTS AS THE INITIAL
C     VALUES FOR THE NEXT ROUND OF ITERATIONS IN THE CASE WHEN
C     RECIRCULATION HAPPENS.
C
C     ------------------------------------------------------------------
C
      INCLUDE 'CMMNW.DAT'
C
      DO 10 I=1,NB
         JF(I)=IABS(JF(I))
10    CONTINUE
      DO 20 I=1,NJ
         JNO(I)=IABS(JNO(I))
20    CONTINUE
      LST=0
      IF (MRC.EQ.0) RETURN
      DO 30 I=1,MRC
         K=NOREC(I)
         DIFPR=ESTPR(I)-RDPROP(K)
         DIFCH4=ESTCH4(I)-RDCH4(K)
         DIFTRD=ESTTR(I)-TRD(K)
C
C       WHEN THE VARIATIONS IN TEMP. OR CONTAMINANT CONTENT ARE LARGER
C     THAN THE USER-SPECIFIED CRITERIA (LST>0), MORE ITERATIONS WILL BE
C     PERFORMED.
C
         IF (ABS(DIFPR).GE.(CRITSM/100.)) LST=LST+1
         IF (ABS(DIFCH4).GE.(CRITGS/100.)) LST=LST+1
         IF (ABS(DIFTRD).GE.(CRITHT)) LST=LST+1
C
C       CALCULATED AIR TEMP., CH4 AND FUME CONTENT AT AIRWAY ENDING
C     ARE USED AS NEW ESTIMATIONS FOR THE NEXT ITERATION.
C
         ESTPR(I)=RDPROP(K)
         ESTCH4(I)=RDCH4(K)
         ESTTR(I)=TRD(K)
         JF(K)=-JF(K)
30    CONTINUE
C
      RETURN
      END
