g87 file format

Main Table of Contents VERSION 4.0
GROMACS homepage Sun 18 Jan 2009

This is a simple ASCII format:
x(i) (10f8.3)
box(m) (10f8.8)
The number of atoms is not stored, neither is there any indication of whether a box is present. The box is stored only for constant pressure simulations. So, you simply have to remember this stuff.