during migration of a stellar atmosphere code from 32 bit Linux to an Opteron cluster, we encountered severe problems. Beforehand we used the Intel ifort compiler without any problems, but for the Opterons only a pgf compiler is available. The code package we have to compile consists of a mixture of F77 and F90/95 files.
Ok, the problem is, that the code compiles fine, but at runtime changes values in variables which aren’t even touched!!!
Eg: natoms, an integer variable in an F77 file is set to some value and is print.
After several lines in which this variable is not used, another print gives:
which then, of course, causes the code to crash, as natom is after this print used to get a value from an array. Ok, this is solved by using an natomsav and copying back and forth, which is not desireable, but works.
Now the real problem:
I have a f77 subroutine:
SUBROUTINE LEVSEQ_WIND (NATOM,ATW,NION,NL,LTE,IZ,XNUION,XNULTE,NLALL, 1 LTEALL,NIONALL,LTESQ,LSQ,ISQ,IASQ,G,GLTE, 1 LPARIN,IGRUND,EPS)
using implicit variables. In this subroutine the integer variable nlall is set to a value. Verifyable with another print:
LEVSEQ_WIND: nlall 217
Now this subroutine is called from a f90 subroutine with the standard call
call LEVSEQ_WIND(NATOM,ATW,NION,NL,LTE,IZ,XNUION,XNULTE,NLALL,LTEALL, & NIONALL,LTESQ,LSQ,ISQ,IASQ,G,GLTE,LPARIN,IGRUND,EPS) print *, "INIT_ATOM: before ATOMWRK" print *, "INIT_ATOM: nlall,lteall,nionall",nlall,lteall,nionall
And the print you see here, yields:
INIT_ATOM: nlall,lteall,nionall 0 16 858867016
Where all three values are NOT what the are initialised in LEVSEQ_WIND!!
Now my question is, where is the problem in here??? Is this a compiler bug???
The whole code works without any problems when compiled with the Intel compiler.
Or is there any other workaround??
Thanks in advance