[Wien] rare bug in init_lapw

Stefaan Cottenier Stefaan.Cottenier at UGent.be
Thu Jun 30 16:43:38 CEST 2011


In init_lapw, there are a few lines that reduce the number 'nband' in 
the last line of case.in1_st by a factor 2:

# fix nband in case.in1
   set a=`grep K-VECTORS $file.in1_st|grep -v red|cut -c21-`
   set aa=`echo $a[4] |grep -e \[0-9\]`     # get only numbers
   @ a2 = $aa / 2
   sed "s/ $aa / $a2   red /" $file.in1_st > .tmp
   mv .tmp  $file.in1_st
   cp $file.in1_st $file.in1$compl
   goto stop

It greps for a keyword in the last line (K-VECTORS), extracts 'nband' 
and puts it in the variable aa, divide it by 2 and puts that in the 
variable a2, and then replaces in the entire file case.in1_st all places 
where the original number appears (surrounded by some spaces) by this 
reduces number, adding 'red' to mark that it is reduced.

This works fine, except in the (admittedly rare) case where the original 
value of nband is 10: this is equal to "MAX L IN WF" in the second line, 
and therefore also in the second line "5  red" will erroneously appear...

hcp-Be is a case where this happens.

Stefaan


More information about the Wien mailing list