Topology file error after adding dihedral

GROMACS version: 2022.5
GROMACS modification: Plumed

Dear Gromacs users and developers,
I am trying to add a new residue using OPLS/AA force field.

No problems until I added a custom dihedral angle in the aminoacids.rtp file, like this

[ dihedrals ]
C8 N1 C6 O1 dih_1

In the ffbonded.itp files, I used this syntax to add the parameters:

[ dihedraltypes ]
#define dih_1 3 …

where I added the correct parameters for a RB type dihedral.

When I generate the topology from a pdb using pdb2gmx, the topology file seems to be correct (no error messages about missing parameters for the ff) but this happens:

[ dihedrals ]
; ai aj ak al funct
29 35 45 34 3 dih_1

The indeces of the atoms and the function are correct, but it includes the definition of the dihedral. When I use grompp to generate the .tpr file, it complains because it finds more parameters than expected.

I cannot find the mistake here.
Have you some suggestions?

I thank you in advance for your support.

With my best regards,
Tommaso

The dihedral type (3 here) should not be part of the #defined variable - it will be inferred from the .rtp directive [ bondedtypes ] at the top of the file. So I guess instead of 6 values C0…C6 you’re introducing 7, and that’s what grompp complains about.

Thanks for your reply, this solved my problem.