Re: atom types in PSF/PRM/RTF

From: Jason Swails (jason.swails_at_gmail.com)
Date: Thu May 28 2015 - 13:55:44 CDT

On Thu, 2015-05-28 at 19:19 +0100, Hannes Loeffler wrote:
> Many thanks. But I think it goes without question that there needs to
> be internal consistency between the files.
>
> Anyway, I have looked through the source of c38b1 and the character
> lenghts of atom types are A4 in the traditional format and A6 in the
> extended format. The data type is CHARACTER which I would expect to be
> ASCII but maybe there are differences with different compilers. In any
> case, this should, in principal at least, give a wide range of possible
> characters.

You can also check top_all36_cgenff.rtf and see that there are plenty of
atom types longer than 4 characters:

MASS 263 HGAAM0 1.00800 ! aliphatic H, NEUTRAL trimethylamine (#)
MASS 264 HGAAM1 1.00800 ! aliphatic H, NEUTRAL dimethylamine (#)
MASS 265 HGAAM2 1.00800 ! aliphatic H, NEUTRAL methylamine (#)

As Josh mentioned, the PSF file supports an "EXT" flag which expands the
width of the atom type and serial number fields to accommodate lots of
atom types and atoms.

As for the Fortran "character" type, it is an ASCII character (or, more
precisely, a 1-byte character) by default. Lots of programs depend on
this property for proper data alignment, so you can be pretty confident
that all compilers obey this.

I think you can give character a "kind" (like with other variable types)
to support other encodings, like UCS or UTF-8. But you would need to
see something like

character(kind=SELECTED_CHAR_KIND('utf-8'), len=10) :: len10_string

All the best,
Jason

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher

This archive was generated by hypermail 2.1.6 : Thu Dec 31 2015 - 23:21:54 CST