[MMTK] Convert LAMMPS MD trajectory to netCDF format with MMTK convention for nMoldyn analysis.

Yi Liu yi at wag.caltech.edu
Sat Jan 24 09:13:46 UTC 2009

Hi, Konrad,

On Fri, Jan 23, 2009 at 6:30 AM, Konrad Hinsen <hinsen at cnrs-orleans.fr> wrote:
> Since it is ncgen that complains about the description string, the problem
> cannot be related to its content. For ncgen, it is just some string. So
> there is either a syntactical problem with representing the string in cdl,
> or a bug in ncgen. I haven't use ncgen or cdl very much, so I cannot say
> more about this.

I found someone else got the same error message due to the length
limit of description string. And it was considered as a bug in ncgen
in 2004. But as I mentioned before, I can not understand why the
longer string works but the shorter one does not. I probably should
throw this question to netCDF community.

> Something that you could try is running ncdump on a valid trajectory and
> then ncgen on the result. If that produces an error or an incorrect file,
> something is necessarily wrong with ncdump and/or ncgen.

I did such conversions. It turns out that I can ncdump a valid nc file
to get a cdl file, but I can not run ncgen on the resulting cdl file -
I got the same error message: "string too long, truncated". In other
words, ncgen and ncdump are not reversible if a very long string
exists. I agree with you there is probably a bug in ncdump - it does
not dump the long string, which creates a nonvalid cdl file.

> Then why not take the dcd_to_nc converter and modify it to read your LAMMPS
> file instead of the DCD file? All you need to know to do that is the LAMMPS
> format, but apparently you have all that information. If there is something
> you don't understand in the dcd_to_nc converter, just contact me.
> This seems the best solution to me because in the end you'd have a general
> one-step LAMMPS-to-nc converter that is much easier to use.

This is absolutly a good idea. I would like to write a lammps_to_nc
converter if possible. I have all information about atom number,
element, and coordinates (or velocities) for a given system. For
nMoldyn analysis on my system, I think we do not need know the
definition of molecule, residue and chain etc as defined in a standard
PDB file. (Those definitions may only be helpful for selection.) Since
my system is simiplier than the full definition of protein, I want to
get the work done with minimum effort.

I guess I need to do two things:

1. Write a LAMMPSConfiguration to create a universe (like
PDBConfiguration). Acutally I can create a (nostandard) pdb file for
my system, even though I do not really use it in calculations. So
maybe I can use PDBMoleculeFactory to create a universe?
2. Create a trajectory in nc format. In stead of DCDReader, should I
write a LAMMPSReader to do a simialr job?

Could you give me some guides on what need to be done? Thanks!

Dr. Yi Liu
Materials and Process Simulation Center (M/C 139-74)
California Institute of Technology
1200 East California Blvd.
Pasadena, California 91125
Phone: (626) 395-8137
E-mail: yi at wag.caltech.edu

More information about the mmtk mailing list