From 24637dc007223105656db661c41fb69a890a64ab Mon Sep 17 00:00:00 2001 From: calandra Date: Fri, 16 Apr 2010 14:51:55 +0000 Subject: [PATCH] Nev version of the script to extract core-wavefunctions from gipaw pseudopotentials. This new version extracts the core wavefunction from UPF version 1 and UPF version 2. Provided by A. Seitsonen. MCB git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@6634 c92efa57-630b-4861-b058-cf58834340f0 --- XSpectra/upf2plotcore.sh | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/XSpectra/upf2plotcore.sh b/XSpectra/upf2plotcore.sh index 8b5036550..56365188b 100755 --- a/XSpectra/upf2plotcore.sh +++ b/XSpectra/upf2plotcore.sh @@ -4,6 +4,9 @@ LANG=C cat $1 | awk ' + +# + /Number of points in mesh/ { nris = $1 } @@ -38,6 +41,56 @@ cat $1 | awk ' } } +# + + +# + +/mesh_size=/ { + nris = $0 + gsub ( "[ ]*mesh_size=\"", "", nris ) + gsub ( "\"[ ]*$", "", nris ) +} + +// { + if ( $1 != "/ { + st = $1; gsub ( "[0-9]*", "", st ) +# if ( index( $0, "label=" ) != 0 && index( $0, "label=\"1S\"" ) == 0 ) { next } + + if ( index( $0, " n=\"" ) != 0 || index( $0, "^n=\"" ) != 0 ) { + n[proj] = $0 + gsub( "[a-z0-9A-Z=_.<> \"]*n=\"", "", n[proj] ) + gsub( "[\">]*$", "", n[proj] ) + n[proj] = int ( n[proj] + 1e-5 ) + } + + if ( index( $0, " l=\"" ) != 0 || index( $0, "l=\"" ) == 1 ) { + l[proj] = $0 + gsub( "[a-z0-9A-Z=_.<> \"]*l=\"", "", l[proj] ) + gsub( "[\">]*$", "", l[proj] ) + l[proj] = int ( l[proj] + 1e-5 ) + } + + if ( index( $0, ">" ) != 0 || index( $0, "<" ) != 0 ) { next } + for ( i = 1; i <= NF; i++ ) { + f[++val_wfc,proj] = $i + } + +} + +# + END {