changed reading hint
[gromacs/adressmacs.git] / share / html / online / gro.html
blob389a8538da5132948b9cc2a055c3005bc89d8027
1 <title>gro file format</title>
2 <body>
3 <h1>gro file format</h1>
5 <p>Files with the gro file extension contain a molecular structure in
6 gromos format. gro files can be used as trajectory by simply
7 concatenating files. An attempt will be made to read a time value from
8 the title string in each frame, which should be preceded by
9 '<TT>t=</TT>', as in the sample below.</p>
11 <p>A sample piece is included below:
12 <pre>
13 MD of 2 waters, t= 0.0
15 1WATER OW1 1 0.126 1.624 1.679 0.1227 -0.0580 0.0434
16 1WATER HW2 2 0.190 1.661 1.747 0.8085 0.3191 -0.7791
17 1WATER HW3 3 0.177 1.568 1.613 -0.9045 -2.6469 1.3180
18 2WATER OW1 4 1.275 0.053 0.622 0.2519 0.3140 -0.1734
19 2WATER HW2 5 1.337 0.002 0.680 -1.0641 -1.1349 0.0257
20 2WATER HW3 6 1.326 0.120 0.568 1.9427 -0.8216 -0.0244
21 1.82060 1.82060 1.82060
22 </pre>
24 Lines contain the following information (top to bottom):
25 <ul>
26 <li>title string (free format string, optional time in ps after '<TT>t=</TT>')
27 <li>number of atoms (free format integer)
28 <li>one line for each atom (fixed format, see below)
29 <li>box (free format, space separated reals)
30 </ul>
32 This format is fixed, ie. all columns are in a fixed
33 position. Optionally (for now only yet with trjconv) you can write gro
34 files with any number of decimal places, the format will then be
35 <tt>n+5</tt> positions with <tt>n</tt> decimal places (<tt>n+1</tt>
36 for velocities) in stead of <tt>8</tt> with <tt>3</tt> (with
37 <tt>4</tt> for velicities). Upon reading, the precision will be
38 inferred from the distance between the decimal points (which will be
39 <tt>n+5</tt>). Columns contain the following information (from left to
40 right):
42 <ul>
43 <li>residue number (5 positions, integer)
44 <li>residue name (5 characters)
45 <li>atom name (5 characters)
46 <li>atom number (5 positions, integer)
47 <li>position (in nm, x y z in 3 columns, each 8 positions with 3
48 decimal places)
49 <li>velocity (in nm/ps (or km/s), x y z in 3 columns, each 8 positions with 4
50 decimal places)
51 </ul>
53 Note that separate molecules or ions (e.g. water or Cl-) are regarded
54 as residues. If you want to write such a file in your own program
55 without using the GROMACS libraries you can use the following formats:
57 <dl>
58 <dt>C format
59 <dd><tt>"%5d%5s%5s%5d%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f"</tt>
60 <dt>Fortran format
61 <dd><tt>(i5,2a5,i5,3f8.3,3f8.4)</tt>
62 <dt>Pascal format
63 <dd>This is left as an exercise for the user
64 </dl>
65 Note that this is the format for writing, as in the above example
66 fields may be written without spaces, and therefore can not be read
67 with the same format statement in C.
68 </body>