      implicit none
      integer m, n, lwork, i, j
      parameter (m = 6, n = 2, lwork = 2*m)
      integer info
      double precision a(m,m), tau(min(m,n)), work(lwork)
c
      data ((a(i,j),i =1,m), j = 1,n) / 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1 /
c
      call dgeqrf(m, n, a, m, tau, work, lwork, info)
      call dorgqr(m, m, min(m,n), a, m, tau, work, lwork, info)
c
      write (6,998) ((a(i,j), i = 1,m), j = 1,m)
 998  format ('a(i,j) = ', 6(2x,f8.6))
c
      end
