I just finished my application but for this subroutine
subroutine back_substitution(s, c)
implicit none
double precision, dimension(:,:), intent(out) :: s
double precision, dimension(:), intent(out) :: c
real :: w
integer :: i, j, n
n = size(c)
do i = n, 1, -1
w = c(i)
do j =...