Skip to content

Instantly share code, notes, and snippets.

@ifilot
Last active March 7, 2024 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ifilot/c83740bc21aa7231e4e7d442e16e879c to your computer and use it in GitHub Desktop.
Save ifilot/c83740bc21aa7231e4e7d442e16e879c to your computer and use it in GitHub Desktop.
VASP 6.4.2 - quickfix for negative values caused by vacuum region
--- xclib_grad.F
+++ xclib_grad.F
@@ -335,6 +335,15 @@
#ifdef USELIBXC
ELSE IF (LEXCH==99) THEN
+! fix negative values caused by vacuum region
+! see: https://www.vasp.at/forum/viewtopic.php?p=25830#p25830
+ IF (D<=0) THEN
+ EXC = 0._q
+ EXCD = 0._q
+ EXCDD = 0._q
+ RETURN
+ ENDIF
+
DTMP(1)=D
SIGMATMP(1)=DD*DD
SIGMAZERO(1)=0._q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment