C
C
      SUBROUTINE  CH4EVA
C
C     ------------------------------------------------------------------
C
C       SUBROUTINE PURPOSE:
C       EVALUATION OF METHANE EMISSION RATES IN AIRWAYS.
C
C     ------------------------------------------------------------------
C
      INCLUDE 'CMMNW.DAT'
C
C     CH4C(J): CH4 CONCENTRATION IN JUNCTION JNO(J).
C     CH4V(I): CH4 EMISSION RATES IN AIRWAY NO(I).
C     CH4PA(I): CH4 EMISSION RATE PER UNIT SURFACE AREA.
C
      DO 40 I=1,NB
         IF (CH4V(I).GT.0.0) GO TO 40
         CH4V(I)=CH4PA(I)*LA(I)*O(I)
         IF (CH4V(I).GT.0.0) GO TO 40
         M=0
         N=0
         DO 30 L=1,NJ
            IF (JS(I).EQ.JNO(L)) THEN
               CH4S=CH4C(L)
               M=1
            ENDIF
            IF (JF(I).EQ.JNO(L)) THEN
               CH4F=CH4C(L)
               N=1
            ENDIF
            IF (M+N.GT.1) THEN
               IF (CH4F.GT.CH4S.AND.Q(I).GT.0.0) THEN
                  CH4V(I)=(CH4F-CH4S)*Q(I)/100.0
               ELSE IF (CH4F.LT.CH4S.AND.Q(I).LT.0.0) THEN
                  CH4V(I)=(CH4F-CH4S)*Q(I)/100.0
               ELSE
                  CH4V(I)=0.0
               ENDIF
               GO TO 40
            ENDIF
30       CONTINUE
40    CONTINUE
C
      RETURN
      END
