      SUBROUTINE rptlly(datakx,datatyp,nrep,irpfrm)
      include 'params.h'
      include 'processors.h'
c  Tally the number of quality reports read in to the analysis.
      INTEGER nrep
      REAL datakx(nrep), datatyp(nrep)
!hpf$ distribute datakx(block) onto PROC_ARRAY_1D
!hpf$ distribute datatyp(block) onto PROC_ARRAY_1D

      INTEGER i
      INTEGER irpfrm
      INTEGER k

      integer nobs(mxqobs, 5)
      COMMON / dattab / nobs
      integer nobs_t1(nrep,5)
!hpf$ distribute nobs_t1(block,*)
      COMMON / obs / maxdex, nfgge, lun, hh (13, 13, 20),
     &vcoroe (18, 18, 4), obserr (mxqobs, 4, 19), ww (13, 13, 20),
     &qobs (mxqobs, 5), offlev (mxqobs)
      common / obschar / dataname (5), obsname(mxqobs)

      CHARACTER * 8 dataname, obsname
      LOGICAL qobs, offlev
c  Zero out the tally array at the start of each analysis.



      IF (irpfrm .EQ. 1) THEN
        nobs = 0
      ENDIF
c  Tally up the reports which passed quality control.
      nobs_t1=0
      do k=1,mxqobs
        if(irpfrm .EQ. 1 .OR. irpfrm .EQ. 3 
     &     .OR. irpfrm .EQ. 4) then
          WHERE(datatyp .EQ. 1..AND.k.EQ.int(datakx(1:nrep))) 
            nobs_t1(:,irpfrm) = 1
          ENDWHERE
        else
          WHERE(datatyp .GE. 2..AND.k.EQ.int(datakx(1:nrep)))
            nobs_t1(:,irpfrm) = 1
          ENDWHERE
        endif
        nobs(k,irpfrm)=sum(nobs_t1(:,irpfrm),DIM=1)
      enddo
      RETURN
      END
