2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team,
6 * Copyright (c) 2013, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
58 #include "tngio_for_tools.h"
65 #include "checkpoint.h"
68 #include "gromacs/fileio/timecontrol.h"
70 /* defines for frame counter output */
75 /* Globals for gromos-87 input */
77 effXYZ, effXYZBox, effG87, effG87Box, effNR
91 char *persistent_line; /* Persistent line for reading g96 trajectories */
94 /* utility functions */
96 gmx_bool bRmod_fd(double a, double b, double c, gmx_bool bDouble)
101 tol = 2*(bDouble ? GMX_DOUBLE_EPS : GMX_FLOAT_EPS);
103 iq = (int)((a - b + tol*a)/c);
105 if (fabs(a - b - c*iq) <= tol*fabs(a))
117 int check_times2(real t, real t0, gmx_bool bDouble)
122 /* since t is float, we can not use double precision for bRmod */
127 if ((!bTimeSet(TBEGIN) || (t >= rTimeValue(TBEGIN))) &&
128 (!bTimeSet(TEND) || (t <= rTimeValue(TEND))))
130 if (bTimeSet(TDELTA) && !bRmod_fd(t, t0, rTimeValue(TDELTA), bDouble))
139 else if (bTimeSet(TEND) && (t >= rTimeValue(TEND)))
145 fprintf(debug, "t=%g, t0=%g, b=%g, e=%g, dt=%g: r=%d\n",
146 t, t0, rTimeValue(TBEGIN), rTimeValue(TEND), rTimeValue(TDELTA), r);
151 int check_times(real t)
153 return check_times2(t, t, FALSE);
156 static void initcount(t_trxstatus *status)
158 status->__frame = -1;
161 static void status_init(t_trxstatus *status)
164 status->xframe = NULL;
166 status->__frame = -1;
167 status->persistent_line = NULL;
172 int nframes_read(t_trxstatus *status)
174 return status->__frame;
177 static void printcount_(t_trxstatus *status, const output_env_t oenv,
178 const char *l, real t)
180 if ((status->__frame < 2*SKIP1 || status->__frame % SKIP1 == 0) &&
181 (status->__frame < 2*SKIP2 || status->__frame % SKIP2 == 0) &&
182 (status->__frame < 2*SKIP3 || status->__frame % SKIP3 == 0))
184 fprintf(stderr, "\r%-14s %6d time %8.3f ", l, status->__frame,
185 output_env_conv_time(oenv, t));
189 static void printcount(t_trxstatus *status, const output_env_t oenv, real t,
193 printcount_(status, oenv, bSkip ? "Skipping frame" : "Reading frame", t);
196 static void printlast(t_trxstatus *status, const output_env_t oenv, real t)
198 printcount_(status, oenv, "Last frame", t);
199 fprintf(stderr, "\n");
202 static void printincomp(t_trxstatus *status, t_trxframe *fr)
204 if (fr->not_ok & HEADER_NOT_OK)
206 fprintf(stderr, "WARNING: Incomplete header: nr %d time %g\n",
207 status->__frame+1, fr->time);
211 fprintf(stderr, "WARNING: Incomplete frame: nr %d time %g\n",
212 status->__frame+1, fr->time);
216 int prec2ndec(real prec)
220 gmx_fatal(FARGS, "DEATH HORROR prec (%g) <= 0 in prec2ndec", prec);
223 return (int)(log(prec)/log(10.0)+0.5);
226 real ndec2prec(int ndec)
228 return pow(10.0, ndec);
231 t_fileio *trx_get_fileio(t_trxstatus *status)
236 tng_trajectory_t trx_get_tng(t_trxstatus *status)
241 void clear_trxframe(t_trxframe *fr, gmx_bool bFirst)
248 fr->bFepState = FALSE;
279 void set_trxframe_ePBC(t_trxframe *fr, int ePBC)
281 fr->bPBC = (ePBC == -1);
285 int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
286 const atom_id *ind, gmx_conect gc)
289 rvec *xout = NULL, *vout = NULL, *fout = NULL;
306 else if (status->fio)
308 ftp = gmx_fio_getftp(status->fio);
312 gmx_incons("No input file available");
324 gmx_fatal(FARGS, "Need coordinates to write a %s trajectory",
338 for (i = 0; i < nind; i++)
340 copy_rvec(fr->v[ind[i]], vout[i]);
346 for (i = 0; i < nind; i++)
348 copy_rvec(fr->f[ind[i]], fout[i]);
357 for (i = 0; i < nind; i++)
359 copy_rvec(fr->x[ind[i]], xout[i]);
370 gmx_write_tng_from_trxframe(status->tng, fr, nind);
373 write_xtc(status->fio, nind, fr->step, fr->time, fr->box, xout, prec);
377 fwrite_trn(status->fio, nframes_read(status),
378 fr->time, fr->step, fr->box, nind, xout, vout, fout);
386 gmx_fatal(FARGS, "Can not write a %s file without atom names",
389 sprintf(title, "frame t= %.3f", fr->time);
392 write_hconf_indexed_p(gmx_fio_getfp(status->fio), title, fr->atoms, nind, ind,
394 fr->x, fr->bV ? fr->v : NULL, fr->box);
398 write_pdbfile_indexed(gmx_fio_getfp(status->fio), title, fr->atoms,
399 fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, TRUE);
403 write_g87(gmx_fio_getfp(status->fio), nind, xout, fr->box);
406 write_g96_conf(gmx_fio_getfp(status->fio), fr, nind, ind);
409 gmx_fatal(FARGS, "Sorry, write_trxframe_indexed can not write %s",
440 void trjtools_gmx_prepare_tng_writing(const char *filename,
446 const gmx_mtop_t *mtop,
447 const atom_id *index,
448 const char *index_group_name)
450 if (filemode != 'w' && filemode != 'a')
452 gmx_incons("Sorry, can only prepare for TNG output.");
463 gmx_prepare_tng_writing(filename,
472 else if (efTNG == fn2ftp(infile))
474 tng_trajectory_t tng_in;
475 gmx_tng_open(infile, 'r', &tng_in);
477 gmx_prepare_tng_writing(filename,
488 void write_tng_frame(t_trxstatus *status,
491 gmx_write_tng_from_trxframe(status->tng, frame, -1);
494 int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
510 gmx_tng_set_compression_precision(status->tng, prec);
511 write_tng_frame(status, fr);
516 switch (gmx_fio_getftp(status->fio))
524 gmx_fatal(FARGS, "Need coordinates to write a %s trajectory",
525 ftp2ext(gmx_fio_getftp(status->fio)));
530 switch (gmx_fio_getftp(status->fio))
533 write_xtc(status->fio, fr->natoms, fr->step, fr->time, fr->box, fr->x, prec);
537 fwrite_trn(status->fio, fr->step, fr->time, fr->lambda, fr->box, fr->natoms,
538 fr->bX ? fr->x : NULL, fr->bV ? fr->v : NULL, fr->bF ? fr->f : NULL);
546 gmx_fatal(FARGS, "Can not write a %s file without atom names",
547 ftp2ext(gmx_fio_getftp(status->fio)));
549 sprintf(title, "frame t= %.3f", fr->time);
550 if (gmx_fio_getftp(status->fio) == efGRO)
552 write_hconf_p(gmx_fio_getfp(status->fio), title, fr->atoms,
553 prec2ndec(prec), fr->x, fr->bV ? fr->v : NULL, fr->box);
557 write_pdbfile(gmx_fio_getfp(status->fio), title,
558 fr->atoms, fr->x, fr->bPBC ? fr->ePBC : -1, fr->box,
559 ' ', fr->step, gc, TRUE);
563 write_g87(gmx_fio_getfp(status->fio), fr->natoms, fr->x, fr->box);
566 write_g96_conf(gmx_fio_getfp(status->fio), fr, -1, NULL);
569 gmx_fatal(FARGS, "Sorry, write_trxframe can not write %s",
570 ftp2ext(gmx_fio_getftp(status->fio)));
577 int write_trx(t_trxstatus *status, int nind, const atom_id *ind, t_atoms *atoms,
578 int step, real time, matrix box, rvec x[], rvec *v,
583 clear_trxframe(&fr, TRUE);
588 fr.bAtoms = atoms != NULL;
595 copy_mat(box, fr.box);
597 return write_trxframe_indexed(status, &fr, nind, ind, gc);
600 void close_trx(t_trxstatus *status)
602 gmx_tng_close(&status->tng);
605 gmx_fio_close(status->fio);
610 t_trxstatus *open_trx(const char *outfile, const char *filemode)
613 if (filemode[0] != 'w' && filemode[0] != 'a' && filemode[1] != '+')
615 gmx_fatal(FARGS, "Sorry, write_trx can only write");
621 stat->fio = gmx_fio_open(outfile, filemode);
625 static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
632 if (fread_trnheader(status->fio, &sh, &bOK))
634 fr->bDouble = sh.bDouble;
635 fr->natoms = sh.natoms;
641 fr->bFepState = TRUE;
642 fr->lambda = sh.lambda;
643 fr->bBox = sh.box_size > 0;
644 if (fr->flags & (TRX_READ_X | TRX_NEED_X))
648 snew(fr->x, sh.natoms);
650 fr->bX = sh.x_size > 0;
652 if (fr->flags & (TRX_READ_V | TRX_NEED_V))
656 snew(fr->v, sh.natoms);
658 fr->bV = sh.v_size > 0;
660 if (fr->flags & (TRX_READ_F | TRX_NEED_F))
664 snew(fr->f, sh.natoms);
666 fr->bF = sh.f_size > 0;
668 if (fread_htrn(status->fio, &sh, fr->box, fr->x, fr->v, fr->f))
674 fr->not_ok = DATA_NOT_OK;
680 fr->not_ok = HEADER_NOT_OK;
686 static void choose_file_format(FILE *fp)
694 printf(" Select File Format\n");
695 printf("---------------------------\n");
696 printf("1. XYZ File\n");
697 printf("2. XYZ File with Box\n");
698 printf("3. Gromos-87 Ascii Trajectory\n");
699 printf("4. Gromos-87 Ascii Trajectory with Box\n");
706 printf("\nChoice: ");
710 rc = scanf("%d", &i);
715 while ((i < 0) || (i >= effNR));
718 stat->eFF = (eFileFormat) i;
720 for (m = 0; (m < DIM); m++)
725 stat->bReadBox = (stat->eFF == effG87Box) || (stat->eFF == effXYZBox);
731 if (5 != fscanf(fp, "%d%lf%lf%lf%lf", &stat->NATOMS, &stat->BOX[XX], &stat->BOX[YY], &stat->BOX[ZZ], &stat->DT))
733 gmx_fatal(FARGS, "Error reading natoms/box in file");
738 printf("GROMOS! OH DEAR...\n\n");
739 printf("Number of atoms ? ");
741 if (1 != scanf("%d", &stat->NATOMS))
743 gmx_fatal(FARGS, "Error reading natoms in file");
746 printf("Time between timeframes ? ");
748 if (1 != scanf("%lf", &stat->DT))
750 gmx_fatal(FARGS, "Error reading dt from file");
753 if (stat->eFF == effG87)
755 printf("Box X Y Z ? ");
757 if (3 != scanf("%lf%lf%lf", &stat->BOX[XX], &stat->BOX[YY], &stat->BOX[ZZ]))
759 gmx_fatal(FARGS, "Error reading box in file");
772 printf("Hellow World\n");
776 static gmx_bool do_read_xyz(t_trxstatus *status, FILE *fp, int natoms,
777 rvec x[], matrix box)
782 for (i = 0; (i < natoms); i++)
784 for (m = 0; (m < DIM); m++)
786 if (fscanf(fp, "%lf", &x0) != 1)
790 fprintf(stderr, "error reading statusfile: x[%d][%d]\n", i, m);
798 if (status->bReadBox)
800 for (m = 0; (m < DIM); m++)
802 if (fscanf(fp, "%lf", &x0) != 1)
812 static gmx_bool xyz_next_x(t_trxstatus *status, FILE *fp, const output_env_t oenv,
813 real *t, int natoms, rvec x[], matrix box)
814 /* Reads until a new x can be found (return TRUE)
815 * or eof (return FALSE)
821 while (!bTimeSet(TBEGIN) || (*t < rTimeValue(TBEGIN)))
823 if (!do_read_xyz(status, fp, natoms, x, box))
827 printcount(status, oenv, *t, FALSE);
831 if (!bTimeSet(TEND) || (*t <= rTimeValue(TEND)))
833 if (!do_read_xyz(status, fp, natoms, x, box))
835 printlast(status, oenv, *t);
838 printcount(status, oenv, *t, FALSE);
843 printlast(status, oenv, pt);
847 static int xyz_first_x(t_trxstatus *status, FILE *fp, const output_env_t oenv,
848 real *t, rvec **x, matrix box)
849 /* Reads fp, mallocs x, and returns x and box
850 * Returns natoms when successful, FALSE otherwise
858 choose_file_format(fp);
860 for (m = 0; (m < DIM); m++)
862 box[m][m] = status->BOX[m];
865 snew(*x, status->NATOMS);
867 if (!xyz_next_x(status, fp, oenv, t, status->NATOMS, *x, box))
873 return status->NATOMS;
876 static gmx_bool pdb_next_x(t_trxstatus *status, FILE *fp, t_trxframe *fr)
880 int ePBC, model_nr, na;
881 char title[STRLEN], *time;
884 atoms.nr = fr->natoms;
886 atoms.pdbinfo = NULL;
887 /* the other pointers in atoms should not be accessed if these are NULL */
889 na = read_pdbfile(fp, title, &model_nr, &atoms, fr->x, &ePBC, boxpdb, TRUE, NULL);
890 set_trxframe_ePBC(fr, ePBC);
891 if (nframes_read(status) == 0)
893 fprintf(stderr, " '%s', %d atoms\n", title, fr->natoms);
898 fr->bBox = (boxpdb[XX][XX] != 0.0);
901 copy_mat(boxpdb, fr->box);
904 if (model_nr != NOTSET)
909 time = strstr(title, " t= ");
913 sscanf(time+4, "%lf", &dbl);
914 fr->time = (real)dbl;
919 /* this is a bit dirty, but it will work: if no time is read from
920 comment line in pdb file, set time to current frame number */
923 fr->time = (real)fr->step;
927 fr->time = (real)nframes_read(status);
936 if (na != fr->natoms)
938 gmx_fatal(FARGS, "Number of atoms in pdb frame %d is %d instead of %d",
939 nframes_read(status), na, fr->natoms);
945 static int pdb_first_x(t_trxstatus *status, FILE *fp, t_trxframe *fr)
949 fprintf(stderr, "Reading frames from pdb file");
951 get_pdb_coordnum(fp, &fr->natoms);
954 gmx_fatal(FARGS, "\nNo coordinates in pdb file\n");
957 snew(fr->x, fr->natoms);
958 pdb_next_x(status, fp, fr);
963 gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, t_trxframe *fr)
967 gmx_bool bOK, bRet, bMissingData = FALSE, bSkip = FALSE;
976 clear_trxframe(fr, FALSE);
982 /* Special treatment for TNG files */
987 ftp = gmx_fio_getftp(status->fio);
993 bRet = gmx_next_frame(status, fr);
996 /* Checkpoint files can not contain mulitple frames */
999 read_g96_conf(gmx_fio_getfp(status->fio), NULL, fr,
1000 status->persistent_line);
1001 bRet = (fr->natoms > 0);
1004 bRet = xyz_next_x(status, gmx_fio_getfp(status->fio), oenv, &fr->time,
1005 fr->natoms, fr->x, fr->box);
1011 /* B. Hess 2005-4-20
1012 * Sometimes is off by one frame
1013 * and sometimes reports frame not present/file not seekable
1015 /* DvdS 2005-05-31: this has been fixed along with the increased
1016 * accuracy of the control over -b and -e options.
1018 if (bTimeSet(TBEGIN) && (fr->time < rTimeValue(TBEGIN)))
1020 if (xtc_seek_time(status->fio, rTimeValue(TBEGIN), fr->natoms, TRUE))
1022 gmx_fatal(FARGS, "Specified frame (time %f) doesn't exist or file corrupt/inconsistent.",
1023 rTimeValue(TBEGIN));
1027 bRet = read_next_xtc(status->fio, fr->natoms, &fr->step, &fr->time, fr->box,
1028 fr->x, &fr->prec, &bOK);
1029 fr->bPrec = (bRet && fr->prec > 0);
1036 /* Actually the header could also be not ok,
1037 but from bOK from read_next_xtc this can't be distinguished */
1038 fr->not_ok = DATA_NOT_OK;
1042 bRet = gmx_read_next_tng_frame(status->tng, fr, NULL, 0);
1045 bRet = pdb_next_x(status, gmx_fio_getfp(status->fio), fr);
1048 bRet = gro_next_x_or_v(gmx_fio_getfp(status->fio), fr);
1051 #ifdef GMX_USE_PLUGINS
1052 bRet = read_next_vmd_frame(fr);
1054 gmx_fatal(FARGS, "DEATH HORROR in read_next_frame ftp=%s,status=%s",
1055 ftp2ext(gmx_fio_getftp(status->fio)),
1056 gmx_fio_getname(status->fio));
1062 bMissingData = (((fr->flags & TRX_NEED_X) && !fr->bX) ||
1063 ((fr->flags & TRX_NEED_V) && !fr->bV) ||
1064 ((fr->flags & TRX_NEED_F) && !fr->bF));
1068 ct = check_times2(fr->time, fr->t0, fr->bDouble);
1069 if (ct == 0 || ((fr->flags & TRX_DONT_SKIP) && ct < 0))
1071 printcount(status, oenv, fr->time, FALSE);
1079 printcount(status, oenv, fr->time, TRUE);
1086 while (bRet && (bMissingData || bSkip));
1090 printlast(status, oenv, pt);
1093 printincomp(status, fr);
1100 int read_first_frame(const output_env_t oenv, t_trxstatus **status,
1101 const char *fn, t_trxframe *fr, int flags)
1104 gmx_bool bFirst, bOK;
1106 int ftp = fn2ftp(fn);
1107 gmx_int64_t *tng_ids;
1109 clear_trxframe(fr, TRUE);
1116 status_init( *status );
1117 (*status)->nxframe = 1;
1122 /* Special treatment for TNG files */
1123 gmx_tng_open(fn, 'r', &(*status)->tng);
1127 fio = (*status)->fio = gmx_fio_open(fn, "r");
1135 read_checkpoint_trxframe(fio, fr);
1139 /* Can not rewind a compressed file, so open it twice */
1140 if (!(*status)->persistent_line)
1142 /* allocate the persistent line */
1143 snew((*status)->persistent_line, STRLEN+1);
1145 read_g96_conf(gmx_fio_getfp(fio), fn, fr, (*status)->persistent_line);
1147 clear_trxframe(fr, FALSE);
1148 if (flags & (TRX_READ_X | TRX_NEED_X))
1150 snew(fr->x, fr->natoms);
1152 if (flags & (TRX_READ_V | TRX_NEED_V))
1154 snew(fr->v, fr->natoms);
1156 fio = (*status)->fio = gmx_fio_open(fn, "r");
1159 fr->natoms = xyz_first_x(*status, gmx_fio_getfp(fio), oenv, &fr->time,
1166 printcount(*status, oenv, fr->time, FALSE);
1171 if (read_first_xtc(fio, &fr->natoms, &fr->step, &fr->time, fr->box, &fr->x,
1172 &fr->prec, &bOK) == 0)
1175 fr->not_ok = DATA_NOT_OK;
1180 printincomp(*status, fr);
1184 fr->bPrec = (fr->prec > 0);
1189 printcount(*status, oenv, fr->time, FALSE);
1195 if (!gmx_read_next_tng_frame((*status)->tng, fr, NULL, 0))
1197 fr->not_ok = DATA_NOT_OK;
1199 printincomp(*status, fr);
1203 printcount(*status, oenv, fr->time, FALSE);
1208 pdb_first_x(*status, gmx_fio_getfp(fio), fr);
1211 printcount(*status, oenv, fr->time, FALSE);
1216 if (gro_first_x_or_v(gmx_fio_getfp(fio), fr))
1218 printcount(*status, oenv, fr->time, FALSE);
1223 #ifdef GMX_USE_PLUGINS
1224 fprintf(stderr, "The file format of %s is not a known trajectory format to GROMACS.\n"
1225 "Please make sure that the file is a trajectory!\n"
1226 "GROMACS will now assume it to be a trajectory and will try to open it using the VMD plug-ins.\n"
1227 "This will only work in case the VMD plugins are found and it is a trajectory format supported by VMD.\n", fn);
1228 gmx_fio_fp_close(fio); /*only close the file without removing FIO entry*/
1229 if (!read_first_vmd_frame(fn, fr))
1231 gmx_fatal(FARGS, "Not supported in read_first_frame: %s", fn);
1234 gmx_fatal(FARGS, "Not supported in read_first_frame: %s. Please make sure that the file is a trajectory.\n"
1235 "GROMACS is not compiled with plug-in support. Thus it cannot read non-GROMACS trajectory formats using the VMD plug-ins.\n"
1236 "Please compile with plug-in support if you want to read non-GROMACS trajectory formats.\n", fn);
1241 /* Return FALSE if we read a frame that's past the set ending time. */
1242 if (!bFirst && (!(fr->flags & TRX_DONT_SKIP) && check_times(fr->time) > 0))
1249 (!(fr->flags & TRX_DONT_SKIP) && check_times(fr->time) < 0))
1251 /* Read a frame when no frame was read or the first was skipped */
1252 if (!read_next_frame(oenv, *status, fr))
1259 return (fr->natoms > 0);
1262 /***** C O O R D I N A T E S T U F F *****/
1264 int read_first_x(const output_env_t oenv, t_trxstatus **status, const char *fn,
1265 real *t, rvec **x, matrix box)
1269 read_first_frame(oenv, status, fn, &fr, TRX_NEED_X);
1271 snew((*status)->xframe, 1);
1272 (*status)->nxframe = 1;
1273 (*(*status)->xframe) = fr;
1274 *t = (*status)->xframe->time;
1275 *x = (*status)->xframe->x;
1276 copy_mat((*status)->xframe->box, box);
1278 return (*status)->xframe->natoms;
1281 gmx_bool read_next_x(const output_env_t oenv, t_trxstatus *status, real *t,
1282 rvec x[], matrix box)
1286 status->xframe->x = x;
1287 /*xframe[status].x = x;*/
1288 bRet = read_next_frame(oenv, status, status->xframe);
1289 *t = status->xframe->time;
1290 copy_mat(status->xframe->box, box);
1295 void close_trj(t_trxstatus *status)
1297 gmx_tng_close(&status->tng);
1300 gmx_fio_close(status->fio);
1303 /* The memory in status->xframe is lost here,
1304 * but the read_first_x/read_next_x functions are deprecated anyhow.
1305 * read_first_frame/read_next_frame and close_trx should be used.
1310 void rewind_trj(t_trxstatus *status)
1314 gmx_fio_rewind(status->fio);
1317 /***** T O P O L O G Y S T U F F ******/
1319 t_topology *read_top(const char *fn, int *ePBC)
1325 epbc = read_tpx_top(fn, NULL, NULL, &natoms, NULL, NULL, NULL, top);