SUBROUTINE VEC(M,N,A,LDA,B) C This routine vectorizes a matrix, B = vec(A): B is a vector C containing the columns of A stored successively with no gaps C between columns. C Inputs: C M Row dimension of matrix C N Column dimension of matrix C A Matrix to be vectorized C LDA Leading dimension of A in calling program C Outputs: C B Vectorized matrix; vector is of length MN. IMPLICIT REAL*8 (A-H,O-Z) DIMENSION A(LDA,100),B(500) IF((M.EQ.0).OR.(N.EQ.0))RETURN L=0 DO 10 JN=1,N DO 10 IM=1,M L=L+1 10 B(L)=A(IM,JN) RETURN END