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