# Fatal error: Syntax error - File ffnonbonded.itp, line 5 Last line read: '\[ atomtypes \]' Invalid ord

**URL:** <https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427>\
**Category:** User discussions\
**Tags:** forcefield, grompp\
**Created:** [October 28, 2024, 10:37am UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427 "2024-10-28T10:37:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arbazattar11](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Arbazattar11](https://gromacs.bioexcel.eu/u/Arbazattar11)\
**Post date:** [October 28, 2024, 10:37am UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/1 "2024-10-28T10:37:01Z")

</div>

GROMACS version: 2023.1-Ubuntu\_2023.1\_2ubuntu1  
GROMACS modification: Yes  
Here post your question ;

This force field generated by charmm2gmx.py from  
; multiple charmm parameter files  
; and multiple charmm topology files  
#define \_FF\_CHARMM

; This GROMACS version was created from:  
; CHARMM parameters: multiple files  
; CHARMM topology: multiple files  
; Please see forcefield.doc for files and references

#include “ffnonbonded.itp”  
#include “ffbonded.itp”  
#include “gb.itp”

; Allow the user to specify CHARMM36 parameters, instead  
; Default behavior is to use CHARMM36m  
#ifdef USE\_OLD\_C36  
#include “old\_c36\_cmap.itp”  
#else  
#include “cmap.itp”  
#endif

#include “nbfix.itp”  
#include “silcs.itp”

ffnonbonded.itp:  
; This force field generated by charmm2gmx.py from  
; multiple charmm parameter files  
; and multiple charmm topology files

[atomtypes]  
;type atnum mass charge ptype sigma epsilon  
AG 47 107.868200 0.000 A 0.263260571210 19.07904  
AL 13 26.981540 0.000 A 0.391995435982 2.71960  
ALG1 13 26.981540 0.000 A 0.356359487256 2.71960  
AU 79 196.966500 0.000 A 0.262904211723 22.13336  
BAR 56 137.327000 0.000 A 0.336759715457 0.62760  
BG201 5 10.811000 0.000 A 0.454358346252 0.15899  
BRGA1 35 79.904000 0.000 A 0.351014094947 2.00832  
BRGA2 35 79.904000 0.000 A 0.365268474438 2.21752  
BRGA3 35 79.904000 0.000 A 0.356359487256 2.25936  
BRGR1 35 79.904000 0.000 A 0.352795892384 1.33888  
C 6 12.011000 0.000 A 0.356359487256 0.46024  
C3 6 12.011000 0.000 A 0.405358916754 0.08368  
CA 6 12.011000 0.000 A 0.355005321205 0.29288  
CAD 48 112.411000 0.000 A 0.241789912103 0.50208  
CAI 6 12.011000 0.000 A 0.354577689820 0.30543

* * *

Program: gmx grompp, version 2023.1-Ubuntu\_2023.1\_2ubuntu1  
Source file: src/gromacs/gmxpreprocess/topio.cpp (line 577)

Fatal error:  
Syntax error - File ffnonbonded.itp, line 5  
Last line read:  
‘[atomtypes]’  
Invalid order for directive atomtypes

## For more information and tips for troubleshooting, please check the GROMACS website at [Common Errors — GROMACS webpage https://www.gromacs.org documentation](http://www.gromacs.org/Documentation/Errors)

* * *

MPI\_ABORT was invoked on rank 0 in communicator MPI\_COMM\_WORLD  
with errorcode 1.

## NOTE: invoking MPI\_ABORT causes Open MPI to kill all MPI processes. You may or may not see output from other processes, depending on exactly when Open MPI kills them.

why this error showing up again and again i used cgenff for parametrize while used there feature convert to gromacs foramat…

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [October 28, 2024, 3:10pm UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/2 "2024-10-28T15:10:50Z")

</div>

Did you follow the link? More specifically to [Common errors when using GROMACS - GROMACS 2024.3 documentation](https://manual.gromacs.org/current/user-guide/run-time-errors.html#invalid-order-for-directive-xxx). This is explained a bit more in a recent thread: [No default Improper Dih. types - #2 by MagnusL](https://gromacs.bioexcel.eu/t/no-default-improper-dih-types/10398/2).

---

<div class="post-metadata">

**Author:** ![Arbazattar11](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Arbazattar11](https://gromacs.bioexcel.eu/u/Arbazattar11)\
**Post date:** [October 29, 2024, 8:45am UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/3 "2024-10-29T08:45:07Z")

</div>

yes @MagnusL I followed the link But the error with the protein-ligand complex Because I have both protein forcefield.itp & ligand forcefield.itp, my .top file look like this  
; Force field was read from current directory or a relative path - path added.  
;

; Include forcefield parameters  
#include “./charmm36-jul2022.ff/forcefield.itp”

; Include ligand parameters  
#include “./charmm36.ff/forcefield.itp”

[moleculetype]  
; Name nrexcl  
Protein\_chain\_A 3

& if i am adding [defaults] in both .itp its giving me this error  
“Found a second defaults directive.”  
or if i am removing [default] from one .itp it giving me this error  
“‘[atomtypes]’  
Invalid order for directive atomtypes”  
please can you explain how to resolve this issue

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [October 29, 2024, 8:55am UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/4 "2024-10-29T08:55:41Z")

</div>

You should not include two `forcefield.itp` files. In most cases you would only get the required parameters for your ligand in a separate itp file.

You will need to break out what you need from “./charmm36.ff/forcefield.itp” into a separate file, e.g., “ligand\_types.itp”. The sections I would recommend are `[atomtypes]`, `[bondtypes]`, `[angletypes]` and `[dihedraltypes]`. I would recommend only including the parameters that are needed for the ligand, but are not already present in “./charmm36-jul2022.ff/forcefield.itp”.

Then I would recommend making another new file, e.g., “ligand.itp” (possibly named the same as your ligand) starting with a `[moleculetype]` section and then then the `[atoms]`, `[bonds]`, `[angles]` … sections.

Then you can put

```auto
; Include forcefield parameters
#include “./charmm36-jul2022.ff/forcefield.itp”
; Include forcefield parameters required for the ligand
#include "ligand_parameters.itp"
; Include the topology specification of the ligand
#include "ligand.itp"

```

in your topology file.

---

<div class="post-metadata">

**Author:** ![Arbazattar11](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@Arbazattar11](https://gromacs.bioexcel.eu/u/Arbazattar11)\
**Post date:** [October 29, 2024, 12:36pm UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/5 "2024-10-29T12:36:39Z")

</div>

Excluding 3 bonded neighbours molecule type ‘Other’

ERROR 1 [file tip3p.itp, line 4]:  
moleculetype SOL is redefined

There was 1 NOTE

* * *

Program: gmx grompp, version 2023.1-Ubuntu\_2023.1\_2ubuntu1  
Source file: src/gromacs/gmxpreprocess/toppush.cpp (line 1518)

Fatal error:  
There was 1 error in input file(s)

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [October 29, 2024, 1:18pm UTC](https://gromacs.bioexcel.eu/t/fatal-error-syntax-error-file-ffnonbonded-itp-line-5-last-line-read-atomtypes-invalid-ord/10427/6 "2024-10-29T13:18:52Z")

</div>

You shouldn’t copy any molecule types except your ligand into “ligand.itp”.
