        subroutine inaction
        implicit none
        include 'pimc.par'
        integer il,nb,l,js,jsp,i,is,k,ik
        integer n,m,js1,is1,it
        real*8 coulomb
        include 'pimc.cm'
        
        cpot=0.0
c   Initial action
        do n=1,np
c intramolecular contribution
         do js=1,nslices
          js1=iwrap(js-1)
          spring(n,js)=0.
          do l=1,ndim
           spring(n,js) = spring(n,js)+(pbc(x(l,n,js),x(l,n,js1),l))**2
          enddo
          spring(n,js)=spring(n,js)*cke
c el-el contribution
          do m=1,n-1
           cpot=cpot+coulomb(x(1,n,js),x(1,m,js)
     &                      ,x(1,n,js1),x(1,m,js1),ndim)
          enddo
c el-pr contribution
          do m=1,2
           cpot=cpot-zp*coulomb(x(1,n,js),proton(1,m)
     &                         ,x(1,n,js1),proton(1,m),ndim)
          enddo
         enddo
        enddo
c computes reciprocal space contributions
        if(bond.ne.0.d0) cpot=cpot+charge/bond
        action=cpot
        write (2,*) 'initial action = ',action
        write (*,*) 'initial action = ',action

        return
        end
