      subroutine su3_wloops(imeas) ! Bazavov / Berg March 4 2008.
C SU3 space- and time-like 1x1 Wilson loops. 
      include '../../Libs/Fortran/implicit.sta'
      include '../../Libs/Fortran/constants.par'
      include '../../Libs/Fortran_par/lat.par'
      include '../../Libs/Fortran_par/mc.par'
      include '../../Libs/Fortran_par/common_lat.f'
      include '../../Libs/SU3_par/common_su3.f'
      dimension am1(1:18), am2(1:18)
      ws=zero
      wt=zero
      do is=1,ms      ! Loop over sites.
        do id1=1,nd-1 ! Loop over plaquettes.
          do id2=id1+1,nd
            call su3mult_m_mh_m(alsu3(1,id2,ipf(id1,is)),
     &                          alsu3(1,id1,ipf(id2,is)),am1)
            call su3mult_m_mh_m(am1,alsu3(1,id2,is),am2)
            call su3mult_m_m_m(am2,alsu3(1,id1,is),am1) ! result in am1.
            trace=am1(1)+am1(5)+am1(9)      ! Real part of trace of am1.
            if((id1.ne.nd).and.(id2.ne.nd)) then ! nd is time direction.
              ws=ws+trace/3 ! Add to Wilson space-loop.
            else
              wt=wt+trace/3 ! Add to Wilson time-loop.
            endif
          end do
        end do
      end do
      tsws(imeas)=ws/npspace
      tswt(imeas)=wt/nptime
      return
      end
