4853808f5988ee3f49e268b2570fe5aad7dce768
[alexxy/gromacs.git] / share / html / online / gro.html
1 <title>gro file format</title>
2 <LINK rel=stylesheet href="style.css" type="text/css">
3 <BODY text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#650065" alink="#FF0000">
4 <h2>gro file format</h2>
5 <CENTER><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 COLS=2 WIDTH="98%">
6 <TR>
7 <TD><font size=-1><A HREF="../online.html">Main Table of Contents</A></font></TD>
8 <TD ALIGN=RIGHT><B>VERSION 4.0</B></TR>
9 <TR><TD><font size=-1><A HREF="http://www.gromacs.org">GROMACS homepage</A></font></TD>
10 <TD ALIGN=RIGHT><B>Sun 18 Jan 2009</B></TR></TABLE></CENTER><HR>
11
12 <p>Files with the gro file extension contain a molecular structure in
13 Gromos87 format. gro files can be used as trajectory by simply
14 concatenating files. An attempt will be made to read a time value from
15 the title string in each frame, which should be preceded by
16 '<TT>t=</TT>', as in the sample below.</p>
17
18 <p>A sample piece is included below:
19 <pre>
20 MD of 2 waters, t= 0.0
21     6
22     1WATER  OW1    1   0.126   1.624   1.679  0.1227 -0.0580  0.0434
23     1WATER  HW2    2   0.190   1.661   1.747  0.8085  0.3191 -0.7791
24     1WATER  HW3    3   0.177   1.568   1.613 -0.9045 -2.6469  1.3180
25     2WATER  OW1    4   1.275   0.053   0.622  0.2519  0.3140 -0.1734
26     2WATER  HW2    5   1.337   0.002   0.680 -1.0641 -1.1349  0.0257
27     2WATER  HW3    6   1.326   0.120   0.568  1.9427 -0.8216 -0.0244
28    1.82060   1.82060   1.82060
29 </pre>
30
31 Lines contain the following information (top to bottom):
32 <ul>
33 <li>title string (free format string, optional time in ps after '<TT>t=</TT>')
34 <li>number of atoms (free format integer)
35 <li>one line for each atom (fixed format, see below)
36 <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),
37 the last 6 values may be omitted (they will be set to zero).
38 Gromacs only supports boxes with v1(y)=v1(z)=v2(z)=0.
39
40  
41 </ul>
42
43 This format is fixed, ie. all columns are in a fixed
44 position. Optionally (for now only yet with trjconv) you can write gro
45 files with any number of decimal places, the format will then be
46 <tt>n+5</tt> positions with <tt>n</tt> decimal places (<tt>n+1</tt>
47 for velocities) in stead of <tt>8</tt> with <tt>3</tt> (with
48 <tt>4</tt> for velocities). Upon reading, the precision will be
49 inferred from the distance between the decimal points (which will be
50 <tt>n+5</tt>). Columns contain the following information (from left to
51 right):
52
53 <ul>
54 <li>residue number (5 positions, integer)
55 <li>residue name (5 characters)
56 <li>atom name (5 characters)
57 <li>atom number (5 positions, integer)
58 <li>position (in nm, x y z in 3 columns, each 8 positions with 3
59 decimal places)
60 <li>velocity (in nm/ps (or km/s), x y z in 3 columns, each 8 positions with 4 
61 decimal places)
62 </ul>
63
64 Note that separate molecules or ions (e.g. water or Cl-) are regarded
65 as residues.  If you want to write such a file in your own program
66 without using the GROMACS libraries you can use the following formats:
67
68 <dl>
69 <dt>C format 
70 <dd><tt>"%5d%5s%5s%5d%8.3f%8.3f%8.3f%8.4f%8.4f%8.4f"</tt>
71 <dt>Fortran format 
72 <dd><tt>(i5,2a5,i5,3f8.3,3f8.4)</tt>
73 <dt>Pascal format
74 <dd>This is left as an exercise for the user
75 </dl>
76 Note that this is the format for writing, as in the above example
77 fields may be written without spaces, and therefore can not be read
78 with the same format statement in C.
79 <hr>
80 <div ALIGN=RIGHT>
81 <font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
82
83 </div>
84 </body>