From: Axel Kohlmeyer (
Date: Thu Jul 31 2008 - 19:11:11 CDT

On Thu, 31 Jul 2008, Nicolas Bigaouette wrote:

NB> [...]
NB> But when I import them in VMD, the position are multiplied by 10, so it is
NB> (0,2,2) instead of (0,0.2,0.2)
NB> It did not happen with other file format (VTF). I checked the source, and to
NB> my surprise there is a comment at the begining of Gromacs.h:
NB> * o gro_rec() assumes positions in .gro files are nanometers and
NB> * converts to angstroms, whereas they really could be any unit
NB> and a couple of lines later, there is a degine:
NB> #define ANGS_PER_NM 10
NB> Why is it converting the file's value?? If the data file is wrong, then I
NB> prefer changing it myself then having to hack VMD's code to remove the
NB> scaling factor. The file says 0.2, I want to see 0.2 in VMD.


VMD's internal units are angstrom and Gromacs uses nanometers.
this is not wrong, but required for consistency. if you change
this scaling factor, all hell will break loose since nothing will
work anymore that handles molecular systems, _particularly_ real
gromacs output. if you want the same numbers in VMD than you write
to your files, use a file format that uses angstrom as internal units.


NB> I did a patch to change that:
NB> --- plugins/molfile_plugin/src/Gromacs.h.orig 2008-07-31
NB> 19:26:41.000000000 -0400
NB> +++ plugins/molfile_plugin/src/Gromacs.h 2008-07-31 19:27:11.000000000
NB> -0400
NB> @@ -96,8 +96,10 @@
NB> #define MAX_G96_LINE 500 // Maximum line length of .g96 files
NB> #define MAX_TRX_TITLE 80 // Maximum length of a title in .trX
NB> #define MAX_MDIO_TITLE 80 // Maximum supported title length
NB> -#define ANGS_PER_NM 10 // Unit conversion factor
NB> -#define ANGS2_PER_NM2 100 // Unit conversion factor
NB> +//#define ANGS_PER_NM 10 // Unit conversion factor
NB> +//#define ANGS2_PER_NM2 100 // Unit conversion factor
NB> +#define ANGS_PER_NM 1 // Unit conversion factor
NB> +#define ANGS2_PER_NM2 1 // Unit conversion factor
NB> // All the supported file types and their respective extensions

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.