        parameter(n=7984)
        real zpho_gal(n),P_mem(n)
        integer icount(10)
        real z(10)

        open(1,file='../data/z_p_gal.tbl',status='old')

        do j=1,10
          icount(j)=0
          z(j)=0.1*(j-1)+0.05
        enddo

        do 100 i=1,n
        read(1,*) zpho_gal(i),P_mem(i)
********calculate over and over again and paste them 
********into gal_count_zbin.tbl
        if(P_mem(i).lt.0.1) goto 100
c        if(P_mem(i).lt.0.3) goto 100
c        if(P_mem(i).lt.0.5) goto 100
c        if(P_mem(i).lt.0.7) goto 100
c        if(P_mem(i).lt.0.9) goto 100

          do 200 j=1,10
            if(zpho_gal(i).ge.(z(j)-0.0500001).and.
     +        zpho_gal(i).le.(z(j)+0.0500001))then
              icount(j)=icount(j)+1
          end if
               
200     continue
100     continue

        print*,(icount(j),j=1,10)
c   101	format(i3,1x,i1,1x,i3,1x,f8.6,1x,f5.3,1x,f8.6)
        close(1)
        end
