   ( LDWORK = MAX( MMAX*( NMAX + MMAX ) +
     $                                 MAX( NMAX*( NMAX + 5 ),
     $                                      MMAX*( MMAX + 2 ), 4*PMAX ),
     $                                 NMAX*( MAX( NMAX, PMAX ) + 4 ) +
     $                                 MIN( NMAX, PMAX ) ) )
*     .. Local Scalars ..
      DOUBLE PRECISION S2NORM, TOL
      INTEGER          I, INFO, IWARN, J, M, N, NQ, P
      CHARACTER*1      DICO, JOBN
*     .. Local Arrays ..
      DOUBLE PRECISION A(LD