I am trying to implement QR factorization of a non-square matrix in FORTRAN.  I have the algorithm for a square matrix but not for a non-square. I use Housholder matrices. Do you know where I could find the whole algorithm or code for the non-square case so that I can be sure I am doing it the right way (i am new in programming!)? I have to solve (backsubstitute) for the upper trangular R and the orthogonal Q at the last part but the decomposition must be done for the non-square case. Thank you!
fortran code-algorithm for qr decomposition of non-square matrix
matrices