- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
type fracShp
real*8,allocatable::s(:)
end type
type(fracShp),allocatable:: abc(:)
allocate(abc(5))
allocate(abc%s(5))
Is the above codes right? The array 'abc' is allocatable, and the array 's' in 'abc' is also allocatable. Can the compiler get the right address of all the two arrays?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to allocate the array component in each element of abc separately.
[fortran]allocate(abc(5))
allocate(abc(1)%s(5))
allocate(abc(2)%s(22))
...
allocate(abc(5)%s(66))[/fortran]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if I allocate it as you did, is everything legal? I am afraid that the system can not find the right address of the inner allocatable variable 's'.
IanH wrote:
You need to allocate the array component in each element of abc separately.
allocate(abc(5)) allocate(abc(1)%s(5)) allocate(abc(2)%s(22)) ... allocate(abc(5)%s(66))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you allocate as Ian describes, it is legal. When you say your "system can not find the right address," what happens? It would be helpful to see the exact text of the error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Annalee (Intel) wrote:
If you allocate as Ian describes, it is legal. When you say your "system can not find the right address," what happens? It would be helpful to see the exact text of the error message.
In my program there are some access violation without error message. It just displayed in the assemble language. So i can not find where it happened. i doubt if there are some address confusion. Moreover, the memory occupied by my program became more and more large. I have checked the allocatable variables and pointers, and deallocated them. But the problem was still not be solved. The program is too long to paste out. So is there any advice to solve this problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would suggest using the /traceback option. This will show you where the access violation occurs in your program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Annalee (Intel) wrote:
I would suggest using the /traceback option. This will show you where the access violation occurs in your program.
where is the /traceback option? Is it still work in the 'Release' mode or just work in the 'Debug' mode?
thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Traceback is under Properties > Fortran > Run-time > Generate Traceback Information. This works in both release and debug mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Annalee (Intel) wrote:
Traceback is under Properties > Fortran > Run-time > Generate Traceback Information. This works in both release and debug mode.
OK, Thank you! But if i still can not solve the problem, can you help me to solve it? If you can give some help, please give me an individual email address. i could sent the program to you. Thank you very much for your advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Wang,
If you can not share your program on this forum, the best option is to submit an issue through Premier Support.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page