      subroutine on_act(sta,ipf,n,ns,nd,act) ! bernd berg, feb 13 2002.
c calculates action value act.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      dimension sta(n,ns),ipf(nd,ns)
      act=zero
      do is=1,ns        
        do id=1,nd
          do i=1,n
            act=act+sta(i,is)*sta(i,ipf(id,is))
          end do
        end do
      end do
      return
      end
