PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Differences between F77 and F90 code

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
sbrambilla



Joined: 06 Aug 2013
Posts: 1

PostPosted: Wed Dec 04, 2013 9:40 am    Post subject: Differences between F77 and F90 code Reply with quote

Hello, I had to port a Fortran code from Fortran 77 to Fortran 90. The only real change made to the code is that arrays now are dynamically allocated. I am running now the two codes in parallel to check that the new code is working as the old one. My problem is that the two codes do not produce the same results. In particular, at one point two variables with the same exact value are summed and the result in the two codes are different. The differences is in the last digit, in the order of macheps, but that difference propagates through the code. Is there any particular reason for that behavior? All the optimizations have been turned off and the code works with single precision variables.

Note: I've compiled and run the code with the Intel fortran compiler and the two codes produce the exact same results.

Thanks in advance for your time,

Sara
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6218
Location: The Portland Group Inc.

PostPosted: Wed Dec 04, 2013 1:26 pm    Post subject: Reply with quote

Hi Sara,

Quote:
All the optimizations have been turned off and the code works with single precision variables.
Do you mean that you just removed all the optimization flags or did you use "-O0"? The default is to use "-O" when no flags are present, so you do need to add "-O0" in order to disable optimization.

If it persists at "-O0", my best guess is that some array isn't initialized, you have an out-of-bounds error, or some other type of memory issue. I would try running the code under Valgrind (www.valgrind.org) to see what it says. You could also try adding bounds checking (-Mbounds).

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group