$DEBUG
      SUBROUTINE MFEOUT (A,MDA,M,N,NAMES,MODE)                          MFT00100
C     C.L.LAWSON AND R.J.HANSON, JET PROPULSION LABORATORY, 1973 JUN 12 MFT00200
C     TO APPEAR IN 'SOLVING LEAST SQUARES PROBLEMS', PRENTICE-HALL, 1974MFT00300
C          SUBROUTINE FOR MATRIX OUTPUT WITH LABELING.                  MFT00400
C                                                                       MFT00500
C     A( )         MATRIX TO BE OUTPUT                                  MFT00600
C                  MDA     FIRST DIMENSION OF A ARRAY                   MFT00700
C                  M         NO. OF ROWS IN A MATRIX                    MFT00800
C                  N         NO. OF COLS IN A MATRIX                    MFT00900
C     NAMES()      ARRAY OF NAMES.  IF NAMES(1) = 1H , THE REST         MFT01000
C                  OF THE NAMES() ARRAY WILL BE IGNORED.                MFT01100
C     MODE         =1   FOR   4P8F15.0  FORMAT  FOR V MATRIX.           MFT01200
C                  =2   FOR   8E15.8  FORMAT  FOR CANDIDATE SOLUTIONS.  MFT01300
C                                                                       MFT01400
      DIMENSION    A(MDA,01)                                            MFT01500
      CHARACTER*4 IHEAD(2), BLANK, NAME, NAMES(N)
      LOGICAL   NOTBLK                                                  MFT01700
      DATA  MAXCOL/8/, BLANK/'    '/,IHEAD(1)/' COL'/,IHEAD(2)/'SOLN'/  MFT01800
C                                                                       MFT01900
      NOTBLK=NAMES(1).NE.BLANK                                          MFT02100
      IF (M.LE.0.OR.N.LE.0) RETURN                                      MFT02000
C                                                                       MFT02200
      IF (MODE.EQ.2) GO TO 10                                           MFT02300
      WRITE (6,70)                                                      MFT02400
      GO TO 20                                                          MFT02500
   10 WRITE (6,80)                                                      MFT02600
   20 CONTINUE                                                          MFT02700
C                                                                       MFT02800
      NBLOCK=N/MAXCOL                                                   MFT02900
      LAST=N-NBLOCK*MAXCOL                                              MFT03000
      NCOL=MAXCOL                                                       MFT03100
      J1=1                                                              MFT03200
C                                                                       MFT03300
C                            MAIN LOOP STARTS HERE                      MFT03400
C                                                                       MFT03500
   30 IF (NBLOCK.GT.0) GO TO 40                                         MFT03600
      IF (LAST.LE.0) RETURN                                             MFT03700
      NCOL=LAST                                                         MFT03800
      LAST=0                                                            MFT03900
C                                                                       MFT04000
   40 J2=J1+NCOL-1                                                      MFT04100
      WRITE (6,90) (IHEAD(MODE),J,J=J1,J2)                              MFT04200
C                                                                       MFT04300
           DO 60 I=1,M                                                  MFT04400
           NAME=BLANK                                                   MFT04500
           IF (NOTBLK) NAME=NAMES(I)                                    MFT04600
C                                                                       MFT04700
           IF (MODE.EQ.2) GO TO 50                                      MFT04800
           WRITE (6,100) I,NAME,(A(I,J),J=J1,J2)                        MFT04900
           GO TO 60                                                     MFT05000
   50      WRITE (6,110) I,NAME,(A(I,J),J=J1,J2)                        MFT05100
   60      CONTINUE                                                     MFT05200
C                                                                       MFT05300
      J1=J1+MAXCOL                                                      MFT05400
      NBLOCK=NBLOCK-1                                                   MFT05500
      GO TO 30                                                          MFT05600
C                                                                       MFT05700
   70 FORMAT ('0V-MATRIX OF THE SINGULAR VALUE DECOMPOSITION OF A*D.',  MFT05800
     *        ' (ELEMENTS OF V SCALED UP BY A FACTOR OF 10**4)' )       MFT05900
   80 FORMAT ('0SEQUENCE OF CANDIDATE SOLUTIONS, X')                    MFT06000
   90 FORMAT ('0',11X,8(6X,A4,I4,1X)/1X)                                MFT06100
  100 FORMAT (1X,I3,2X,A4,2X,4P8F15.0)                                  MFT06200
  110 FORMAT (1X,I3,2X,A4,2X,8E15.8)                                    MFT06300
      END                                                               MFT06400
