From: Axel Kohlmeyer (
Date: Mon Jul 20 2009 - 19:03:45 CDT

On Mon, 2009-07-20 at 16:54 -0600, Michael Robbert wrote:


> I am wondering if anybody has looked at modifying/adding to VASP to
> get it to interface with IMD. We have recently started to look at VMD
> to visualize data from VASP, but are ultimately looking to watch the
> visualization while a simulation is running to see if it is headed in

hmm.... do you know about or have you looked at the "auto-pilot"
functionality in the quantum-espresso package? that would go
even beyond that by allowing you to change calculation parameters
of a running calculation. it has been a while since that was implemented
and i'm not sure if it is properly maintained, so i'm not sure
if it still works. it didn't include interactive visualization, though.

> the right direction or not. IMD looks ideal for that initially and I'm
> willing to put in the work to add it, but don't want to duplicate any
> work if it has already been done. I also don't want to spend too much
> time on it if somebody has looked at the problem and found it to be
> insurmountable. If nobody has looked at it then I'll present my first

i don't think anybody has tried this. you need a pretty fast machine
to get sufficient throughput of the calculation for interactive control.
for most DFT codes that i've been working with, just dumping a suitable
trajectory file would do. i've written a short script command called
"reload" that will update the last loaded trajectory file from disk
into vmd while keeping the visualization settings and view that does
the trick for me (since those trajectories take a while, even on a large
and fast machine).

> potential problem. VASP is entirely written in Fortran. Is there a
> Fortran interface for IMD or would one need to write a C wrapper
> program around VASP?

no. the other way around. for IMD you need to communicate data to
VMD via a specific protocol. this is implemented as a small C library
(don't use the example files, rather the latest IMD code from NAMD,
btw. if you are on a 64-bit machine). i don't think standard
fortran 95 doesn't have the constructs needed to implement sockets,
but it is fairly straightforward to write a wrapper around a c-code
library that emulates a specific fortran ABI (and most of those
don't differ that much anymore, these days). you can get some ideas
of how to do this from the fortran 77 interface to the molfile plugins
in the VMD plugin sources.


> Thanks,
> Mike Robbert, Colorado School of Mines

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.