[CPMD-list] conversion pseudopotential format

Wolfram Quester wolfi at mittelerde.physik.uni-konstanz.de
Tue Aug 1 09:58:42 CEST 2006


Hi Zhihui,

On Mon, Jul 31, 2006 at 10:24:02PM -0500, GU ZHIHUI wrote:
> Dear all,
>  
> Could anyone know and tell me how to convert the pseudopotential generated
> by fhi98PP to the CPMD format pseudopotential?

Ari P Seitsonen once added the possibility to generate cpmd-formatted
pseudo-potentials to the psgen script from the fhi98 code, see [1].

Later I took a newer version of the code and merged it with Ari's. A
patch for this is attached and I guess it still applies to the newest
version of the code. If you have problems, just drop me an email.

HTH,

Wolfi
>  
> Many thanks!
>  
> Zhihui Gu
> 


[1] http://www.cpmd.org/pipermail/cpmd-list/2002-February/000025.html
> _______________________________________________
> CPMD-list mailing list
> CPMD-list at cpmd.org
> http://cpmd.org/mailman/listinfo/cpmd-list

-------------- next part --------------
Ari P Seitsonen once added the possibility to generate cpmd-formatted
pseudo-potentials to the psgen script from the fhi98 code, see
http://www.cpmd.org/pipermail/cpmd-list/2002-February/000025.html

This patch merges his changes to later versions of the code.
Patch by W. Quester (wolfi at mittelerde.physik.uni-konstanz.de)


--- work/psgen.ari	2003-08-18 17:42:27.000000000 +0200
+++ work/psgen	2006-03-06 20:54:17.000000000 +0100
@@ -413,6 +348,127 @@
 
 #                     ======= done with fhi94md output ======
 
+##### output for CPMD
+
+set nmesh=`head -1 fort.40 | awk '{print $2}'`
+
+### Atom
+
+echo '&ATOM' >> ${OUT}.pp
+
+cat > awkfile << EOF
+BEGIN {
+  getline <"${INI}"
+  printf " Z  = %3d\n", \$1
+  xc = \$4
+
+  getline <"fort.40"
+  printf " ZV = %9.5lf\n", \$NF
+
+# 3 = CA/PZ 4 = GGA91 5 = BP 6 = PBE 8 = CA/PW 9 = BLYP
+  if ( xc == 3 ) { exch = 0; corr = 0 }
+  if ( xc == 4 ) { exch = 2; corr = 3 }
+  if ( xc == 5 ) { exch = 1; corr = 1 }
+  if ( xc == 6 ) { exch = 3; corr = 4 }
+  if ( xc == 8 ) { exch = 0; corr = 0 }
+  if ( xc == 9 ) { exch = 1; corr = 2 }
+  printf " XC = %1d%1d    0.666667\n", exch, corr
+}
+EOF
+
+awk -f awkfile /dev/null >> ${OUT}.pp
+
+echo " TYPE = NORMCONSERVING NUMERIC" >> ${OUT}.pp
+
+echo '&END' >> ${OUT}.pp
+
+### Info
+
+echo '&INFO' >> ${OUT}.pp
+
+cat ${INI} >> ${OUT}.pp
+
+echo '&END' >> ${OUT}.pp
+
+### Potential
+
+echo '&POTENTIAL' >> ${OUT}.pp
+
+echo "LOGSCALE" >> ${OUT}.pp
+
+cat > awkfile << EOF
+BEGIN { lines = ${nmesh}; print lines;
+  getline <"fort.40"; getline <"fort.41";
+  getline <"fort.42"; getline <"fort.43";
+  getline <"fort.44";
+  for ( line = 0; line < lines; line++ ) {
+    getline <"fort.40"; r = \$2; v_s = \$4
+    getline <"fort.41"; v_p = \$4; \$4 = ""
+    getline <"fort.42"; v_d = \$4; \$4 = ""
+    getline <"fort.43"; v_f = \$4; \$4 = ""
+    getline <"fort.44"; v_g = \$4; \$4 = ""
+    print r, v_s, v_p, v_d, v_f, v_g
+  }
+}
+EOF
+
+awk -f awkfile /dev/null >> ${OUT}.pp
+
+echo '&END' >> ${OUT}.pp
+
+### Wave function
+
+echo '&WAVEFUNCTION' >> ${OUT}.pp
+
+cat > awkfile << EOF
+BEGIN {
+  sc = 1.0 / sqrt ( 12.566370614359172954 )
+
+  lines = ${nmesh}; print lines;
+  getline <"fort.40"; getline <"fort.41";
+  getline <"fort.42"; getline <"fort.43";
+  getline <"fort.44";
+  for ( line = 0; line < lines; line++ ) {
+    getline <"fort.40"; r = \$2; v_s = \$3
+    getline <"fort.41"; v_p = \$3; \$3 = ""
+    getline <"fort.42"; v_d = \$3; \$3 = ""
+    getline <"fort.43"; v_f = \$3; \$3 = ""
+    getline <"fort.44"; v_g = \$3; \$3 = ""
+    print r, v_s * sc, v_p * sc, v_d * sc, v_f * sc, v_g * sc
+  }
+}
+EOF
+
+awk -f awkfile /dev/null >> ${OUT}.pp
+
+echo '&END' >> ${OUT}.pp
+
+### NLCC
+
+if ( -e fort.27 ) then
+
+echo '&NLCC' >> ${OUT}.pp
+echo 'NUMERICAL' >> ${OUT}.pp
+
+cat > awkfile << EOF
+BEGIN { lines = ${nmesh}; print lines;
+  for ( line = 0; line < lines; line++ ) {
+    getline <"fort.27"; r = \$1; dens = \$2
+    printf "%15.10lf%25.10lf\n", r, dens / 12.566370614359172954
+  }
+}
+EOF
+
+awk -f awkfile /dev/null >> ${OUT}.pp
+rm -f awkfile
+#echo ${nmesh} >> ${OUT}.pp
+#cat fort.27 >> ${OUT}.pp
+
+echo '&END' >> ${OUT}.pp
+endif
+
+##### end of output for CPMD
+
 # hardcopies
        
 if( $?SAVE ) then
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://cpmd.org/pipermail/cpmd-list/attachments/20060801/a08adc5f/attachment.pgp 


More information about the CPMD-list mailing list