*FILENAME: extract-coordinate-frame.inp
*PURPOSE: get coordinates at one specific time point from trajectory
*AUTHOR: Lennart Nilsson, Karolinska Institutet, October 2003
!unix environment variable CHM_HOME points to CHARMM installation directory
read rtf card name $CHM_HOME/toppar/top_all22_prot.inp
read para card name $CHM_HOME/toppar/par_all22_prot.inp
read psf card name my_psf.psf

! open trajectory file that contains the snapshot we want
open unit 51 read unform name my_traj.cor

! to get just one frame we use "read coor file" (see io.doc, especially if
! if you want more than a few coordinate sets); the traj command (dynamc.doc and
! example script interaction-energy.inp) is better if you want to get many equidistant
! frames
! the ifile parameter is the sequential number of the frame you want in this trajectory file,
! it is not the integration timestep or the time in ps
! Assume now that my_traj.cor contains a trajectory running from integration step 10250 to 20000
! with 250 steps between frames, (with an integration timestep of 2fs this corresponds to
! 20.5 - 40.0 ps at 0.5 ps interval).
! To get the frame at 22.5 ps (integration step 11500) we need the 5th frame (coordinate set)

read coor file ifile 5 unit 51

Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden