[Wien] Bug report configure_int_lapw

Peter Blaha pblaha at theochem.tuwien.ac.at
Wed Sep 27 08:31:26 CEST 2017


Here is a modified configure_int_lapw, which should also work with the 
header produced by   x qtl.
Note, that in batch mode (-b) you still have to escape the brackets like 
\[,\(,...
This is not necessary in the interactive (commandline) mode.

Regards

Am 26.09.2017 um 14:11 schrieb Hugo Strand:
> Dear Prof. Blaha,
> 
> Thank you for the advice.
> 
> I would have suggested to make configure_int a bit more robust. The only 
> problem is that the helper script is confused by angle brackets in the 
> list of orbital characters. I am not a c-shell expert, but after I wrote 
> a python script that removes the brackets on the JATOMS lines in 
> "case.qtl" file, things (seems to) work fine.
> 
> Best regards,
> Hugo Strand
> 
> On Mon, Sep 25, 2017 at 9:53 PM, Peter Blaha 
> <pblaha at theochem.tuwien.ac.at <mailto:pblaha at theochem.tuwien.ac.at>> wrote:
> 
>     At the moment configure_int works only with the header produced in
> 
>     x lapw2 -qtl
> 
>     but not in    x qtl
> 
>     I would use   x qtl   only for
> 
>     f-splitting
>     SO coupling and decomposition into j
>     special rotated coordinate system.
> 
>     I'll see if I can change the headers in qtl, but configure_int will
>     also not work for f or j-splittings .
> 
> 
>     Am 25.09.2017 um 17:00 schrieb Hugo Strand:
> 
>         Dear Wien2k developers,
> 
>         I think I have found a bug in the setup script for the partial
>         density of states calculation.
> 
>         I am studying a tetragonal system with f-orbitals, and the "qtl"
>         name for them contains brakets. The brakets break the
>         configure_int_lapw script which exits prematurely.
> 
>         To reproduce the error please use the provided struct file and do
> 
>         init -b -numk 500
>         run_lapw
>         x qtl
>         configure_int_lapw -b total 1 tot 2
>         s,p,dz2,d\(x2-y2\),d\(yz+xz\),dxy 3 tot 4 tot  end
>         x tetra
> 
>         My current workaround consists of manually editing the case.qtl
>         file, and remove all brackets in the f-orbital names.
> 
>         Best regards,
>         Hugo
> 
> 
>         _______________________________________________
>         Wien mailing list
>         Wien at zeus.theochem.tuwien.ac.at
>         <mailto:Wien at zeus.theochem.tuwien.ac.at>
>         http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>         <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
>         <http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html>
> 
> 
>     -- 
>     --------------------------------------------------------------------------
>     Peter BLAHA, Inst.f. Materials Chemistry, TU Vienna, A-1060 Vienna
>     Phone: +43-1-58801-165300 <tel:%2B43-1-58801-165300>           
>       FAX: +43-1-58801-165982 <tel:%2B43-1-58801-165982>
>     Email: blaha at theochem.tuwien.ac.at
>     <mailto:blaha at theochem.tuwien.ac.at>    WIEN2k: http://www.wien2k.at
>     WWW:
>     http://www.imc.tuwien.ac.at/tc_blaha-------------------------------------------------------------------------
>     <http://www.imc.tuwien.ac.at/tc_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------------------------------------------------------------------------- 

-------------- next part --------------
#!/bin/csh -f
# interface for making case.int
# created with "Morteza Jamal"
# (C)2008 by Morteza Jamal
unalias cp
unalias rm
unalias mv
unalias grep
#clear
set file    = `pwd`
set file    = $file:t
echo "     (C)2008 by Morteza Jamal       "
echo "####################################"
echo "#                                  #"
echo " Configures and creates $file.int "
echo "#                                  #"
echo "####################################"
echo ""
set updn = ""
unset help
unset batch
#while ($#argv)
  switch ($1)
  case -h:
    set help
    shift; breaksw
  case -b:
    set batch
    shift; breaksw
#  default:
#    shift; breaksw
  endsw
#end
if ($?help) goto help
set fileorb = ":fileorb"
if  (-e "$file.qtlup") set updn = "up"
if !(-e "$file.qtl$updn") then
   set dosfile = $file.qtl$updn
   goto error
endif 
if (-e "$file.int") rm $file.int
if (-e "$file.intc") rm $file.intc
set ndos = 0

if !(-e "$file.struct") then
   set dosfile = $file.struct
   goto error
endif 
set conatom = 1
#set noneqatom = `head -2 < $file.struct|awk '{print $3}'`
set noneqatom = `head -2 < $file.struct|tail -1|cut -c28-30`
@ noneqatom = $noneqatom + 1       
Pinfnoneqatom:
if ( $conatom < $noneqatom ) then
  set atomname = `grep Z: $file.struct|head -$conatom|tail -1|cut -f1 -d" " `
  echo "atom $conatom is $atomname"
  @ conatom = $conatom + 1
  goto Pinfnoneqatom
endif 
@ conatom = $conatom - 1
echo ""
echo "*** For Total DOS type 'total' ***"
set defaultatom=-1
repforatom:
@ defaultatom ++
repforatom1:
echo ""
echo "*** For finishing type 'end' ***"
echo ""
if($defaultatom == 0) then
  echo -n "Enter the index of the atom for which you want to plot the DOS? (default:total) "
else
  echo -n "Enter the index of the atom for which you want to plot the DOS? (default:$defaultatom) "
endif
if($?batch) then
  set natom="$1"
  shift
  echo $natom
else
  set natom = ($<)
endif
#echo $natom

set natom = `echo "$natom" | tr "A-Z" "a-z"`
if ( "$natom" == "" && $defaultatom == 0) set natom=total 
if ( "$natom" == "" ) set natom = $defaultatom
if ( "$natom" != "end" && "$natom" != "total" ) then
 set test=`echo "$natom" | tr -d "a-z"`; if( "$test" == "") goto repforatom1
 if ( "$natom" > $conatom ) then
   echo "You have only $conatom atoms, we finish"
#  set masserror = "You have only $conatom atoms, we finish"
#  goto error2
  set natom=end
  goto writingf
 endif
endif

if ( $natom == "end" ) then
 if ( $ndos != 0 ) then
  goto writingf
 else
  set masserror = "You did not select any orbitals correctly"
  goto error2
 endif
endif
if ( $natom == "total" ) then
 echo "   0  1  total-DOS " >> $file.intc
 @ ndos = $ndos + 1
 goto repforatom
endif
set atomname = `grep Z: $file.struct|head -$natom|tail -1|cut -f1 -d" " `
#echo "You can select these orbitals for $atomname atom."
set qtl = 1
set orbital_all
repforqtl:
set orbital = `grep JATOM $file.qtl$updn | head -$natom | tail -1 | cut -c32- | cut -f$qtl -d, | sed -e "s^\[^^" | sed -e "s^\]^^" `
if ( "$orbital" != "" ) then
       switch ("$orbital")
	case 0:
	    set orbital = S
	    breaksw
	case 1:
	    set orbital = P
	    breaksw
	case 2:
	    set orbital = D
	    breaksw
	case 3:
	    set orbital = F
	    breaksw
	default:
	    breaksw
	endsw
        set orbital = `echo "$orbital" | tr "A-Z" "a-z"`
#        echo "$orbital"
        set orbital_all=`echo "$orbital_all,$orbital"`
        @ qtl = $qtl + 1
        goto repforqtl
endif
set orbital_all=`echo "$orbital_all"|cut -c2-`
echo "Select PDOS for $atomname from: $orbital_all (give a comma-separated list)."
if($?batch) then
  set selorb="$1"
  shift
  echo "$selorb"
else
  set selorb =($<)
endif
echo "$selorb," > $fileorb 
set qtlyou = 1
repforqtlyou:
set singorb = `cut -f$qtlyou -d,< $fileorb`
if ( "$singorb" != "" ) then
set singorb = `echo "$singorb" | tr "A-Z" "a-z" | sed -e "s^\[^^" | sed -e "s^\]^^" `
set qtl = 1
repforcompareqtl:
set orbital = `grep JATOM $file.qtl$updn | head -$natom | tail -1 | cut -c32- | cut -f$qtl -d, | sed -e "s^\[^^" | sed -e "s^\]^^" `
if ( "$orbital" != "" ) then
       switch ("$orbital")
	case 0:
	    set orbital = S
	    breaksw
	case 1:
	    set orbital = P
	    breaksw
	case 2:
	    set orbital = D
	    breaksw
	case 3:
	    set orbital = F
	    breaksw
	default:
	    breaksw
	endsw
        set orbital = `echo "$orbital" | tr "A-Z" "a-z"`
if ( "$singorb" == "$orbital" )  then 
 @ ndos = $ndos + 1
 echo "   $natom  $qtl  $orbital-$atomname " >> $file.intc
 @ qtlyou = $qtlyou + 1
 goto repforqtlyou
endif
@ qtl = $qtl + 1
goto repforcompareqtl
endif

@ qtlyou = $qtlyou + 1
goto repforqtlyou

endif
goto repforatom

writingf:
# get emin/emax
  set up
  if(-e $file.scf2up) set up=up
  set efer=(`grep :FER $file.scf2$up | cut -c8-`)
  set efer1=(`grep :FER $file.scf2$up | cut -c40-`)
  set emin=`grep separate $file.scf2$up | cut -f2 -d:`
  set emax=`grep "band " $file.output2$up | tail -1 | cut -c30-37`
  set efer_test=`echo "$emax > $efer1 + 0.5" | bc -l`
  if($efer_test > 0) set emax=`echo " $efer1 + 0.5" | bc -l`

set cline = 1
echo "$file             #Title" >> $file.int
echo "$emin 0.002 $emax 0.003   #Emin, DE, Emax, Gauss-Broad" >> $file.int
echo "  $ndos   N   0.000                 #Number of DOS-cases,G/L/B broadening (Ry)" >> $file.int
repcline:
if ( $cline <= $ndos ) then
set linesofintc = ` head -$cline < $file.intc | tail -1`
echo "     $linesofintc" >> $file.int
@ cline = $cline + 1
goto repcline
endif
echo "SUM: 0 2          # NUMBER OF SUMMATIONS, max-nr-of summands" >> $file.int
echo "2 5               # this sums dos-cases 2+5 from the input above" >> $file.int       

rm $file.intc
if (-e "$fileorb") rm -f $fileorb
echo ""
cat $file.int
echo ""
echo "$file.int has been created and is ready for use in   x tetra."
#  grep :BAN $file.scf2$up 
  grep 'band ' $file.output2$up >tmp_band
  set nband=(`wc tmp_band`)
  set i=1
  while ($i < $nband[1])
    set test_band=(`head -$i tmp_band|tail -1 |cut -c1-26`)
    set start_band=`echo "$test_band[3] < -1.5" | bc -l`
    if ($start_band == 0) then
      @ tail_band = $nband[1] - $i + 2
      goto exitband
    endif
    @ i ++
  end
  exitband:
  grep 'band ' $file.output2$up |head -1
  echo "..."
  grep 'band ' $file.output2$up |tail -$tail_band
endif
echo $efer
echo "check if automatic emin/emax is ok for you "
if( ! $?batch) then
  sleep 2
  $EDITOR $file.int
endif
exit(0)
error:
echo ">>>"
echo ">>> ERROR: $dosfile not found\!"
echo ">>>"
exit(1)
error2:
echo ">>>"
echo ">>> ERROR: $masserror\!"
echo ">>>"
if (-e "$fileorb") rm $fileorb
exit(1)

help:

cat <<EOF 
configure-int_lapw is an interface script to create 'case.int' .

You can specify interactively:
  total        (for plotting 'Total Dos')
  N            (to select atom N)
    s,p,d,...  (to select a set of PDOS for previously selected atom N,
                use labels as listed in the header of your case.qtl file)
  end          (for exit)

There is also a "batch" (non-interactive) mode:

configure_int_lapw -b  total 1 tot,d,d-eg,d-t2g 2 tot,s,p  end

will prepare case.int (for the TiC example) with:
tic             #Title
 -1.000   0.00250   1.200  0.003     #Emin, DE, Emax, Gauss-Broad
     8                               #Number of DOS
     0 1 total-DOS
     1 1 tot-Ti
     1 4 d-Ti
     1 5 d-eg-Ti
     1 6 d-t2g-Ti
     2 1 tot-C
     2 2 s-C
     2 3 p-C
SUM: 0 2                     # NUMBER OF SUMMATIONS, max-nr-of summands
2 5                      # this sums dos-cases 2+5 from the input above       
********************************
EOF







More information about the Wien mailing list