- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I was wondering if this is code error, or a bug error. I have two problems with the following code,
subroutine inverse(A,B)
implicit none
real, intent(in)::A(:,:)
real, intent(out)::B(:,:)
real, allocatable::I(:,:), L(:,:)
real, allocatable:: Demands(:,:), Results(:,:)
integer::j, number_of_rows, y, z
number_of_rows = size(A(:,1))
allocate(L(number_of_rows,number_of_rows))
allocate(I(number_of_rows,number_of_rows))
allocate(Demands(number_of_rows,1))
allocate(Results(number_of_rows,1))
B=0
I=0
L= A
do j=1,number_of_rows
I(j,j)=1
end do
do j=1, number_of_rows
Demands(:,j)= I(:,j) !****Not assigning
!Intent(Inout, Inout)
call GaussElim(L, Demands)
!Intent(In, In, Out)
call BackwardSubstitution(L, Demands, Results)
B(:,j)=Results(:,1)
L=A
end do
deallocate(I)
deallocate(Demands)
deallocate(Results)
end subroutine inverse
The subroutine runs through to its end but finishes by printing a
Deallocate error 493: Variable was not created by ALLOCATE
End of diagnostics
Secondly each time through the do loop, Demands should be set to the next column of the Identity Matrix, however this line is seemingly ignored for j >= 2. I can't see why
Is their something which I am doing wrong ?
Thanks Killjoy
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page