Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Locked
Message
Author
leszek_nowakowski
Newbie
Newbie
Posts: 22
Joined: Fri Mar 15, 2024 10:35 am

Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

#1 Post by leszek_nowakowski » Thu Oct 23, 2025 2:24 pm

I found a few bugs when VASP 6.4.3 is executed with IBRION=11.

CONTCAR file is the same as POSCAR, and XDATCAR file contains the same coordinates (the initial ones) for every ionic step.

CHGCAR file coordinates are also written for the initial structure, though the charge density seems to be correct with the last step.

WAVECAR file also seems to have data for the last step.

Problem persists through different systems (GPU with NVHPC-SDK and CPU with intel compilers).

I'm attaching exemplary files - for robustness it is calculated for gamma version only, but it is not relevant.

You do not have the required permissions to view the files attached to this post.

michael_wolloch
Global Moderator
Global Moderator
Posts: 209
Joined: Tue Oct 17, 2023 10:17 am

Re: Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

#2 Post by michael_wolloch » Fri Oct 24, 2025 8:53 am

Dear Leszek Nowakowski,

Thanks for reporting this bug. I could reproduce this with version 6.4.3 and with the current release version, and included it in the known issues list on the wiki.

Fortunately, the fix is simple. I already made a merge request to fix this in the next release. In the meantime, I have a patch attached for version 6.4.3.
Please copy the ibrion11_fix_6.4.3.patch file into your src/ folder and run:

Code: Select all

patch < ibrion11_fix_6.4.3.patch 

You should get this message:

Code: Select all

patching file main.F

Afterwards, delete the ibrion11_fix_6.4.3.patch file, change to the main folder, and recompile the code:

Code: Select all

rm ibrion11_fix_6.4.3.patch && cd .. && make -j3 all

This should fix the issue.

Please let me know if it works for you, and I can lock the topic.
Thanks again,
Michael

You do not have the required permissions to view the files attached to this post.

leszek_nowakowski
Newbie
Newbie
Posts: 22
Joined: Fri Mar 15, 2024 10:35 am

Re: Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

#3 Post by leszek_nowakowski » Sat Oct 25, 2025 5:46 pm

Dear Michael Wolloch,

Thanks for quick respond. I compiled the patched code once again and it works on both systems.

That issue is solved, but I have another request:
After pasting the coordinates into stdin, each time a line is printed in the OUTCAR :

Code: Select all

 positions in direct lattice

followed by coordinates, no matter what ML_OUTBLOCK is set to. It makes the OUTCAR file unnecessarily large - it does matter for hundred-thousands steps run, because it makes OUTCAR dozens GB in size. If You have the time - and the fix is (hopefully) as easy as before, it would be great to have another patch. I can see that code in poscar.F (subroutine INPOS I think) but I'm not fluent in fortran and I am not able to do it myself.

Best Regards,

Leszek


michael_wolloch
Global Moderator
Global Moderator
Posts: 209
Joined: Tue Oct 17, 2023 10:17 am

Re: Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

#4 Post by michael_wolloch » Mon Oct 27, 2025 10:28 am

Dear Leszek,

I have to say I find it a bit strange that you would manually input ion positions for hundreds of thousands of steps, and I assume that you actually don't do that, but redirect some other script to write that input ;) .
This is not the recommended way to do things. Instead of IBRION=11 you should use IBRION=12, and the Python plugin structure to make this much cleaner. Especially check out PLUGINS/STRUCTURE.

Nevertheless, I have written a small patch that should write the OUTCAR positions only every NBLOCK steps (corresponding then to XDATCAR and seems more appropriate than ML_OUTBLOCK). Since the IBRION=11 code is very contained, this was very quick again. Apply this patch as before (but after the first one) to change the behaviour.

Let me know if this works, and if I can lock the topic.

Cheers, Michael

You do not have the required permissions to view the files attached to this post.

leszek_nowakowski
Newbie
Newbie
Posts: 22
Joined: Fri Mar 15, 2024 10:35 am

Re: Bugs in CONTCAR, XDATCAR and CHGCAR when IBRION=11

#5 Post by leszek_nowakowski » Mon Oct 27, 2025 12:51 pm

Hello Michael,

Thanks for the patch - it works.

I know it sounds strange to paste hundred thousands coordinates and I don't do it manually :) I wish we had an access to VASP6.5 where the python plugins appeared, but our funds are on the way. As soon as we will have it I promise I will switch to IBRION=12 :)

Thank You for your help once again.

We can lock the topic.

Best,
Leszek


Locked