Page 1 of 1

PATCH fock.F, uninitialized variable SZPRECFOCK breaks vasprun.xml

Posted: Tue Aug 17, 2010 11:32 am
by slabanja
Problem: As of 5.2.8, vasprun.xml can contain NULL-bytes after the PRECFOCK-tag.

I guess that the part of the code that is supposed to initialize the variable SZPRECFOCK is only called conditionally. Other conditions (possibly always) control whether PRECFOCK is written to the vasprun.xml-file. The uninitialized state of SZPRECFOCK (can) cause NULL-bytes to be written, rendering a broken vasprun.xml-file.

A trivial patch is included below.

Best regards,
Mattias Slabanja

--- a/vasp.5.2/fock.F
+++ b/vasp.5.2/fock.F
@@ -36,7 +36,7 @@ MODULE fock
! F fast (coarse grid for HF, soft augmentation charge)
! N normal (normal grid for HF, normal augmentation charge)
! A accurate (normal grid for HF, soft augmentation charge)
- CHARACTER (6), SAVE :: SZPRECFOCK
+ CHARACTER (6), SAVE :: SZPRECFOCK = ' '
REAL(q) :: ENCUTFOCK ! no longer supported

! use EXX-optimized effective potential method

PATCH fock.F, uninitialized variable SZPRECFOCK breaks vasprun.xml

Posted: Tue Aug 17, 2010 11:35 am
by slabanja
ehm, the forum reformatted the patch. :(
There were supposed to be SIX spaces in between the quote marks.