[Wien] NaN output in lapw3 17.1

Peter Blaha pblaha at theochem.tuwien.ac.at
Fri Jun 1 16:17:11 CEST 2018


A bit strange, but it seems it can happen for certain cases.

a) I don't think there was any code change in lapw3 between 13 and 17
(there was a bug fix between 12 and 13).

b) Therefore my expectations are that this is due to a different 
compiler ?? and in the older version all variables were initialized to 
zero, while they are not with the new compilation.

c) Clearly, it may happen that rhouse(kp) was not assigned, because 
there is a jump out of the loop to label 360, which would leave the last 
rhouse(nuse) uninitialized.

d) I would, however, suggest a different fix, because in case there was 
no jump out (I don't know if it can happen, but anyway), you would miss 
the last contribution (probably very small anyway). Instead, put

rhouse=0.d0        right after the allocate statement.

Thanks for the report and the analysis.


On 06/01/2018 03:40 PM, Georg Eickerling wrote:
> Dear WIEN users,
> 
> I found a possible issue with lapw3 in WIEN 17.1.
> 
> The bottom line is, that in some cases lapw3 from 17.1 instead of values for
> Fs produces this in the output:

> My debugging results:
> ======================
> 
> I found that the problem is triggered when the trimming of the INDMAX values
> happens in fourir.frc starting from line 170.
> 
> In my particular case, INDMAX = 36353
> this gets trimmed down to nuse = 21889
> 
> However, the last value for rhouse(NUSE) I saw created in line 195
> 
>   rhouse(NUSE)=RHOK(IIZ)/INST(IIZ)*TAUK(KP)
> 
> was
> 
>    NUSE        rhouse(NUSE)
>   21888 -1.357441708557500E-010
> 
> so that later
> 
> DO 35 KP=1,NUSE
>   F=F+RHOUSE(KP)*U
> 35    ENDDO
> 
> yields NaN, because RHOUSE(21889) is missing.
> 
> On the other hand, in line 175 I see
> 
> allocate(rhouse(INDMAX))
> 
> so I assume the array is initialized large enough and lapw3 can read
> "something" from it for the N+1 element?
> 
> I.e., for my diamond case, the according numbers are
> indmax 2229
> nuse   1105
> 
> the last rhouse created in 195:
> 
>    NUSE        rhouse(NUSE)
>   1104  7.021053333129166E-010
> 
> so that in this case (by conincidence?):
> 
> rhouse(nuse) = 0.000000000000000E+000
> 
> and the case works.
> 
> 
> The fix for me up to now was a
> 
> DO 35 KP=1,NUSE-1
> 
> to make it work for my original case with 17.1.
> 
> Any thoughts on this from the experts?
> 
> 
> best regards,
> 
> 
> Georg Eickerling
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Wien mailing list
> Wien at zeus.theochem.tuwien.ac.at
> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
> SEARCH the MAILING-LIST at:  http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
> 

-- 

                                       P.Blaha
--------------------------------------------------------------------------
Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
Phone: +43-1-58801-165300             FAX: +43-1-58801-165982
Email: blaha at theochem.tuwien.ac.at    WIEN2k: http://www.wien2k.at
WWW:   http://www.imc.tuwien.ac.at/TC_Blaha
--------------------------------------------------------------------------


More information about the Wien mailing list