ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c Solution of linear equation without inverting matrix c using LU decomposition: c AA * xx = bb AA, bb: known c xx: to be found c AA and bb are not modified in this subroutine c c MALV , Sep 2007 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine LUdec(xx,aa,bb,m,n) implicit none ! Arguments integer m, n real*8 aa(m,m), bb(m), xx(m) ! Local variables real*8 a(n,n), b(n), x(n), d integer i, j, indx(n) ! Subrutinas utilizadas ! ludcmp_dp, lubksb_dp !!!!!!!!!!!!!!! Comienza el programa !!!!!!!!!!!!!! do i=1,n b(i) = bb(i+1) do j=1,n a(i,j) = aa(i+1,j+1) enddo enddo ! Descomposicion de auxm1 call ludcmp_dp ( a, n, n, indx, d) ! Sustituciones foward y backwards para hallar la solucion do i=1,n x(i) = b(i) enddo call lubksb_dp( a, n, n, indx, x ) do i=1,n xx(i+1) = x(i) enddo return end