# Invalid order for directive atomtypes

**URL:** <https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221>\
**Category:** User discussions\
**Tags:** forcefield, mdp-parameters\
**Created:** [May 25, 2021, 2:52pm UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221 "2021-05-25T14:52:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azam](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@Azam](https://gromacs.bioexcel.eu/u/Azam)\
**Post date:** [May 25, 2021, 2:52pm UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221/1 "2021-05-25T14:52:43Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
I am trying run a simulation for a glycoprotein in a mixture solvent including water and ionic liquide, using parameters from swissparam.  
I modified the topol.top file generated by pdb2gmx and added the following statement, before all other lines referring to the protein or ions :

#include “ligand.itp”  
and that worked and I can run simulation in water without any problem.

But, about the .itp file of co-solvent, I tried different places such as after and before lines referring to the protein or ions and water,and every time after

gmx grompp -f ions.mdp -c solv.gro -p topol.top -o ions.tpr

I countered identical error:

Fatal error:  
Syntax error - File C10.itp, line 7  
Last line read:  
'[atomtypes] ’  
Invalid order for directive atomtypes

can you advice me how resolve this issue? or send an example of topol.top file?

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 25, 2021, 6:50pm UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221/2 "2021-05-25T18:50:08Z")

</div>

Hi Azam,

I have encountered the same error a few times, too. I believe you can only have _one_ `[atomtypes]` directive and I am pretty sure it has to come before any definition of molecule types, bonds, angles and dihedrals. And I mean: _one_ in total, accounting for all .itp files.  
What I have always resorted to is to ‘hack’ the .itp(s) and incude all atom types in a single file (first include), which is admittedly a bit sloppy but I could not find any better way to do it.

Michele

---

<div class="post-metadata">

**Author:** ![Azam](https://avatars.discourse-cdn.com/v4/letter/a/ea666f/32.png) [@Azam](https://gromacs.bioexcel.eu/u/Azam)\
**Post date:** [May 26, 2021, 8:15am UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221/3 "2021-05-26T08:15:02Z")

</div>

Dear Michele, thanks for your reply. Do you mean I have to add atomtypes of my solvent in to itp file of my ligand? how about pairtypes, atoms , bonds,…?  
did you do this work for yourself and it worked?

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 26, 2021, 8:06pm UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221/4 "2021-05-26T20:06:59Z")

</div>

Indeed, unless they are not included already (then I guess it would mean there is some atomtypes duplicate).  
I believe you may have multiple declarations of molecule types and bonds, not sure about pairtypes.

---

<div class="post-metadata">

**Author:** ![s.s](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@s.s](https://gromacs.bioexcel.eu/u/s.s)\
**Post date:** [September 15, 2021, 1:07pm UTC](https://gromacs.bioexcel.eu/t/invalid-order-for-directive-atomtypes/2221/5 "2021-09-15T13:07:31Z")

</div>

Can you please tell how did you create .itp file for ligand. I tried ligand parametrization with CGenFF but the .str file has very large penalty values. so. I tried using swissparam website for the same and the .itp file and .par (i presume this is a parameter file) were included in system.top file but I’m getting errors like:

WARNING 46 [file jz4.par, line 59]:  
Too few parameters on line (source file  
/home/…/Downloads/gromacs-2018.3/src/gromacs/gmxpreprocess/toppush.cpp, line 977)

ERROR 9 [file jz4.par, line 60]:  
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 10 [file jz4.par, line 61]:  
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 11 [file jz4.par, line 62]:  
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 12 [file jz4.par, line 63]:  
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 13 [file jz4.par, line 64]:  
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

Generated 100465 of the 100576 non-bonded parameter combinations  
Generating 1-4 interactions: fudge = 1  
Generated 66298 of the 100576 1-4 parameter combinations

* * *

Program: gmx grompp, version 2018.3  
Source file: src/gromacs/gmxpreprocess/topio.cpp (line 799)

Fatal error:  
Syntax error - File jz4.itp, line 7  
Last line read:  
'[atomtypes] ’  
Invalid order for directive atomtypes
