# Number of coordinates in coordinate file does not match topology when using TIP4P water model

**URL:** <https://gromacs.bioexcel.eu/t/number-of-coordinates-in-coordinate-file-does-not-match-topology-when-using-tip4p-water-model/1100>\
**Category:** User discussions\
**Created:** [November 17, 2020, 9:58am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-in-coordinate-file-does-not-match-topology-when-using-tip4p-water-model/1100 "2020-11-17T09:58:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raymond](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@Raymond](https://gromacs.bioexcel.eu/u/Raymond)\
**Post date:** [November 17, 2020, 9:58am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-in-coordinate-file-does-not-match-topology-when-using-tip4p-water-model/1100/1 "2020-11-17T09:58:02Z")

</div>

GROMACS version: gromacs-5.1.4  
GROMACS modification:

Hi, I would like to address an issue with the “gmx grompp” command. I try to use TIP4P water model in my protein-water simulation system. However, there is a fatal error showing “Fatal error: number of coordinates in the coordinate file (protein\_sol.gro, 130904) does not match topology (topol.top, 129760).” when I try to run “gmx\_mpi grompp” for addition of ions.

The set of commands are listed below:

gmx\_mpi pdb2gmx -f protein.pdb -o protein.gro -water tip4p ( Amber99sb-ildn as force field)

gmx\_mpi editconf -f protein.gro -o protein\_box.gro -c -bt cubic -box 10 10 10

gmx\_mpi solvate -cp protein\_box.gro -cs tip4p.gro -p topol.top -o protein\_sol.gro

The [molecule] section of the topol.top file is as below:

[molecules]  
; Compound #mols  
Protein\_chain\_A 1  
SOL 286  
SOL 30998

May I know is it the issue with the water model? I have tried using tip3p but it doesn’t show this error.

Thank you very much.

Sincerely,  
Raymond

---

<div class="post-metadata">

**Author:** ![JohnWhittaker](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/johnwhittaker/32/126_2.png) [@JohnWhittaker](https://gromacs.bioexcel.eu/u/JohnWhittaker)\
**Post date:** [November 17, 2020, 10:31am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-in-coordinate-file-does-not-match-topology-when-using-tip4p-water-model/1100/2 "2020-11-17T10:31:56Z")

</div>

Hi,

For some reason your [molecules] directive of your topology has two entries for SOL. Add the two entries together and make only one entry as SOL 31284 (e.g., 286 + 30998 = 31284). This will make the number of atoms in your topology equal to the number of atoms that are contained in your .gro file.

- John

---

<div class="post-metadata">

**Author:** ![Raymond](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@Raymond](https://gromacs.bioexcel.eu/u/Raymond)\
**Post date:** [November 17, 2020, 10:56am UTC](https://gromacs.bioexcel.eu/t/number-of-coordinates-in-coordinate-file-does-not-match-topology-when-using-tip4p-water-model/1100/3 "2020-11-17T10:56:53Z")

</div>

Hi John,

I have tried to combined them into one entry. However, I faced the same problem.

I have try to solve it using another method. I would like to verify if my method was right.

I try to use " grep -o ‘SOL’ protein\_sol.gro | wc -l" command to find out the total number of solvent molecules in .gro, which is 125136 solvents in the .gro file. Hence, since I used a 4-point model, I tried to divide 125136 by 4 (125136/4) which gives 31284. Then, I used this value of 31284 to substitute the existing value of 30998 for SOL in the [molecule] section of topol.top. Fortunately, I managed to solve the “gmx\_mpi grompp” error for ions.

Hence, the [molecule] of topol.top file becomes:  
[molecules]  
; Compound #mols  
Protein\_chain\_A 1  
SOL 286  
SOL 31284

May I know is this the right way to get through this? The protein originally contain 286 crystal water molecules.

Sincerely,  
Raymond
