C
C------------------------------------------------------
c      SUBROUTINE BARIC(Q,INF,ISUP,BAR,EPLA4,INDEX)
      INTEGER FUNCTION BARIC(Q,INF,ISUP,BAR,EPLA4,INDEX)
C------------------------------------------------------
      INCLUDE 'INTEST.TXT'
      REAL Q(NCHA)
      REAL BAR
      REAL CM, EPLA4, ENN
      INTEGER INF,ISUP,INDEX, LL
      COMMON / SHIFT / SHIFT
      SAVE / SHIFT /
      DATA CM / 0. /
c      DATA EPLA4 / 0. /
      DATA ENN / 0. /

      BARIC = 0

      LL = 0
      CM = 0.
      EPLA4 = 0.
      if ( index*Q(1) .eq. -2000.323311 ) then
c         index = 10
         print *,' BEWARE!'
         print *,' this is the GHOST of the compilation '
         print *,' you have awakened me too soon '
         print *,' I will launch an anatema against you!'
      endif
      DO LL = INF,ISUP
        ENN = Q(LL)
        IF (ENN.GT.EMIN) THEN
C
          CALL MILLIM(LL,RMM)
C
          CM = CM + RMM * ENN
          EPLA4 = EPLA4 + ENN
        ENDIF
      ENDDO
      IF (EPLA4.EQ.0) GO TO 300
      BAR = CM / EPLA4
      GOTO 400
C
  300 INDEX = 0
      GOTO 500
C
  400 INDEX = 1
C
  500 CONTINUE
      RETURN
      END
C
