View previous topic :: View next topic |
Author |
Message |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Sun Oct 27, 2013 10:30 am Post subject: ALLOCATE halts the execution |
|
|
Hi all,
I'm making a strange observation, which I cannot reproduce in a short test program (below), which runs well however. I'm allocating and deallocating arrarys in a loop with dynamic file size. My 'large' program halts, without any notice or message, at allocate in the second call of sub. All previous allocates and deallocates return a STAT value of 0.
Code: | MODULE common
Real,Allocatable :: A(:,:)
END Module
PROGRAM alloctest
USE common
1 continue
ALLOCATE (A(10,10))
print *,'Allocated'
A=12345.
print *,'Now deallocate'
DEALLOCATE (A)
print *,'Allocated again'
ALLOCATE (A(20,20))
print *,'Now deallocate'
DEALLOCATE (A)
CALL sub()
pause 'next lap'
goto 1
END
Subroutine sub()
USE common
print *,'sub called.'
print *,'Allocated again'
ALLOCATE (A(5,5))
print *,'Now deallocate'
DEALLOCATE (A)
print *,'sub left'
RETURN
END
|
I have to add that I use third-party widget routines and call-back functions.
What I want to know is, how to get any diagnostic information.
Best regards, johannes |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Sun Oct 27, 2013 4:11 pm Post subject: |
|
|
What is the IOSTAT value on failure? |
|
Back to top |
|
 |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Mon Oct 28, 2013 3:19 pm Post subject: |
|
|
Hi Paul,
there is no failure before this special weired allocate. All previous STAT had been 0.
I was wondering whether ALLOCATABLE inside a module and subsequent frequent changes in array dimensions could be a problem, but the little test routine runs well. That looks strange to me. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Oct 28, 2013 3:46 pm Post subject: |
|
|
But what is the IOSTAT value after the ALLOCATE that fails.
It should be non-zero but what is this non-zero value? |
|
Back to top |
|
 |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Mon Oct 28, 2013 5:03 pm Post subject: |
|
|
There is no 'after'. It stops at allocation, as if it was waiting for some input. The test print after allocate is no more executed. The array size is small and no activities in the task manager are visible. |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Mon Oct 28, 2013 6:04 pm Post subject: |
|
|
Have you tried using the debugger to run to the point at which it fails? |
|
Back to top |
|
 |
johannes
Joined: 21 Jan 2011 Posts: 65 Location: Leimen, Germany
|
Posted: Mon Oct 28, 2013 6:21 pm Post subject: |
|
|
Hi Paul,
just done. There seems to be a problem in the call back djungle.
I think you answered my question about more diagnostics.
Thanks
johannes
PS: Let me delete this request somewhen later |
|
Back to top |
|
 |
|