le programme ne signal aucun erreur lors de la compilation mais ne fonctionne pasCode:program tp implicit none integer::m,i,j real,dimension(:,:),allocatable::a real,dimension(:),allocatable::x real,dimension(:),allocatable::b !real::remonte print*,"enter le rang de la matrice " read*,m allocate(a(m,m)) allocate(b(m)) allocate(x(m)) print*,"resolution du systheme AX=B" print*,"entrer les elements de la matrice A" do i=1,m do j=1,m print*,"A(l,p)",i,j read*,a(i,j) end do end do do i=1,m write(*,*)(a(i,j),j=1,m) end do print*,"entrer les elements de la matrice B" do i=1,m print*,"B(i)",i read*,b(i) end do do i=1,m write(*,*)b(i) end do deallocate(a) deallocate(b) call gauss(m,a,b) !write(*,*)gauss(m,a,b) call remonte(m,a,b,x) ! write(*,*)remonte(m,a,b,x) deallocate(x) end subroutine gauss(m,a,b) ! function gauss(m,a,b) implicit none integer::m,i,j,k real,dimension(m,m)::a real,dimension(m)::b !real::w do k=1,m do i=k+1,m ! w=a(i,k)/a(k,k) b(i)=b(i)-(a(i,k)/a(k,k))*b(k) do j=k+1,m a(i,j)=a(i,j)-(a(i,k)/a(k,k))*a(k,j) end do end do end do end subroutine remonte(m,a,b,x) ! function remonte(m,a,b,x) integer::m,i,j real::s real,dimension(m,m)::a real,dimension(m)::b real,dimension(m)::x real::remonte b(m)=b(m)/a(m,m) do i=m-1,1,-1 s=0.0 do j=i+1,m s=s+a(i,j)*x(j) end do x(i)=(b(i)-s)/a(i,i) !remonte=x(i) end do end
-----