      subroutine su3_act(actnew) 
c Alexei Bazavov / Bernd Berg Mar 04 2008. SU(3) action.
      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)
      actnew=zero
c Loop on sites
      do is=1,ms
c Loop on plaquettes
        do id1=1,nd-1
          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[matrix am1].
            actnew=actnew+trace/three  ! Addition to action.
          end do
        end do
      end do
c
      return
      end
