      program aapimc
      include 'mach.p'

c janor add
      include 'upi.cm'
      include 'cpbc.cm'

      integer ijar,jjar,kjar
c end janor add

      write (6,*)' upi9k.dc Nov. 18,1997'

c D. Ceperley UIUC
c put global comments about major version updates here
c 3/10/91-1.1 try importance sampled nodal surfaces
c 6/7/91 -1.2 put in configurations saver and energy calculator
c        change the way configurations are stored at join
c 8/20/91 finish put in table for one body density matrix
c 9/16/91 -1.3 input aged configurations and external 1-d potential
c 11/19/91 -1.4 put in multiple reference points 
c 12/16/91 put in reference point moves
c 5/27/92  begun ewald sums and displace
c 9/8/92 added new style dm. files
c 12/11/92 using no-implicit
c 12/23/93 introducing lines and planes and arbitrary grids.
c 4/15/93 permute driver added
c 4/30/93 upi5: use rmin for nodal action in first link instead of determinant
c          and redo cycle and windup to add rhos to averages
c 9/16/93 upi8: added action
c 10/97 upi9h added backflow


! janor add
      do jjar=1,nydistjar
         do ijar=1,nxdistjar
            densdistxy(ijar,jjar)=0.d0
         end do
      end do
      do kjar=1,nzdistjar
         do ijar=1,nxdistjar
            densdistxz(ijar,kjar)=0.d0
         end do
      end do
      do kjar=1,nrdistjar
         densdistr(kjar)=0.d0
      end do
! end janor add

! janor add
      open(unit=50,file='configs.dat',        status='unknown')
      open(unit=51,file='config_params.dat',  status='unknown')
      open(unit=52,file='step_params.dat',    status='unknown')
      open(unit=53,file='write_configs.input',status='unknown')      
      open(unit=58,file='r2.dat',             status='unknown')      
      read(53,530)write_config_file
      read(53,530)ntskipjar
      read(53,530)ntsteadyjar
      read(53,530)write_r2_file
 530  format(i6)
! end janor add

      ntjar=0

      call driver ! transfer to driver of the simulation


! janor add

      close(unit=50)
      close(unit=51)
      close(unit=52)
      close(unit=53)
      close(unit=58)
! end janor add


      end
