Allocation and Deallocation errors

Allocation and Deallocation errors

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

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I can't really tell what is going on without a runnable example. I suggest filing a support request with Intel Premier Support and including a self-contained example that reproduces the problem. Before doing that, you should download and install the latest compiler build from Premier Support, if you have a support license, and try that. Even without a support license, you can still submit problem reports.

Steve

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today