********************************************************************************
*                                                                              *
*  2DHF version 1-2003                                                         *
*  Copyright (C) 1996  Jacek Kobus, Leif Laaksonen, Dage Sundholm              *
*                                                                              *
*  This software may be used and distributed according to the terms            *
*  of the GNU General Public License, see README and COPYING.                  *
*                                                                              *
********************************************************************************
c ### dbgp ###
c
c     Prints out debug messages
c     idbgp - idbg point number
c     csub  - routine name
c     cmess - message
c     array - array to be printed; every incrni row and every incrmu column 
c             is printed
c     n1,n2 - dimension(s) of the array; set n2=0 to indicate 1-dimensional array

      subroutine dbgp (idbgp,csub,cmess,array,n1,n2)
      implicit integer*4 (i-n)
      implicit real*8 (a-h,o-z)
      include 'commons8.inc'
      dimension array(n1,*)

      if(idbg(idbgp).ne.0) then
         write(iout6,1000) csub,idbgp
         write(iout6,1010) cmess

         if (n2.eq.0) then
c           print out 1-dim array
            write(iout6,1020) (array(i,1),i=1,n1,incrni)
         else 
c           print out 2-dim array
            do i=1,n1,incrni
               write(6,1000) i, (array(i,j),j=1,n2,incrmu)
            enddo
	 endif
      endif

01000 format(1x,'$$$ debug printout from routine:',15a1,
     &     '; idbg:',i3,1x,'$$$')
01010 format(1x,75a1)
01020 format(/,(5x,5d18.8))
01030 format(/,1x,i4,5d18.8,/(5x,5d18.8))
      return
      end
