On Feb 22, 2013, at 10:38 AM, Kentaro Takami wrote:
Further strange behavior: When I insert non-essential line such as "WRITE(*,*)" statement in "apply_dissipation.F77", sometimes the difference is disappeared. So, I doubted incorrect pointer position.
could it be related to compiler optimization?
I remember seeing things similar to this in the past, when adding a line like that was changing the behavior of the code. In my case, it was having or not a segfault, which at the end depended on how the compiler was actually compiling the code and that seemed to be somehow dependent on the length of the routine. This is a problem I had few years ago so I don't remember exactly all the details, but we fixed it by changing the code in order to be sure that certain operations were always executed in the same order (I think it had to do with an if condition being located inside or outside a do loop).
Cheers, Bruno
Dr. Bruno Giacomazzo JILA - University of Colorado 440 UCB Boulder, CO 80309 USA
Tel. : +1 303-492-5170 Fax : +1 303-492-5235 email : bruno.giacomazzo@jila.colorado.edu web: http://www.brunogiacomazzo.org
---------------------------------------------------------------------- There are only 10 types of people in the world: Those who understand binary, and those who don't ----------------------------------------------------------------------