       subroutine xdebug(imat,n,m,gl,a)                                 XDEB001
c -------------------------------------------------                     XDEB002
c      link to XLAT only if errors in solution of                       XDEB003
c      linear equations occurs                                          XDEB004
c -------------------------------------------------                     XDEB005
       dimension gl(5,*),a(4,*)                                         XDEB006
                                                                        XDEB007
       write(*,*)                                                       XDEB008
       if (imat.eq.0) then                                              XDEB009
          write(*,*)' Before Matrix inversion >'                        XDEB010
       else                                                             XDEB011
          write(*,*)' After Matrix inversion >'                         XDEB012
       end if                                                           XDEB013
       write(*,*) ' n=',n,', m=',m                                      XDEB014
       write(*,*) ' Normal equations:'                                  XDEB015
       do 7777 i=1,n                                                    XDEB016
 7777     write(*,*) (gl(j,i), j=1,m)                                   XDEB017
       write(*,*) ' Coefficient matrix A'                               XDEB018
       if (imat.eq.1) write(*,*)' Solutions are in a(1,m) a(2,m) etc:'  XDEB019
       do 7776 ik=1,m-1                                                 XDEB020
 7776     write(*,*) (A(ik,j), j=1,m)                                   XDEB021
       return                                                           XDEB022
       end                                                              XDEB023
                                                                        XDEB024
