module fst4_bitmetrics implicit none type fst4_bitmetrics_workspace complex, allocatable :: ci(:,:) logical, allocatable :: one(:,:),zero(:,:) real, allocatable :: s2(:) integer :: nss=0 end type contains subroutine get_fst4_bitmetrics_owned(work,cd,nss,bitmetrics,s4,nsync_qual,badsync) use timer_module, only: timer implicit real(a-h,o-z) implicit integer(i-n) include 'fst4_params.f90' complex cd(0:NN*nss-1) complex cs(0:3,NN) type(fst4_bitmetrics_workspace), intent(inout), target :: work complex c1(4,8),c2(16,4),c4(256,2) integer isyncword1(0:7),isyncword2(0:7) integer graymap(0:3) integer ip(1) integer hbits(2*NN) logical badsync real bitmetrics(2*NN,4) real s4(0:3,NN) data isyncword1/0,1,3,2,1,0,2,3/ data isyncword2/2,3,1,0,3,2,0,1/ data graymap/0,1,3,2/ if(.not.allocated(work%one)) then allocate(work%one(0:65535,0:15),work%zero(0:65535,0:15),work%s2(0:65535)) do i=0,65535 do j=0,15 work%one(i,j)=btest(i,j) work%zero(i,j)=.not.work%one(i,j) enddo enddo endif if(nss.ne.work%nss) then if(allocated(work%ci)) then if(size(work%ci,1)