±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 417  |  »Ø¸´: 2
µ±Ç°Ö÷ÌâÒѾ­´æµµ¡£

gleerat

ľ³æ (ÕýʽдÊÖ)

[½»Á÷] ¡¾ÇóÖú¡¿ÓÃsplit_dos£¬ÌáʾOUTCAR²»´æÔÚ ÒÑÓÐ2È˲ÎÓë

PROCARºÍOUTCARÃ÷Ã÷´æÔÚÄØ£¬¿ÉÊÇÓÃSplit_dosʱȴÌáʾ²»´æÔÚ£¬»¹ÓÐÌáʾsplit_dosºÍvpÕÒ²»µ½¡£
ÊDz»ÊÇÕâ¸ösplit_dosºÍvpÓÐÎÊÌâÄØ£¿£¡ÔËÐÐËüÖ»Äܵõ½Ò»¸öDOS0ºÍÁ½¸ötmp.dat¡£Õâ¸ösplit_dosºÍvpÊÇ´ÓÍøÉÏÏÂÔØµÄ¡£
CODE:
gleerat@gleerat-desktop:~/vasp/Si$ sh split_dos
[: 84: -a: unexpected operator
The OUTCAR does not exist, we set the Fermi level to 0
assume an unpolarized calculation, and RWIGS not set
split_dos: 96: split_dos/vp: not found
7 307
0 7 307

ÕâÊÇsplit_dos£º
CODE:
#!/bin/ksh
# Script to break the VASP DOSCAR file into segments for
# each atomic site.
# JMS NRL 5/0/02
# Modified to also align the Fermi level from the ground state
# to E=0.0 # JMS NRL 6/19/02
# Executables reside here
#BIN=~/bin
# GH: replace this so that it looks for vp in the same directory as this script
EXE=$0 BIN=${EXE%/*}
  if [ $# -ne 0 ]; then
        echo "Usage: split_dos"
        exit 2
fi
# Script to split the DOSCAR file into the atomic
# projections labeled by atom number
dosfile=DOSCAR
outfile=OUTCAR
infile=INCAR
# Token for splitting the files
token=$(sed -n '6 p' $dosfile | awk '{print $1}')
# Number of points
nl=$(sed -n '6 p' $dosfile | awk '{print $3}')
# Number of atoms
natom=$(sed -n '1 p' $dosfile | awk '{print $1}')
# Get the Fermi level if the OUTCAR file is present,
# else we set it to zero.
if [ -a $outfile ]; then     
echo "The" $outfile "exists, we use it to get the Fermi level,"
     echo "the RWIGS tag and the number of spins."
     efermi=$(grep "E-fermi" $outfile | tail -1 | awk '{print $3}')
     echo "Fermi level:" $efermi
     nspin=$(grep "ISPIN" $outfile | tail -1 | awk '{print $3}')
     if [ $nspin -eq 2 ]; then
        echo "Spin polarized calculation"
    else
        echo "Unpolarized calculation"
     fi
# 2.a
#JMS 2/3/03 Modified to accept specification by LORBIT token.
#lorbit=$(grep "LORBIT" $outfile | tail -1 | awk '{print $3}')
     if [ $lorbit -ge 10 ]; then
         echo "LORBIT > 10"
         echo "WARNING: not completely test for vasp.4.*"
        echo "Use at your own risk. Please check results for consistency."
        form=1
     else
# 2.a
        rwigs=$(grep "RWIGS" $outfile | tail -1 | awk '{print $3}' | sed 's/\.//g')
        if [ $rwigs -eq -100 ]; then
            echo "RWIGS token not set"
            form=0
        else
            echo "RWIGS token set"
            form=1
        fi
# 2.a
     fi
# 2.a
  else
     echo "The" $outfile "does not exist, we set the Fermi level to 0"
     echo "assume an unpolarized calculation, and RWIGS not set"
     form=0
     nspin=1
     efermi=0.0
fi
# If the outcar file is not present and you wish to set something by hand
# you should do it here. Uncomment the tokens below and set them by hand.
#efermi=2.255
#form=
#nspin=   
# Get the atomic coordinates
$BIN/vp >| tmp.dat
tail -$natom tmp.dat | awk '{printf "%s %12.8f %12.8f %12.8f \n", "#", $2, $3, $4}' >| tmp.dat2
# Total is first DOS
if [ $form -eq 0 ]; then i=0
else i=0
fi
   start=7
end=$((start+nl-1))
echo $start $end
#exit 0
rm -f DOS0
if [ $form -eq 1 ]; then
      while [ $i -le $natom ]; do
              echo $i $start $end
          if [ $i -gt 0 ]; then
            sed -n ''$i' p' tmp.dat2 >| DOS$i
        fi
          if [ $i -gt 0 ]; then
# Atomic projected DOS
            if [ $nspin -eq 2 ]; then
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5, $6, -1*$7}' >> DOS$i
            else
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3, $4 }' >> DOS$i
            fi
                          else
  # Total DOS
            if [ $nspin -eq 2 ]; then
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5 }' >> DOS$i
            else
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3 }' >> DOS$i
            fi
          fi
          start=$((end+2))
        end=$((start+nl-1))
        i=$((i+1))
     done
  else
      while [ $i -le 0 ]; do
              echo $i $start $end
          if [ $i -gt 0 ]; then
            sed -n ''$i' p' tmp.dat2 >| DOS$i
        fi
          if [ $i -gt 0 ]; then
# Atomic projected DOS
            if [ $nspin -eq 2 ]; then
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5, $6, -1*$7}' >> DOS$i
            else
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3, $4 }' >> DOS$i
            fi
                          else
# Total DOS
            if [ $nspin -eq 2 ]; then
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, -1*$3, $4, -1*$5 }' >> DOS$i
            else
                sed -n ''$start','$end' p' $dosfile | awk '{printf "%12.8f %12.8f %12.8f \n", $1+(-1)*'$efermi', $2, $3 }' >> DOS$i
            fi
          fi         
start=$((end+2))
        end=$((start+nl-1))
        i=$((i+1))
     done
  fi
  exit 0

[ Last edited by gleerat on 2010-4-11 at 22:21 ]
»Ø¸´´ËÂ¥

» ²ÂÄãϲ»¶

Ã÷²ì¡¢É÷˼¡¢óÆÐÐ
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

ÈñÀûµÄË鯬

ľ³æ (ÕýʽдÊÖ)

star watcher

¡ï ¡ï
qasd(½ð±Ò+2):лл 2010-04-12 21:56
gleerat(½ð±Ò+1): 2010-04-21 16:25
°ÑÕâÁ½¸öÏÂÍê·Åµ½Óû§Ö÷Îļþ¼ÐϵÄbinĿ¼À¸Ä³É¿ÉÖ´ÐÐÊôÐÔ¡£ÔÙµ½ÄãµÄÊý¾ÝĿ¼ÏÂÔËÐС£
2Â¥2010-04-12 10:51:29
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

mingyan988

½ð³æ (СÓÐÃûÆø)

¡ï ¡ï
xiaohunhun(½ð±Ò+2):лл 2010-04-13 19:39
gleerat(½ð±Ò+2): 2010-04-21 16:25
Äã´ÓÄãµÄbinÎļþÀォsplit_dosºÍvp¿½±´µ½ÄãÒªËãµÄÌåϵÎļþÀ²¢½«Æä¼¤»îΪ¿ÎÖ´ÐÐÎļþ£¨chmod +x £©£¬Èç¹û»¹Ëã²»ÐУ¬¾ÍÖØÐ¼ÆË㣬ÓÐʱºòvasp»á²»Õý³££¬¶àÊÔ¼¸´Î¡£
ËêÔÂÇá¿ñ
3Â¥2010-04-13 10:47:42
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ gleerat µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 318Çóµ÷¼Á +12 ykyhsa 2026-04-05 14/700 2026-04-06 17:46 by fuyu_
[¿¼ÑÐ] Ò»Ö¾Ô¸¹ú¿Æ´óÐŹ¤Ëù,Ó¢¶þÊý¶þ408×Ü·Ö293·ÖÇóµ÷¼Á +3 ilcyuan 2026-04-02 4/200 2026-04-06 16:35 by likeihood
[¿¼ÑÐ] 287·ÖÇóµ÷¼Á ÓÐרÀû¹ú½±Ò»Ö¾Ô¸¹þ¹¤´ó085406 +3 °×Ò׳½ 2026-04-06 4/200 2026-04-06 15:24 by going home
[¿¼ÑÐ] 0855Çóµ÷¼Á²ÄÁÏ +11 ºìÌÒׯׯ 2026-04-04 12/600 2026-04-06 10:26 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 085410È˹¤ÖÇÄÜ ³õÊÔ316·Ö Çóµ÷¼Á +7 ²ÐÐÇ·÷Êï 2026-03-31 7/350 2026-04-06 10:09 by À¶ÔÆË¼Óê
[¿¼ÑÐ] Ò»Ö¾Ô¸Ö£ÖÝ´óѧ085600Çóµ÷¼Á +17 ³ÔµÄ²»ÉÙ 2026-04-05 20/1000 2026-04-06 00:32 by T¿É¿ÉÎ÷ÀïT
[¿¼ÑÐ] 294Çóµ÷¼Á +4 Grey_Ey 2026-04-01 5/250 2026-04-05 23:05 by Grey_Ey
[¿¼ÑÐ] ÉúÎïÓëÒ½Ò©µ÷¼Á +4 Ê®Æßsa 2026-04-05 4/200 2026-04-05 20:05 by lys0704
[¿¼ÑÐ] Ò»Ö¾Ô¸Çà¿Æ085500£¬³õÊÔ295·Ö£¬¹«¹²¿Î213·Ö +3 Óöµ½µÄÈËÔ¸Íû¶¼Ä 2026-04-05 3/150 2026-04-05 18:45 by À¶ÔÆË¼Óê
[¿¼ÑÐ] һ־Ըͬ¼Ã´óѧ323·Ö£¨080500£©Çóµ÷¼Á +8 yikeniu 2026-04-01 8/400 2026-04-05 18:15 by cql1109
[¿¼ÑÐ] 284Çóµ÷¼Á +7 Ðìͬѧ_001 2026-04-04 13/650 2026-04-05 17:19 by yulian1987
[¿¼ÑÐ] 288Çóµ÷¼Á£¬Ò»Ö¾Ô¸»ªÄÏÀí¹¤´óѧ071005 +6 ioodiiij 2026-04-04 6/300 2026-04-05 10:09 by guoweigw
[¿¼ÑÐ] Ò»Ö¾Ô¸½­ÄÏ´óѧ085501»úе¹¤³Ìר˶326·Ö£¬±¾¿Æ¼Ñľ˹´óѧ +5 ¹ËÈô¸¡Éú 2026-04-03 9/450 2026-04-05 09:57 by 1753564080
[¿¼ÑÐ] ¿¼Ñе÷¼Á +5 ËÄ´¨ÍõÌÎ 2026-04-04 5/250 2026-04-04 22:18 by à£à£à£0119
[¿¼ÑÐ] 325Çóµ÷¼Á +4 ´º·ç²»½èÒâ 2026-04-04 4/200 2026-04-04 22:08 by à£à£à£0119
[¿¼ÑÐ] ÇóÉúÎïѧµ÷¼Á +14 15172915737 2026-04-01 14/700 2026-04-04 20:13 by babysonlkd
[¿¼ÑÐ] 309·Ö085801Çóµ÷¼Á +11 MY_angel 2026-03-31 11/550 2026-04-04 19:11 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 085600ר˶²ÄÁÏÓ뻯¹¤348·ÖÇóµ÷¼Á +10 ÉÏѧÀ²£¡ 2026-04-01 11/550 2026-04-03 14:13 by °ÙÁéͯ888
[¿¼ÑÐ] Ò»Ö¾Ô¸346ÉϺ£´óѧÉúÎïѧ +3 ÉϺ£´óѧ346µ÷¼Á 2026-04-01 3/150 2026-04-02 08:36 by w³æ³æ123
[¿¼ÑÐ] 274Çóµ÷¼Á +6 xiao°®Í¬Ñ§ 2026-03-30 6/300 2026-03-31 10:04 by cal0306
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û