Is order of #include important in file?

I have just gotten familiarized with the different file types in GROMACS and how they relate to each other for different commands.

I’m wondering if the #include function that is in file has any restrictions.
If i want to run a protein-ligand MD simulation, i will need to include the ligand.itp in file.
Does this #include “ligand.itp” need to be placed at a specific position?
What is the rationale for this, if any?


After the FF is included, and before the [ molecules ] section.

What is the reasoning for having it placed before [ molecules ] section?

That has the full details on what the topology file .top contains, plus the order.

The file is parsed only once, which implies that no forward references can be treated: items must be defined before they can be used

Using [ molecules ] without having used [ system ] before is meaningless and generates a warning.
After [ system ] the only allowed directive is [ molecules ]