1 subroutine da_lubksb(n, np, indx, a, b)
3 !-----------------------------------------------------------------------
4 ! Purpose: Adapted Numerical Recipes routine to solve the set of n linear
6 ! Routine takes in to account possibility that B will begin with many zero elements,
7 ! so it is efficient for matrix inversion.
8 !-----------------------------------------------------------------------
12 integer, intent(in) :: n ! Logical size of array.
13 integer, intent(in) :: np ! Physical size of array.
14 integer, intent(in) :: indx(1:n) ! Permutation vector returned by LUDCMP.
15 real, intent(in) :: a(1:np,1:np) ! LU decomposition of matrix A in A.x=B.
16 real, intent(inout) :: b(1:n) ! On input = B, on output = x.
18 integer :: i , ii , j , ll
21 if (trace_use) call da_trace_entry("da_lubksb")
31 sum = sum - a(i,j) * b(j)
33 else if (sum /= 0.0) then
43 sum = sum - a(i,j) * b(j)
49 if (trace_use) call da_trace_exit("da_lubksb")
51 end subroutine da_lubksb