[gmx-users] Read from XTC file

Florent Hédin work at fhedin.com
Thu Jul 14 10:49:33 CEST 2016


Hi,

check

http://manual.gromacs.org/online/xtc.html

and

http://www.gromacs.org/Developer_Zone/Programming_Guide/XTC_Library

They provide standalone library to compile, and examples for C and 
Fortran. But I never tried it and apparently it was last updated 2 years 
ago, I hope it can still read xtc files written with last version of gmx.

Another solution is to link you software to libgromacs.so, and call 
directly the functions like

read_first_xtc(xtcfile,&natoms,&step,&time,box,&x,&prec,&bOK)

probably using your own intermediate C <-> Fortran layer. Doing this you 
are sure to use for reading the code which was used for writing the 
trajectories.

Check also

http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html

and

http://www.neurophys.wisc.edu/comp/docs/not017/

for instructions on how to mix Fortran / C / C++

Good luck !

Florent

On 14/07/16 08:36, Saumyak Mukherjee wrote:
> Dear all,
>
> Is there any way to read trajectory using a FORTRAN 90 code directly from
> .xtc or .trr file? I am working on a trajectory for a protein with a total
> run time of 1 ns with 5 fs resolution. Converting the .xtc file to .gro
> format is producing a huge amount of data. So I intend to bypass the
> conversion and directly read the trajectory from .xtc file. Is it possible
> in FORTRAN 90?
>
> ​Thanking you,
>
> Regards,
> Saumyak Mukherjee​
>

-- 
<p>
Florent Hédin <br/>
Department of Chemistry <br/>
University of Basel <br/>
Klingelbergstrasse 80 <br/>
CH-4056 Basel, Switzerland <br/>
<a 
href="http://www.chemie.unibas.ch/~hedin">http://www.chemie.unibas.ch/~hedin</a><br/>
</p>


More information about the gromacs.org_gmx-users mailing list