      subroutine parameter_for_intrinsic(a_info, 
     & dim, lb, ub, size,dist_code,nprocs)
      integer a_info(8,7)
      integer dim,lb,ub,size,dist_code,nprocs
      a_info(1,dim)=lb
      a_info(2,dim)=ub
      a_info(5,dim)=size
      a_info(6,dim)=dist_code
      a_info(8,dim)=nprocs
      return
      end

      subroutine parameter_for_comm(a_comm, 
     & dim, lb, ub, size)
      integer a_comm(5,7)
      integer dim,lb,ub,size
      a_comm(1,dim)=lb
      a_comm(2,dim)=ub
      a_comm(3,dim)=1
      a_comm(4,dim)=size
      a_comm(5,dim)=1
      return
      end

      subroutine initial()
      COMMON /XPRESS/ NOCARE, NORDER, NONODE, IHOST, IALNOD, IALPRC
      CALL KXINIT
      return
      end

      subroutine adjust_local_bounds(lb, ub, llb, lub, dim,block)
      integer lb,ub,llb,lub,dim,block
      INTEGER minLoc1, maxLoc1, minLoc2, maxLoc2, coord(3)
      COMMON /g_to_l/minLoc1, maxLoc1, minLoc2, maxLoc2,coord
 
      minLoc = coord(dim)*block +1
      maxLoc = minLoc + block - 1
      llb = 1
      lub = block
      if(lb .gt. maxLoc) lub = 0
      if(ub .lt. minLoc) lub = 0
C
      if(maxLoc .eq. lb) llb = block
      if(minLoc .eq. ub) lub = 1
C
      if((minLoc .lt. lb ).and.(lb .lt. maxLoc)) llb = MOD(lb, block)
      if((minLoc .lt. ub ).and.(ub .lt. maxLoc)) lub = MOD(ub, block)
      return
      end

      subroutine input(a,n1,n2)
      real a(n1,n2)
      integer n1,n2
      integer Ti1, Ti2
      INTEGER minLoc1, maxLoc1, minLoc2, maxLoc2, coord(3)
      COMMON /g_to_l/minLoc1, maxLoc1, minLoc2, maxLoc2, coord

      DO Ti1 = minLoc1, maxLoc1
      DO Ti2 = 1, n1
      if(Ti2.eq.Ti1) then
        a(Ti2,Ti1-minLoc1+1) = 2.0
      else
        a(Ti2,Ti1-minLoc1+1) = 1.0
      endif
      END DO
      END DO
     
      s=n1*n2/2
     
      DO Ti2 = 1, n1
        if((n2.ge.minLoc1).and.(n2.le.maxloc1)) then
         a(Ti2,n2-minLoc1+1) = s+Ti2
        end if
      END DO
      return
      end


      subroutine input1(a,n1,n2)
      real a(n1,n2)
      integer n1,n2
      integer Ti1, Ti2
      INTEGER minLoc1, maxLoc1, minLoc2, maxLoc2, coord(3)
      COMMON /g_to_l/minLoc1, maxLoc1, minLoc2, maxLoc2, coord

      DO Ti1 = minLoc1, maxLoc1
      DO Ti2 = 1, n2
      if(Ti2.eq.Ti1) then
        a(Ti1-minLoc1+1,Ti2) = 2.0
      else
        a(Ti1-minLoc1+1,Ti2) = 1.0
      endif
      END DO
      END DO
     
      s=100*n2/2
     
      DO Ti2 = minLoc1, maxLoc1
         a(Ti2-minLoc1+1,n2) = s+Ti2
      END DO
      return
      end



      subroutine start_timer()
      integer*4 time1, time2, time3
      common /time/ time1, time2
      time1 = kxtime()
      return
      end


      subroutine stop_timer()
      integer*4 time1, time2
      common /time/ time1, time2
      time2 = kxtime()
      call  kmulti(6)
      time3= time2-time1
      write(6,*)' The time taken is ',time3 
      call kflush(6)
      return
      end




