*
***********************************************************************
*
      subroutine split_left (job,q,iq,x,y)
*
***********************************************************************
*
*      Perform Diagonal Preconditioning by the following:
*
*     A*x = b
*
*     D^(-1/2)*A*D^(-1/2)*D^(1/2)*x = D^(-1/2)*b
*     D = diagonal of A
*
*     This routine performs the left preconditioning step.
*
***********************************************************************
*
*     #include "poisson.h"

#ifdef CMFORTRAN
#include "cm/cmssl-cmf.h"
#endif

      integer job
      integer iq(3,1,1,1)
#ifdef CMFORTRAN
cmf$ layout iq(:serial,:news,:news,:news)
#elif HPF
CHPF$ DISTRIBUTE iq(*, BLOCK, BLOCK, BLOCK)
#endif

#ifdef CMFORTRAN
      real, array(7,idim-2,jdim-2,kdim-2) :: q
      real, array(1,idim-2,jdim-2,kdim-2) :: x,y
cmf$ layout q(:serial,:news,:news,:news)
cmf$ layout x(:serial,:news,:news,:news)
cmf$ layout y(:serial,:news,:news,:news)
#elif HPF
      real, DIMENSION(7,idim-2,jdim-2,kdim-2) :: q
      real, DIMENSION(1,idim-2,jdim-2,kdim-2) :: x,y
CHPF$ DISTRIBUTE q(*, BLOCK, BLOCK, BLOCK)
CHPF$ DISTRIBUTE x(*, BLOCK, BLOCK, BLOCK)
CHPF$ DISTRIBUTE y(*, BLOCK, BLOCK, BLOCK)
#endif

      integer ntest,itmax,iters
      common /ints/ ntest,itmax,iters
*
***********************************************************************
*
      if ((job .eq. 0) .or. (job .eq. 1)) then
         y(1,:,:,:) = x(1,:,:,:)/sqrt(q(1,:,:,:))
      else
         print*, 'preconl called with job = ',job
         print*, 'which is not supported by preconl'
      endif

      return
      end
*
***********************************************************************
*
      subroutine split_right (job,p,ip,x,y)
*
***********************************************************************
*
*      Perform Diagonal Preconditioning by the following:
*
*     A*x = b
*
*     D^(-1/2)*A*D^(-1/2)*D^(1/2)*x = D^(-1/2)*b
*     D = diagonal of A
*
*     This routine performs the right preconditioning step.
*
***********************************************************************
*
*     #include "poisson.h"

#ifdef CMFORTRAN
#include "cm/cmssl-cmf.h"
#endif

      integer job
      integer ip(3,1,1,1)
#ifdef CMFORTRAN
cmf$ layout ip(:serial,:news,:news,:news)
#elif HPF
CHPF$ DISTRIBUTE ip(*, BLOCK, BLOCK, BLOCK)
#endif

#ifdef CMFORTRAN
      real, array(7,idim-2,jdim-2,kdim-2) :: p
      real, array(1,idim-2,jdim-2,kdim-2) :: x,y
cmf$ layout p(:serial,:news,:news,:news)
cmf$ layout x(:serial,:news,:news,:news)
cmf$ layout y(:serial,:news,:news,:news)
#elif HPF
      real, DIMENSION(7,idim-2,jdim-2,kdim-2) :: p
      real, DIMENSION(1,idim-2,jdim-2,kdim-2) :: x,y
CHPF$ DISTRIBUTE p(*, BLOCK, BLOCK, BLOCK)
CHPF$ DISTRIBUTE x(*, BLOCK, BLOCK, BLOCK)
CHPF$ DISTRIBUTE y(*, BLOCK, BLOCK, BLOCK)
#endif

      integer ntest,itmax,iters
      common /ints/ ntest,itmax,iters
*
***********************************************************************
*
      if ((job .eq. 0) .or. (job .eq. 1)) then
         y(1,:,:,:) = x(1,:,:,:)/sqrt(p(1,:,:,:))
      elseif (job .eq. 2) then
         y(1,:,:,:) = x(1,:,:,:)*sqrt(p(1,:,:,:))
      else
         print*, 'preconl called with job = ',job
         print*, 'which is not supported by preconr'
      endif

      return
      end
*
***********************************************************************
*
