[Wien] x xspec runtime error

Gavin Abo gsabo at crimson.ua.edu
Thu Sep 8 18:14:03 CEST 2011


First, Dr. Marks, thanks for your explanation on the "-check bounds" 
option.  It was in my compiler options temporarily "only for debugging", 
because I got a SIGSEGV error with the recently released intel fortran 
compiler (composer_xe_2011_sp1.6.233).  I found good debugging tips on 
the SIGSEGV error  (i.e., how to find more information about the cause 
of the error) at 
http://software.intel.com/en-us/articles/determining-root-cause-of-sigsegv-or-sigbus-errors/.  
One was to use the "-check bounds" option.  However, we found that 
composer_xe_2011_sp1.6.233 just does not work for the Wien2k code.  
Therefore, I'm using the composerxe-2011.3.174 version of the ifort 12 
compiler.

Lastly, Dr. Fecher, I agree that the DO WHILE loop is likely better 
readable for the compiler.  However, I don't think that it addresses the 
out of bound array indexing.  Therefore, I believe "(i .GE. IEMAX .or. 
.NOT. EOF(32))" rather than "(.NOT. EOF(32))" would be a better stop 
condition for the loop.  If the syntax of "(i .GE. IEMAX .or. .NOT. 
EOF(32))" is not quite right, it is due to my lack of Fortran 
experience.  I believe that because the READ statement is called at the 
EOF and it reads into an array (probably not a concern if where reading 
into a single variable, then being copied into an array) that an access 
attempt is made outside the ENE(i) array.  This could occur due to extra 
line read to determine the EOF.  Though, the original code 
(CONTINUE-goto) works perfectly fine as is.  However, the adjustment 
could be better coding practice.

Kind Regards,

Gavin

On 9/8/2011 3:00 AM, Gerhard Fecher wrote:
> I guess a construct like
>
> i = 0
> DO WHILE (.NOT. EOF(32))
>          i = i + 1
>          IF (LC.EQ.0) then
>            READ(32,4713,ERR=913) ENE(i),DOS(i,1),DOS(i,3)
>          ELSE
>            READ(32,4713,ERR=913) ENE(i),DOS(i,1),DOS(i,2),DOS(i,3)
>          ENDIF
> END DO
>
> would be better readable than the CONTINUE GOTO CONTINUE spaghetti
> (maybe also for the compiler)
>
> Ciao
> Gerhard
>
> ====================================
> Dr. Gerhard H. Fecher
> Institut of Inorganic and Analytical Chemistry
> Johannes Gutenberg - University
> 55099 Mainz
> ________________________________________
> Von: wien-bounces at zeus.theochem.tuwien.ac.at [wien-bounces at zeus.theochem.tuwien.ac.at]" im Auftrag von"Gavin Abo [gsabo at crimson.ua.edu]
> Gesendet: Mittwoch, 7. September 2011 02:04
> Bis: wien at zeus.theochem.tuwien.ac.at
> Betreff: [Wien] x xspec runtime error
>
> Dear Dr. Blaha and Wien2k users,
>
> When running x xspec, I get the error shown below.  It looks like there is an infinite loop from lines 170 to 180 in txspec.f that causes an array index to go out of the upper bound, but I don't have much Fortran experience.  Should there be a condition (IEMAX?) and break or jump statement to get out of the "1 CONTINUE" and "goto 1" loop from line 170 and 180?
>
> forrt1: severe (408): fort: (2): Subscript #1 of the array ENE has value 771 which is greater than the upper bound 770
>
> Image              PC                             Routine                      Line        Source
> ...
> txspec             0000000000423085  MAIN__                    176          txspec.f
> ...
>
>>    stop error txspec xspec.def
> ...
>
> Lines from file txspec.f in SRC_txspec.f
>
> Line 170:
>       I=0
>   1    CONTINUE
>          i=i+1
>          IF (LC.EQ.0) then
>            READ(32,4713,END=2,ERR=913) ENE(i),DOS(i,1),DOS(i,3)
>          ELSE
>            READ(32,4713,END=2,ERR=913) ENE(i),DOS(i,1),DOS(i,2),DOS(i,3)
>          ENDIF
>        goto 1
>   2    CONTINUE
> :Line 180
>
> Thanks,
>
> Gavin
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20110908/f7704ce2/attachment.htm>


More information about the Wien mailing list