- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have moved to XE composer 2011 and found out that the results from my code are differents from the one computed with v11.1
The problem comes from the new compiler optimization :
v11.1, no optimization : OK
v11.1, /O3 : OK
v11.1, no optimization : OK
V12.0, /O3 : Wrong
The involved loop is the one below, a "write" statement correct the problem.
do ispeed=1,nspeed
if (ispeed == num_speed_temp(inss,iroute)) then
prob_speed(ispeed, inss,iroute)= prob_speed(ispeed, inss,iroute) + a
!write(*,*) !necessary to get correct results
end if
end do
Anyone knows how to avoid such error and still benefit of some optimization for the other part of the code ?
The problem comes from the new compiler optimization :
v11.1, no optimization : OK
v11.1, /O3 : OK
v11.1, no optimization : OK
V12.0, /O3 : Wrong
The involved loop is the one below, a "write" statement correct the problem.
do ispeed=1,nspeed
if (ispeed == num_speed_temp(inss,iroute)) then
prob_speed(ispeed, inss,iroute)= prob_speed(ispeed, inss,iroute) + a
!write(*,*) !necessary to get correct results
end if
end do
Anyone knows how to avoid such error and still benefit of some optimization for the other part of the code ?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We would need to see the actual program and be able to compile and run it to comment. Often a problem that "goes away" when a WRITE is added is caused by a reference to uninitialized memory. The actual error can be unrelated to the code you added.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the answer, it certainly had something to do with uninitialized memroy, changing a fixed size array into an allocatable array have solved the problem.

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