[Wien] in1new problem

L. D. Marks L-marks at northwestern.edu
Mon Jun 6 19:18:11 CEST 2005


I had a similar problem, and wrote an experimental write_in1 with an
option -lo which will turn on the search with all deep semicore states which I've attached.

I've also made a small change in my version of lapw2 to better find the
semicore states; if all else fails contact me off the email list.

On Mon, 6 Jun 2005, Stefaan Cottenier wrote:

> >
> >
> >Of course I made an error in my script. It did not do what it should, namely
> >put a "search" to the deep semicore states (where you put  <==== should always
> >be              this!
> > 2   -5.911     0.002 CONT 1  <===========
> >
> >The new attatched script seems to work.
> >
> >
> Yes, the first tests are fine (although there is something not yet fully
> correct in the script, see output below). I will run a more extensive
> test series now, but I'm hopeful.
>
> Thanks !
> Stefaan
>
> FORTRAN STOP  LAPW0 END
> Invalid null command.       <===========  (repeated in every iteration)
> FORTRAN STOP  LAPW1 END
> FORTRAN STOP LAPWSO END
> FORTRAN STOP  LAPW2 END
> FORTRAN STOP  CORE  END
> FORTRAN STOP  MIXER END
>
> _______________________________________________
> 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 60201, USA
Tel: (847) 491-3996 Fax: (847) 491-7820
email: L - marks @ northwestern . edu
http://www.numis.northwestern.edu
-----------------------------------------------
-------------- next part --------------
#!/bin/csh -f
# reads case.scf and case.in1 and writes a new case.in1
# based on an idea of J.Sofo and J.Fuhr
unalias rm
# define charge limit, when an energy parameter should be set
set qlimit=0.05

set updn = ""
set cmplx
unset help
unset lo
#LDM Experimental, no in use
set eglobal = 999
#Test for deeper semicore states
#The -lo option will turn on search for these, which can be better
#Not sure what number should be here...
set lobase = -2.5

while ($#argv)
  switch ($1)
  case -h:
    set help
    shift; breaksw
  case -ql:
    shift; set qlimit=$1
    shift; breaksw
#LDM experimental, not used
#  case -eg
#    shift; set eglobal=$1
#    shift; breaksw
  case -lo:
    set lo
    shift; breaksw
  case -c:
    set cmplx = c
    shift; breaksw
  case -up:
    set updn = up
    shift; breaksw
  case -dn:
    set updn = dn
    shift; breaksw
  default:
    shift; breaksw
  endsw
end

if ($?help) goto help

set file    = `pwd`
set file    = $file:t

if( ! -e $file.in1$cmplx ) then
    echo " the required file    $file.in1$cmplx    does not exist"
    exit(3)
endif
if( ! -e $file.scf2$updn ) then
    echo " the required file    $file.scf2$updn    does not exist"
    exit(3)
endif

head -2 $file.in1$cmplx > $file.in1"$cmplx"new
set lines=2

#determine EF
set ef1 = (`grep :FER $file.scf2$updn | sed -e 's/:FER.*=//'`)
if ($#ef1 == 0 ) then
            echo " FERMI energy not found in   $file.scf2$updn"
            exit(3)
endif
#set eglobal = 999
set eferm=`echo "scale=4;$ef1 - 0.3 " |bc -l`
#LDM experimental, not used
#if ( $eglobal <= 999 ) set eferm=$eglobal
#if( $eglobal != 999 ) set eferm=$eglobal
#loop over atoms 
set natom=`head -2 $file.struct | tail -1 | cut -c28-30`
set iatom=1
while ($iatom <= $natom)
@ lines ++
#set nn=`head -3 $file.in1$cmplx |tail -1`
set nn=`head -$lines $file.in1$cmplx |tail -1`
#find global APW parameter
set apw0=0
if ( $nn[3] == 1 ) set apw0=1
#Note, this was all 1
set apws=1
set apwp=1
set apwd=1
set apwf=1
set i0=1

#find l-specific APW parameters from case.in1
while ($i0 <= $nn[2] )
@ lines ++
  set nnn=`head -$lines $file.in1$cmplx |tail -1`
if ($#nnn >= 5 ) then
   if( $nnn[1] == 0 ) set apws=$nnn[5]
   if( $nnn[1] == 1 ) set apwp=$nnn[5]
   if( $nnn[1] == 2 ) set apwd=$nnn[5]
   if( $nnn[1] == 3 ) set apwf=$nnn[5]
endif
@ i0 ++
end

#find energy parameter from case.scf2  (EPL/EPH)
  if ($iatom <= 9) then
set epl = (`grep :EPL00$iatom $file.scf2$updn`)
set eph = (`grep :EPH00$iatom $file.scf2$updn`)
  else if ($iatom <= 99) then
set epl = (`grep :EPL0$iatom $file.scf2$updn`)
set eph = (`grep :EPH0$iatom $file.scf2$updn`)
  else
set epl = (`grep :EPL$iatom $file.scf2$updn`)
set eph = (`grep :EPH$iatom $file.scf2$updn`)
  endif
if($#epl == 1 ) then
  echo " EPLxx not found in     $file.scf2$updn"
  exit(3)
endif 
if($#eph == 1 ) then
  echo " EPHxx not found in     $file.scf2$updn"
  exit(3)
endif 

#E-parameter will be set when the respective charge is larger than qlimit
unset eslo
unset eplo
unset edlo
unset eflo
if(`echo "if ($epl[2] > $qlimit)1;if ($epl[2] <= $qlimit)0"|bc`) set eslo=$epl[3]
if(`echo "if ($epl[4] > $qlimit)1;if ($epl[4] <= $qlimit)0"|bc`) set eplo=$epl[5]
if(`echo "if ($epl[6] > $qlimit)1;if ($epl[6] <= $qlimit)0"|bc`) set edlo=$epl[7]
if(`echo "if ($epl[8] > $qlimit)1;if ($epl[8] <= $qlimit)0"|bc`) set eflo=$epl[9]
# Test for deep semi-core states with -lo option
# The in1new switch may be be optimum for these
# In this case use a search, xloos parameter
set sloos=`echo "if ($epl[3] < $lobase)0.001 else 0.000"|bc`
set ploos=`echo "if ($epl[5] < $lobase)0.001 else 0.000"|bc`
set dloos=`echo "if ($epl[7] < $lobase)0.001 else 0.000"|bc`
set floos=`echo "if ($epl[9] < $lobase)0.001 else 0.000"|bc`
#
unset es
unset ep
unset ed
unset ef
if(`echo "if ($eph[2] > $qlimit)1;if ($eph[2] <= $qlimit)0"|bc`) set es=$eph[3]
if(`echo "if ($eph[4] > $qlimit)1;if ($eph[4] <= $qlimit)0"|bc`) set ep=$eph[5]
if(`echo "if ($eph[6] > $qlimit)1;if ($eph[6] <= $qlimit)0"|bc`) set ed=$eph[7]
if(`echo "if ($eph[8] > $qlimit)1;if ($eph[8] <= $qlimit)0"|bc`) set ef=$eph[9]

# set the high-E parameter if low-E is already defined
if( $?eslo ) set es=$eph[3]
if( $?eplo ) set ep=$eph[5]
if( $?edlo ) set ed=$eph[7]
if( $?eflo ) set ef=$eph[9]

set n=0
if ($?eslo) @ n ++
if ($?eplo) @ n ++
if ($?edlo) @ n ++
if ($?eflo) @ n ++
if ($?es) then
 if ($es == '10.0000') set es=$eferm
 @ n ++
endif
if ($?ep) then
 if ($ep == '10.0000') set ep=$eferm
 @ n ++
endif
if ($?ed) then
 if ($ed == '10.0000') set ed=$eferm
 @ n ++
endif
if ($?ef) then
 if ($ef == '10.0000') set ef=$eferm
 @ n ++
endif
#write   global energy line for each atom
#if( $eglobal != 999 ) set eferm=`echo "scale=4;$es + $eglobal " |bc -l`
echo " $eferm  $n  $apw0       Global e-param with N other choices, APW/LAPW ">> $file.in1"$cmplx"new
#write l-specific lines
set los=0.000
if ($?es) then
#  if( $eglobal != 999 ) set es=`echo "scale=4;$es + $eglobal " |bc -l`
  if ($apws == '1')echo $es $apws |   awk '{printf (" 0   % 6.4f    0.000 CONT%2.0f  APW  S\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
  if ($apws == '0')echo $es $apws |   awk '{printf (" 0   % 6.4f    0.000 CONT%2.0f LAPW  S\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
endif
if ($?eslo) then  
  if( $?lo) set los=$sloos
  if ($apws == '1')echo $eslo $los $apws | awk '{printf (" 0   % 6.4f    %5.3f CONT%2.0f  APW  S-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
  if ($apws == '0')echo $eslo $los $apws | awk '{printf (" 0   % 6.4f    %5.3f CONT%2.0f LAPW  S-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
endif
if ($?ep) then
#  if( $eglobal != 999 ) set ep=`echo "scale=4;$ep + $eglobal " |bc -l`
  if ($apwp == '1')echo $ep $apwp |   awk '{printf (" 1   % 6.4f    0.000 CONT%2.0f  APW  P\n",$1,$2)}' >>$file.in1"$cmplx"new
  if ($apwp == '0')echo $ep $apwp |   awk '{printf (" 1   % 6.4f    0.000 CONT%2.0f LAPW  P\n",$1,$2)}' >>$file.in1"$cmplx"new
endif
if ($?eplo) then
  if( $?lo) set los=$ploos
  if ($apwp == '1')echo $eplo $los $apwp | awk '{printf (" 1   % 6.4f    %5.3f CONT%2.0f  APW  P-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
  if ($apwp == '0')echo $eplo $los $apwp | awk '{printf (" 1   % 6.4f    %5.3f CONT%2.0f LAPW  P-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
endif
if ($?ed) then
#  if( $eglobal != 999 ) set ed=`echo "scale=4;$ed + $eglobal " |bc -l`
  if ($apwd == '1')echo $ed $apwd |   awk '{printf (" 2   % 6.4f    0.000 CONT%2.0f  APW  D\n",$1,$2)}' >>$file.in1"$cmplx"new
  if ($apwd == '0')echo $ed $apwd |   awk '{printf (" 2   % 6.4f    0.000 CONT%2.0f LAPW  D\n",$1,$2)}' >>$file.in1"$cmplx"new
endif
if ($?edlo) then
  if( $?lo) set los=$dloos
  if ($apwd == '1')echo $edlo $los $apwd | awk '{printf (" 2   % 6.4f    %5.3f CONT%2.0f  APW  D-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
  if ($apwd == '0')echo $edlo $los $apwd | awk '{printf (" 2   % 6.4f    %5.3f CONT%2.0f LAPW  D-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
endif
if ($?ef) then
#  if( $eglobal != 999 ) set ef=`echo "scale=4;$ef + $eglobal " |bc -l`
  if ($apwf == '1')echo $ef $apwf |   awk '{printf (" 3   % 6.4f    0.000 CONT%2.0f  APW  F\n",$1,$2)}' >>$file.in1"$cmplx"new
  if ($apwf == '0')echo $ef $apwf |   awk '{printf (" 3   % 6.4f    0.000 CONT%2.0f LAPW  F\n",$1,$2)}' >>$file.in1"$cmplx"new
endif
if ($?eflo) then
  if( $?lo) set los=$floos
  if ($apwf == '1')echo $eflo $los $apwf | awk '{printf (" 3   % 6.4f    %5.3f CONT%2.0f  APW  F-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
  if ($apwf == '0')echo $eflo $los $apwf | awk '{printf (" 3   % 6.4f    %5.3f CONT%2.0f LAPW  F-LO\n",$1,$2,$3)}' >>$file.in1"$cmplx"new
endif

   @ iatom ++
end

# @ lines ++
#write rest of case.in1 file
set nn=`wc $file.in1"$cmplx"`
@ n = $nn[1] - $lines
tail -$n $file.in1"$cmplx" >>$file.in1"$cmplx"new

exit(0)


help:

cat <<EOF 
write_in1_lapw [-up/dn -c -ql 0.05 -lo]
write_in1_lapw   writes a case.in1new file using the Energy parameters from 
                 case.scf2[up/dn] (:EPLxx/EPHxx) and case.in1[c]
EOF



More information about the Wien mailing list