Deallocate causes code crash

Deallocate causes code crash

Hey guys... I am stuck on this problem for days. My code is crashing but I can't understand the reason why.

I realized that the compiled program crashes when it is deallocating the variables, but I don't know how to fix it.

Windows has triggered a breakpoint in Console1.exe.

This may be due to a corruption of the heap, which indicates a bug in Console1.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while Console1.exe has focus.

The output window may have more diagnostic information.

Bellow there is a sample of the code:

Subroutine PoissonCode()
Use Mesh
Implicit none
Real(8), Allocatable :: u(:,:),v(:,:),p(:,:)
Character(50) :: Nome
Allocate(u(0:Imax,0:jmax),v(0:Imax,0:jmax),p(0:Imax,0:jmax),fx(0:Imax,0:jmax),fy(0:Imax,0:jmax))
Allocate(xd(0:Imax),yd(0:Jmax))

........Code Here...............

Deallocate(u,v,p,fx,fy)
Deallocate(xd,yd)

End Subroutine PoissonCode

I put the complete code here for further investigation. I also tried to run the code with different versions of GFortran in Windows 7 x64 and Windows XP x86 with no success.

Thank you in advance

3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

The Dropbox link doesn't work.

Steve - Intel Developer Support

Sorry...

Actually I already solved this issue. The problem was that in my code, I was trying to modify, by mistake, an invalid array position.

Thank you

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!