[Wien] x xspec runtime error
Laurence Marks
L-marks at northwestern.edu
Wed Sep 7 17:05:08 CEST 2011
The "-check bounds" option is good for debugging, but can be dangerous
otherwise. By default it is "OK" in fortran to use something like
"DIMENSION A(*)" or "DIMENSION A(1)" for an array whose size can be
either unknown (first case) or larger than 1 (second case). The -check
bounds option will give a incorrect error for the second (maybe also
for the first, I cannot remember).
And...it is quite a lot slower.
2011/9/7 Gavin Abo <gsabo at crimson.ua.edu>:
> Hi Dr. Blaha,
>
> It happened with composerxe-2011.3.174. I thought it was a ifort 12 bug
> too. However, it also happened with ifort 11.1 update 9. I have since went
> back to composerxe-2011.3.174. I found that it only happens if you compile
> with the "-check bounds" option. I guess with the "-check bounds", it
> doesn't like the loop break from the READ statement. Just realized that is
> probably what the "END 2" in the read statement does.
>
> So I can either compile without the "-check bounds" or add "IF (i.GT.IEMAX)
> goto 2" after line 172 in txspec.f as shown:
>
> I=0
> 1 CONTINUE
> i=i+1
> IF (i.GT.IEMAX) goto 2 !Added line
> 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
>
> Best Regards,
>
> Gavin
>
> On 9/7/2011 2:52 AM, Peter Blaha wrote:
>
> It should not happen ! Which compiler are you using ? Again one of the
> very new ifort 12.1 versions ?? (See ifort bugs in previous emails)
>
> The dimension is read from unit 32, and then it tries to read as many lines
> ....
>
> READ (32,4712) IEMAX
> allocate ( A1(NRAD,IEMAX), B1(NRAD,IEMAX))
> allocate ( ENE(IEMAX))
> allocate ( DOS(IEMAX,3),XI(IEMAX,2),X(IEMAX))
> allocate ( XINTER(IEMAX),XOUT(IEMAX))
>
> Eventually one could try for security to allocate the arrays ENE and DOS
> with IEMAX+1.
>
> Let me know if this fixes this problem.
>
> Am 07.09.2011 02:04, schrieb Gavin Abo:
>
> 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
>
>
>
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>
>
--
Laurence Marks
Department of Materials Science and Engineering
MSE Rm 2036 Cook Hall
2220 N Campus Drive
Northwestern University
Evanston, IL 60208, USA
Tel: (847) 491-3996 Fax: (847) 491-7820
email: L-marks at northwestern dot edu
Web: www.numis.northwestern.edu
Research is to see what everybody else has seen, and to think what
nobody else has thought
Albert Szent-Gyorgi
More information about the Wien
mailing list