Dear all,
I am running calculations on the S22 benchmark set, by generating POSCAR files through ASE. In the standard output from ASE, most of the structures are given in such a way that none of the elements are grouped together (of course, one can fix this easily within ASE, but that is not the point of this bug report). In other words, each atom has an entry on the ion species and numbers lines in the POSCAR. By running calculations on this set of POSCARs, I discovered (I think?) some undocumented behaviour. Essentially, there is a maximum number of element types that VASP can correctly output in the CONTCAR on the ion species and numbers lines, namely 20. If more entries/element types are included, those are printed on a new line. Unfortunately, this breaks the formatting rules for POSCARs/CONTCARs, making it unreadable by, e.g., VASP and ASE. The position lines are outputted correctly, it is just the species lines that are incorrectly outputted as multiple lines.
This is an example for the Uracil_dimer_stack entry (ID=13) in the S22 set, using ASE, for which VASP can correctly run calculations, but not produce a correct CONTCAR:
N C H C H C O N H C O H N C H C H C O N H C O H
1.0000000000000000
18.0000000000000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 19.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 20.0000000000000000
N C H C H C O N H C O H N C H C H C O N H C O H
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Cartesian
24 lines of position data
And the resulting faulty CONTCAR from a otherwise correct calculation:
N C H C H C O N H C O H N C
1.00000000000000
18.0000000000000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 19.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 20.0000000000000000
N C H C H C O N H C O H N C H C H C O N
H C O H
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1
Direct
24 lines of position data
I have tried to track down the responsible code. If I am not mistaken, in VASP6.5.1, poscar.F:1585 and 1590 are responsible. The respective lines:
WRITE(IU, '(20A16)') (FULLTYP(NT)(:14),NT=1,T_INFO%NTYP)
WRITE(IU,'(20A5)') (T_INFO%TYPE(NT),NT=1,T_INFO%NTYP)
From this it becomes obvious what the issue is (if I am not misreading the code; my knowledge on fortran write formatting is rusty): It is limited to 20 variables. However, there is nothing in there to correct, exit or at least print warnings if you go beyond 20 elements.
Kind regards,
Nick

