Jiggling & Wiggling

2006/06/08

A bug of intel fortran compiler 9.0

Filed under: Software — roylez @ 3:39 上午

Today I was doing some molecular dynamics programming, then it was found that one parameter of the simulation changed strangely. That parameter should be a constant throughtout the run, and the program compiled under compaq visual fortran in windows platform could ran without this error. I first thought this was because the compatiblity of the code migrated from windows, but finaly I was surprised that it was a very silly bug of the compiler: intel fortran compiler 9. Okay, let’s see where that hole is.

My origin code is like the following.

if ( AllowQuenching .eqv. .true. .and. QuenchBegin <= stepcount .and. QuenchEnd > stepcount ) then
refTmp = refTmp + (aimTmp-reftmp)/(QuenchEnd-stepcount)
end if

The variable AllowingQuenching was always set to be .False. so that refTmp would never be changed. But to my surprise when AllowQuenching .eqv. .true. gave a false value, the whole if test gave a .True.!? However, when I replaced AllowQuenching .eqv. .true. with AllowQuenching, everything went well. For a compiler with great reputation, this is really silly.

通过访问 WordPress.com 创建免费网站或博客.