*   SAMPLE3.FOR
*
      SUBROUTINE SAMPLE3
*
*--sample the molecules in the flow.
*
      include 'parameter.inc'
*
      DOUBLE PRECISION COL(MNSP,MNSP),MOVT,NCOL,SELT,SEPT,CS(7,MNC,MNSP)
      DOUBLE PRECISION CSR(MNC,MNSP)
*
      NSMP=NSMP+1
      DO 100 NN=1,MNSG
        DO 50 N=1,MNC
          L=IC(2,N,NN)
          IF (L.GT.0) THEN
            DO 10 J=1,L
              K=IC(1,N,NN)+J
              M=IR(K)
              IF (MNSP.GT.1) THEN
                I=IPS(M)
              ELSE
                I=1
              END IF
              CS(1,N,I)=CS(1,N,I)+1
              DO 5 LL=1,3
                CS(LL+1,N,I)=CS(LL+1,N,I)+PV(LL,M)
                CS(LL+4,N,I)=CS(LL+4,N,I)+PV(LL,M)**2
5             CONTINUE
              IF (MNMR.GT.1) CSR(N,I)=CSR(N,I)+PR(M)
10          CONTINUE
          END IF
50      CONTINUE
100   CONTINUE
      RETURN
      END
