From: David van der Spoel Date: Tue, 9 Sep 2014 05:55:17 +0000 (+0200) Subject: Remove .tpa, .tpb, .tpx, .trj files. Part of #1500. X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=b2b75d45c43c98cf1362e0125381bfc6f0a85782 Remove .tpa, .tpb, .tpx, .trj files. Part of #1500. Change-Id: Ia055cbf5311bf8780ca826c767207e5172d1b7e2 --- diff --git a/docs/manual/files.tex b/docs/manual/files.tex index 1fae94e989..af67d4a6ec 100644 --- a/docs/manual/files.tex +++ b/docs/manual/files.tex @@ -54,7 +54,7 @@ \tt conf & \tt esp & Asc & \tt -c & Coordinate file in ESPResSo format \\[-0.1ex] \tt conf & \tt g96 & Asc & \tt -c & Coordinate file in Gromos-96 format \\[-0.1ex] \tt conf & \tt gro & Asc & \tt -c & Coordinate file in Gromos-87 format \\[-0.1ex] -\tt conf & \tt gro & & \tt -c & Structure: \tt gro g96 pdb esp tpr tpb tpa \\[-0.1ex] +\tt conf & \tt gro & & \tt -c & Structure: \tt gro g96 pdb esp tpr \\[-0.1ex] \tt out & \tt gro & & \tt -o & Structure: \tt gro g96 pdb esp \\[-0.1ex] \tt polar & \tt hdb & Asc & \tt & Hydrogen data base \\[-0.1ex] \tt topinc & \tt itp & Asc & \tt & Include file for topology \\[-0.1ex] @@ -70,16 +70,14 @@ \tt residue & \tt rtp & Asc & \tt & Residue Type file used by {\tt pdb2gmx} \\[-0.1ex] \tt doc & \tt tex & Asc & \tt -o & LaTeX file \\[-0.1ex] \tt topol & \tt top & Asc & \tt -p & Topology file \\[-0.1ex] -\tt topol & \tt tpb & Bin & \tt -s & Binary run input file \\[-0.1ex] -\tt topol & \tt tpr & & \tt -s & Generic run input: \tt tpr tpb tpa \\[-0.1ex] -\tt topol & \tt tpr & & \tt -s & Structure+mass(db): \tt tpr tpb tpa gro g96 pdb \\[-0.1ex] +\tt topol & \tt tpr & & \tt -s & Generic run input: \tt tpr \\[-0.1ex] +\tt topol & \tt tpr & & \tt -s & Structure+mass(db): \tt tpr gro g96 pdb \\[-0.1ex] \tt topol & \tt tpr & xdr & \tt -s & Portable xdr run input file \\[-0.1ex] -\tt traj & \tt trj & Bin & \tt & Trajectory file (architecture specific) \\[-0.1ex] -\tt traj & \tt trr & & \tt & Full precision trajectory: \tt trr trj cpt \\[-0.1ex] +\tt traj & \tt trr & & \tt & Full precision trajectory: \tt trr cpt \\[-0.1ex] \tt traj & \tt trr & xdr & \tt & Trajectory in portable xdr format \\[-0.1ex] \tt root & \tt xpm & Asc & \tt & X PixMap compatible matrix file \\[-0.1ex] -\tt traj & \tt xtc & & \tt -f & Trajec., input: \tt xtc trr trj cpt gro g96 pdb \\[-0.1ex] -\tt traj & \tt xtc & & \tt -f & Trajectory, output: \tt xtc trr trj gro g96 pdb \\[-0.1ex] +\tt traj & \tt xtc & & \tt -f & Trajec., input: \tt xtc trr cpt gro g96 pdb \\[-0.1ex] +\tt traj & \tt xtc & & \tt -f & Trajectory, output: \tt xtc trr gro g96 pdb \\[-0.1ex] \tt traj & \tt xtc & xdr & \tt & Compressed trajectory (portable xdr format) \\[-0.1ex] \tt graph & \tt xvg & Asc & \tt -o & xvgr/xmgr file \\[-0.1ex] \dline @@ -90,6 +88,6 @@ % LocalWords: lccX atomtp atp Asc Atomtype pdb gmx eiwit brk Brookhaven cpt tm % LocalWords: xdr nnnice dat dlg ngmx sam edi edo ener edr ene ent eps conf ss -% LocalWords: PostScript ESPResSo gtraj Gromos gro tpr tpb tpa hdb topinc itp -% LocalWords: grompp mdp mtx ndx rtp tex LaTeX topol traj trj trr xpm PixMap +% LocalWords: PostScript ESPResSo gtraj Gromos gro tpr hdb topinc itp +% LocalWords: grompp mdp mtx ndx rtp tex LaTeX topol traj trr xpm PixMap % LocalWords: xtc Trajec xvg xvgr xmgr ps diff --git a/docs/old-html/links.dat b/docs/old-html/links.dat index 8ee9ba7b0c..01ee831ccc 100644 --- a/docs/old-html/links.dat +++ b/docs/old-html/links.dat @@ -19,10 +19,7 @@ rtp tex top tng -tpa -tpb tpr -trj trr xpm xtc diff --git a/docs/old-html/online/files.html b/docs/old-html/online/files.html index ee57c53221..e458217867 100644 --- a/docs/old-html/online/files.html +++ b/docs/old-html/online/files.html @@ -18,14 +18,10 @@
Generic structure formats: gro, g96, -pdb, -tpr, -tpb or -tpa +pdb, or +tpr
Structure+mass(db): tpr, -tpb, -tpa, gro, g96 or pdb. @@ -45,35 +41,26 @@ When gro or pdb is used approximate masses will be read from the mass database.
tpr
system topology, parameters, coordinates and velocities (binary, portable) -
tpa
system topology, parameters, coordinates -and velocities (ascii) -
tpb
system topology, parameters, coordinates -and velocities (binary)
Generic run input file formats: -tpr, -tpb or -tpa +tpr

Trajectory files

tng
Any kind of data (compressed, portable, any precision) -
trj
x, v and f (binary, full precision)
trr
x, v and f (binary, full precision, portable)
xtc
x only (compressed, portable, any precision)
gro
x and v (ascii, any precision)
g96
x only (ascii, fixed high precision)
pdb
x only (ascii, reduced precision)
Formats for full-precision data: -tng, -trr or -trj +tng or +trr
Generic trajectory formats: tng, xtc, trr, -trj, gro, g96, pdb or diff --git a/docs/old-html/online/getting_started.html b/docs/old-html/online/getting_started.html index d9de09fad5..fcaf75c72d 100644 --- a/docs/old-html/online/getting_started.html +++ b/docs/old-html/online/getting_started.html @@ -183,8 +183,7 @@ not consider the use of index files. The next step is to combine the molecular structure (.gro file), topology (.top file) MD-parameters (.mdp file) and (optionally) the -index file (ndx) to generate a run input file (.tpr extension or -.tpb if you don't have XDR). +index file (ndx) to generate a run input file (.tpr extension. This file contains all information needed to start a simulation with GROMACS. The gmx grompp program processes all @@ -203,8 +202,7 @@ to start a run is the run input file (.tpr file). The output files of gmx mdrun are the -trajectory file (.trr file -or .trj if you don't have XDR) and a logfile ( +trajectory file (.trr file) and a logfile ( .log file).

diff --git a/docs/old-html/online/mtx.html b/docs/old-html/online/mtx.html index c023102238..6492e5db38 100644 --- a/docs/old-html/online/mtx.html +++ b/docs/old-html/online/mtx.html @@ -1,7 +1,7 @@ mtx file format

Description

Files with the mtx file extension contain a matrix. -The file format is identical to the trj format. +The file format is identical to the trr format. Currently this file format is only used for hessian matrices, which are produced with gmx mdrun and read by gmx nmeig. diff --git a/docs/old-html/online/options.html b/docs/old-html/online/options.html index af9fc65727..a2e0cfa3cb 100644 --- a/docs/old-html/online/options.html +++ b/docs/old-html/online/options.html @@ -38,7 +38,7 @@ parameter is supplied the two others are also set to this value.
  • All GROMACS programs can read compressed or g-zipped files. There might be a problem with reading compressed .xtc, -.trr and .trj files, but these will not compress +.trr files, but these will not compress very well anyway.

  • diff --git a/docs/old-html/online/top.html b/docs/old-html/online/top.html index 8bba16691f..67f6c174ff 100644 --- a/docs/old-html/online/top.html +++ b/docs/old-html/online/top.html @@ -2,7 +2,7 @@

    Description

    The top file extension stands for topology. It is an ascii file which is read by gmx grompp which processes it -and creates a binary topology (.tpb file).
    +and creates a binary topology (.tpr file).
    A sample file is included below:
     ;
    diff --git a/docs/old-html/online/tpa.html b/docs/old-html/online/tpa.html
    deleted file mode 100644
    index 9002525fea..0000000000
    --- a/docs/old-html/online/tpa.html
    +++ /dev/null
    @@ -1,19 +0,0 @@
    -tpa file format
    -

    Description

    -The tpa file extension stands for binary run input file. This file contains -the starting structure of your simulation, The molecular topology and -all the simulation data. Because this file is in binary format it -cannot be read with a normal editor. To read a binary run input file type: -
    -% gmx dump -s topol.tpa
    -
    -or if you're not such a fast reader: -
    -% gmxdump -s topol.tpa | more
    -
    - -

    -You can also compare two tpa files using: -

    -% gmx check -s1 top1 -s2 top2 | more
    -
    diff --git a/docs/old-html/online/tpb.html b/docs/old-html/online/tpb.html deleted file mode 100644 index 4206296a66..0000000000 --- a/docs/old-html/online/tpb.html +++ /dev/null @@ -1,19 +0,0 @@ -tpb file format -

    Description

    -The tpb file extension stands for binary run input file. This file contains -the starting structure of your simulation, The molecular topology and -all the simulation data. Because this file is in binary format it -cannot be read with a normal editor. To read a binary run input file type: -
    -% gmx dump -s topol.tpb
    -
    -or if you're not such a fast reader: -
    -% gmxdump -s topol.tpb | more
    -
    - -

    -You can also compare two tpb files using: -

    -% gmx check -s1 top1 -s2 top2 | more
    -
    diff --git a/docs/old-html/online/trj.html b/docs/old-html/online/trj.html deleted file mode 100644 index 0077a8ed01..0000000000 --- a/docs/old-html/online/trj.html +++ /dev/null @@ -1,20 +0,0 @@ -trj file format -

    Description

    -Files with the trj file extension contain the trajectory of a simulation. -In this file all the coordinates, velocities, forces and energies are -printed as you told GROMACS in your mdp file. This file is in binary -format an can be read with gmx dump. -
    -% gmx dump -f traj.trj
    -
    -or if you're not such a fast reader: -
    -% gmxdump -f traj.trj | more
    -
    - -

    -You can also get a quick look in the contents of the file (number of -frames etc.) using: -

    -% gmx check -f traj.trj
    -
    diff --git a/src/contrib/anaf.c b/src/contrib/anaf.c index 0f5ab1a407..8267fea6b0 100644 --- a/src/contrib/anaf.c +++ b/src/contrib/anaf.c @@ -137,9 +137,9 @@ static void list_trn(char *fn) int main(int argc,char *argv[]) { static char *desc[] = { - "[TT]gmxdump[tt] reads a run input file ([TT].tpa[tt]/[TT].tpr[tt]/[TT].tpb[tt]),", - "a trajectory ([TT].trj[tt]/[TT].trr[tt]/[TT].xtc[tt]) or an energy", - "file ([TT].ene[tt]/[TT].edr[tt]) and prints that to standard", + "[TT]gmxdump[tt] reads a run input file ([TT].tpr[tt]),", + "a trajectory ([TT].trr[tt]/[TT].xtc[tt]) or an energy", + "file ([TT].edr[tt]) and prints that to standard", "output in a readable format. This program is essential for", "checking your run input file in case of problems.[PAR]" }; diff --git a/src/gromacs/commandline/tests/pargs.cpp b/src/gromacs/commandline/tests/pargs.cpp index a7f4362732..55dc8b0c36 100644 --- a/src/gromacs/commandline/tests/pargs.cpp +++ b/src/gromacs/commandline/tests/pargs.cpp @@ -495,13 +495,13 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileNam { t_filenm fnm[] = { { efTRX, "-f1", NULL, ffREAD }, - { efTPX, "-f2", "foo", ffREAD }, + { efSTO, "-f2", "foo", ffREAD }, { efTRX, "-f3", NULL, ffREAD }, { efSTX, "-f4", NULL, ffREAD } }; args_.append("test"); std::string expected1 = addFileArg("-f1", "1.trr", efNoExtension); - std::string expected2 = addFileArg("-f2", ".tpa", efEmptyValue); + std::string expected2 = addFileArg("-f2", ".pdb", efEmptyValue); std::string expected3 = addFileArg("-f3", ".trr", efEmptyValue); std::string expected4 = addFileArg(NULL, ".pdb", efEmptyValue); std::string deffnm = gmx::Path::stripExtension(expected3); diff --git a/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml b/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml index 64dcfe4606..8ac10f83fe 100644 --- a/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml +++ b/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml @@ -12,12 +12,11 @@ OPTIONS Options to specify input and output files: -f [<.xtc/.trr/...>] (path/to/long/trajectory/name.xtc) (Input) - File name option with a long value: xtc trr cpt trj gro g96 pdb tng + File name option with a long value: xtc trr cpt gro g96 pdb tng -f2 [<.xtc/.trr/...>] (path/to/long/trajectory.xtc) (Input) - File name option with a long value: xtc trr cpt trj gro g96 pdb tng + File name option with a long value: xtc trr cpt gro g96 pdb tng -lib [<.xtc/.trr/...>] (path/to/long/trajectory/name.xtc) (Input, Opt., Lib.) - File name option with a long value and type: xtc trr cpt trj gro g96 pdb - tng + File name option with a long value and type: xtc trr cpt gro g96 pdb tng -longfileopt [<.dat>] (deffile.dat) (Input, Opt.) File name option with a long name -longfileopt2 [<.dat>] (path/to/long/file/name.dat) (Input, Opt., Lib.) diff --git a/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml b/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml index c4abb113cf..d60500d2bf 100644 --- a/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml +++ b/src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml @@ -14,9 +14,9 @@ OPTIONS Options to specify input and output files: -f [<.xtc/.trr/...>] (traj.xtc) (Input) - Input file description: xtc trr cpt trj gro g96 pdb tng + Input file description: xtc trr cpt gro g96 pdb tng -mult [<.xtc/.trr/...> [...]] (traj.xtc) (Input, Opt.) - Multiple file description: xtc trr cpt trj gro g96 pdb tng + Multiple file description: xtc trr cpt gro g96 pdb tng -lib [<.dat>] (libdata.dat) (Input, Opt., Lib.) Library file description -io [<.dat>] (inout.dat) (In/Out, Opt.) Input/Output file description -o <.xvg> (Output, Opt.) Output file description diff --git a/src/gromacs/fileio/confio.c b/src/gromacs/fileio/confio.c index 36dbc53312..57aff53965 100644 --- a/src/gromacs/fileio/confio.c +++ b/src/gromacs/fileio/confio.c @@ -1484,8 +1484,6 @@ void write_sto_conf_indexed(const char *outfile, const char *title, gmx_fio_fclose(out); break; case efTPR: - case efTPB: - case efTPA: gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile); break; default: @@ -1539,8 +1537,6 @@ void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms, gmx_fio_fclose(out); break; case efTPR: - case efTPB: - case efTPA: gmx_fatal(FARGS, "Sorry, can not write a topology to %s", outfile); break; default: @@ -1612,8 +1608,6 @@ void get_stx_coordnum(const char *infile, int *natoms) case efESP: *natoms = get_espresso_coordnum(infile); break; - case efTPA: - case efTPB: case efTPR: { t_tpxheader tpx; @@ -1682,8 +1676,6 @@ void read_stx_conf(const char *infile, char *title, t_atoms *atoms, read_espresso_conf(infile, atoms, x, v, box); break; case efTPR: - case efTPB: - case efTPA: snew(mtop, 1); i = read_tpx(infile, NULL, box, &natoms, x, v, NULL, mtop); if (ePBC) diff --git a/src/gromacs/fileio/filenm.c b/src/gromacs/fileio/filenm.c index d8b50e526f..bf8212d2c8 100644 --- a/src/gromacs/fileio/filenm.c +++ b/src/gromacs/fileio/filenm.c @@ -71,7 +71,7 @@ static const int trxs[] = #ifdef USE_XDR efXTC, efTRR, efCPT, #endif - efTRJ, efGRO, efG96, efPDB, efTNG + efGRO, efG96, efPDB, efTNG }; #define NTRXS asize(trxs) @@ -89,7 +89,7 @@ static const int tros[] = #ifdef USE_XDR efXTC, efTRR, #endif - efTRJ, efGRO, efG96, efPDB, efTNG + efGRO, efG96, efPDB, efTNG }; #define NTROS asize(tros) @@ -98,7 +98,7 @@ static const int trns[] = #ifdef USE_XDR efTRR, efCPT, #endif - efTRJ, efTNG + efTNG }; #define NTRNS asize(trns) @@ -108,29 +108,19 @@ static const int stos[] = static const int stxs[] = { - efGRO, efG96, efPDB, efBRK, efENT, efESP, + efGRO, efG96, efPDB, efBRK, efENT, efESP #ifdef USE_XDR - efTPR, + , efTPR #endif - efTPB, efTPA }; #define NSTXS asize(stxs) -static const int tpxs[] = -{ -#ifdef USE_XDR - efTPR, -#endif - efTPB, efTPA -}; -#define NTPXS asize(tpxs) - static const int tpss[] = { #ifdef USE_XDR efTPR, #endif - efTPB, efTPA, efGRO, efG96, efPDB, efBRK, efENT + efGRO, efG96, efPDB, efBRK, efENT }; #define NTPSS asize(tpss) @@ -155,7 +145,6 @@ static const t_deffile { eftGEN, ".???", "traj", NULL, "Full precision trajectory", NTRNS, trns }, { eftXDR, ".trr", "traj", NULL, "Trajectory in portable xdr format" }, - { eftBIN, ".trj", "traj", NULL, "Trajectory file (architecture specific)" }, { eftGEN, ".???", "traj_comp", NULL, "Compressed trajectory (tng format or portable xdr format)", NTRCOMPRESSED, trcompressed}, { eftXDR, ".xtc", "traj", NULL, @@ -179,11 +168,8 @@ static const t_deffile { eftASC, ".ndx", "index", "-n", "Index file", }, { eftASC, ".top", "topol", "-p", "Topology file"}, { eftASC, ".itp", "topinc", NULL, "Include file for topology"}, - { eftGEN, ".???", "topol", "-s", "Run input file", NTPXS, tpxs }, { eftGEN, ".???", "topol", "-s", "Structure+mass(db)", NTPSS, tpss }, { eftXDR, ".tpr", "topol", "-s", "Portable xdr run input file"}, - { eftASC, ".tpa", "topol", "-s", "Ascii run input file"}, - { eftBIN, ".tpb", "topol", "-s", "Binary run input file"}, { eftASC, ".tex", "doc", "-o", "LaTeX file"}, { eftASC, ".rtp", "residue", NULL, "Residue Type file used by pdb2gmx" }, { eftASC, ".atp", "atomtp", NULL, "Atomtype file used by pdb2gmx" }, @@ -231,8 +217,6 @@ const char *ftp2ext_generic(int ftp) return "sto"; case efSTX: return "stx"; - case efTPX: - return "tpx"; case efTPS: return "tps"; default: diff --git a/src/gromacs/fileio/filenm.h b/src/gromacs/fileio/filenm.h index d5c1bd6816..e4dfab80ae 100644 --- a/src/gromacs/fileio/filenm.h +++ b/src/gromacs/fileio/filenm.h @@ -48,14 +48,14 @@ extern "C" { /* this enum should correspond to the array deffile in gmxlib/filenm.c */ enum { efMDP, - efTRX, efTRO, efTRN, efTRR, efTRJ, efCOMPRESSED, efXTC, efTNG, + efTRX, efTRO, efTRN, efTRR, efCOMPRESSED, efXTC, efTNG, efEDR, efSTX, efSTO, efGRO, efG96, efPDB, efBRK, efENT, efESP, efPQR, efCPT, efLOG, efXVG, efOUT, efNDX, efTOP, efITP, - efTPX, efTPS, efTPR, efTPA, efTPB, + efTPS, efTPR, efTEX, efRTP, efATP, efHDB, efDAT, efDLG, efMAP, efEPS, efMAT, efM2P, diff --git a/src/gromacs/fileio/gmxfio.c b/src/gromacs/fileio/gmxfio.c index 3a38bf87f3..24dbc9f54a 100644 --- a/src/gromacs/fileio/gmxfio.c +++ b/src/gromacs/fileio/gmxfio.c @@ -86,51 +86,20 @@ static tMPI_Thread_mutex_t open_file_mutex = TMPI_THREAD_MUTEX_INITIALIZER; static const int ftpXDR[] = { efTPR, efTRR, efEDR, efXTC, efTNG, efMTX, efCPT }; static const int ftpASC[] = -{ efTPA, efGRO, efPDB }; +{ efGRO, efPDB, efG96 }; static const int ftpBIN[] = -{ efTPB, efTRJ, efTNG }; +{ efTNG }; #ifdef HAVE_XML static const int ftpXML[] = { efXML}; #endif -const char *itemstr[eitemNR] = -{ - "[header]", "[inputrec]", "[box]", "[topology]", "[coordinates]", - "[velocities]", "[forces]" -}; - const char *eioNames[eioNR] = { "REAL", "INT", "GMX_STE_T", "UCHAR", "NUCHAR", "USHORT", "RVEC", "NRVEC", "IVEC", "STRING" }; - - -/* Comment strings for TPA only */ -const char *comment_str[eitemNR] = { - "; The header holds information on the number of atoms etc. and on whether\n" - "; certain items are present in the file or not.\n" - "; \n" - "; WARNING\n" - "; DO NOT EDIT THIS FILE BY HAND\n" - "; The GROMACS preprocessor performs a lot of checks on your input that\n" - "; you ignore when editing this. Your simulation may crash because of this\n", - "; The inputrec holds the parameters for MD such as the number of steps,\n" - "; the timestep and the cut-offs.\n", - "; The simulation box in nm.\n", - "; The topology section describes the topology of the molecules\n" - "; i.e. bonds, angles and dihedrals etc. and also holds the force field\n" - "; parameters.\n", - "; The atomic coordinates in nm\n", - "; The atomic velocities in nm/ps\n", - "; The forces on the atoms in nm/ps^2\n" -}; - - - - /****************************************************************** * * Internal functions: @@ -433,41 +402,34 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode) gmx_bool bRead, bReadWrite; int xdrid; - if (fn2ftp(fn) == efTPA) + /* sanitize the mode string */ + if (strncmp(mode, "r+", 2) == 0) + { + strcpy(newmode, "r+"); + } + else if (mode[0] == 'r') + { + strcpy(newmode, "r"); + } + else if (strncmp(mode, "w+", 2) == 0) + { + strcpy(newmode, "w+"); + } + else if (mode[0] == 'w') + { + strcpy(newmode, "w"); + } + else if (strncmp(mode, "a+", 2) == 0) + { + strcpy(newmode, "a+"); + } + else if (mode[0] == 'a') { - strcpy(newmode, mode); + strcpy(newmode, "a"); } else { - /* sanitize the mode string */ - if (strncmp(mode, "r+", 2) == 0) - { - strcpy(newmode, "r+"); - } - else if (mode[0] == 'r') - { - strcpy(newmode, "r"); - } - else if (strncmp(mode, "w+", 2) == 0) - { - strcpy(newmode, "w+"); - } - else if (mode[0] == 'w') - { - strcpy(newmode, "w"); - } - else if (strncmp(mode, "a+", 2) == 0) - { - strcpy(newmode, "a+"); - } - else if (mode[0] == 'a') - { - strcpy(newmode, "a"); - } - else - { - gmx_fatal(FARGS, "DEATH HORROR in gmx_fio_open, mode is '%s'", mode); - } + gmx_fatal(FARGS, "DEATH HORROR in gmx_fio_open, mode is '%s'", mode); } /* Check if it should be opened as a binary file */ @@ -546,14 +508,6 @@ t_fileio *gmx_fio_open(const char *fn, const char *mode) gmx_fseek(fio->fp, 0, SEEK_END); } } - else - { - /* Use stdin/stdout for I/O */ - fio->iFTP = efTPA; - fio->fp = bRead ? stdin : stdout; - fio->fn = gmx_strdup("STDIO"); - fio->bStdio = TRUE; - } fio->bRead = bRead; fio->bReadWrite = bReadWrite; fio->bDouble = (sizeof(real) == sizeof(double)); diff --git a/src/gromacs/fileio/gmxfio.h b/src/gromacs/fileio/gmxfio.h index 076d0c3341..8f6401da23 100644 --- a/src/gromacs/fileio/gmxfio.h +++ b/src/gromacs/fileio/gmxfio.h @@ -66,9 +66,6 @@ enum { typedef struct t_fileio t_fileio; -extern const char *itemstr[eitemNR]; -extern const char *comment_str[eitemNR]; - /* NOTE ABOUT THREAD SAFETY: The functions are all thread-safe, provided that two threads don't @@ -83,11 +80,6 @@ extern const char *comment_str[eitemNR]; t_fileio *gmx_fio_open(const char *fn, const char *mode); /* Open a new file for reading or writing. * The file type will be deduced from the file name. - * If fn is NULL, stdin / stdout will be used for Ascii I/O (TPA type) - * mode may be "r", "w", or "a". You should append a "b" to the mode - * if you are writing a binary file, but the routine will also - * doublecheck it and try to do it if you forgot. This has no effect on - * unix, but is important on windows. */ int gmx_fio_close(t_fileio *fp); @@ -150,7 +142,7 @@ void gmx_fio_checktype(t_fileio *fio); ***************************************************/ void gmx_fio_rewind(t_fileio *fio); -/* Rewind the tpa file in fio */ +/* Rewind the file in fio */ int gmx_fio_flush(t_fileio *fio); /* Flush the fio, returns 0 on success */ diff --git a/src/gromacs/fileio/tpxio.c b/src/gromacs/fileio/tpxio.c index 5d0c85380a..db684d3699 100644 --- a/src/gromacs/fileio/tpxio.c +++ b/src/gromacs/fileio/tpxio.c @@ -225,50 +225,6 @@ static const t_ftupd ftupd[] = { /* Needed for backward compatibility */ #define MAXNODES 256 -static void _do_section(t_fileio *fio, int key, gmx_bool bRead, const char *src, - int line) -{ - char buf[STRLEN]; - gmx_bool bDbg; - - if (gmx_fio_getftp(fio) == efTPA) - { - if (!bRead) - { - gmx_fio_write_string(fio, itemstr[key]); - bDbg = gmx_fio_getdebug(fio); - gmx_fio_setdebug(fio, FALSE); - gmx_fio_write_string(fio, comment_str[key]); - gmx_fio_setdebug(fio, bDbg); - } - else - { - if (gmx_fio_getdebug(fio)) - { - fprintf(stderr, "Looking for section %s (%s, %d)", - itemstr[key], src, line); - } - - do - { - gmx_fio_do_string(fio, buf); - } - while ((gmx_strcasecmp(buf, itemstr[key]) != 0)); - - if (gmx_strcasecmp(buf, itemstr[key]) != 0) - { - gmx_fatal(FARGS, "\nCould not find section heading %s", itemstr[key]); - } - else if (gmx_fio_getdebug(fio)) - { - fprintf(stderr, " and found it\n"); - } - } - } -} - -#define do_section(fio, key, bRead) _do_section(fio, key, bRead, __FILE__, __LINE__) - /************************************************************** * * Now the higer level routines that do io of the structures and arrays @@ -3200,7 +3156,7 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx, gmx_fio_checktype(fio); gmx_fio_setdebug(fio, bDebugMode()); - /* NEW! XDR tpb file */ + /* XDR binary topology file */ precision = sizeof(real); if (bRead) { @@ -3305,7 +3261,6 @@ static void do_tpxheader(t_fileio *fio, gmx_bool bRead, t_tpxheader *tpx, gmx_fio_getname(fio), fver, tpx_version); } - do_section(fio, eitemHEADER, bRead); gmx_fio_do_int(fio, tpx->natoms); if (fver >= 28) { @@ -3400,7 +3355,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, #define do_test(fio, b, p) if (bRead && (p != NULL) && !b) gmx_fatal(FARGS, "No %s in %s",#p, gmx_fio_getname(fio)) do_test(fio, tpx.bBox, state->box); - do_section(fio, eitemBOX, bRead); if (tpx.bBox) { gmx_fio_ndo_rvec(fio, state->box, DIM); @@ -3447,7 +3401,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, if (file_version < 26) { do_test(fio, tpx.bIr, ir); - do_section(fio, eitemIR, bRead); if (tpx.bIr) { if (ir) @@ -3474,7 +3427,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, } do_test(fio, tpx.bTop, mtop); - do_section(fio, eitemTOP, bRead); if (tpx.bTop) { if (mtop) @@ -3488,7 +3440,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, } } do_test(fio, tpx.bX, state->x); - do_section(fio, eitemX, bRead); if (tpx.bX) { if (bRead) @@ -3499,7 +3450,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, } do_test(fio, tpx.bV, state->v); - do_section(fio, eitemV, bRead); if (tpx.bV) { if (bRead) @@ -3510,7 +3460,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, } do_test(fio, tpx.bF, f); - do_section(fio, eitemF, bRead); if (tpx.bF) { gmx_fio_ndo_rvec(fio, f, state->natoms); @@ -3528,7 +3477,6 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead, if (file_version >= 26) { do_test(fio, tpx.bIr, ir); - do_section(fio, eitemIR, bRead); if (tpx.bIr) { if (file_version >= 53) @@ -3712,15 +3660,7 @@ int read_tpx_top(const char *fn, gmx_bool fn2bTPX(const char *file) { - switch (fn2ftp(file)) - { - case efTPR: - case efTPB: - case efTPA: - return TRUE; - default: - return FALSE; - } + return (efTPR == fn2ftp(file)); } static void done_gmx_groups_t(gmx_groups_t *g) diff --git a/src/gromacs/fileio/tpxio.h b/src/gromacs/fileio/tpxio.h index 3611be60d2..433742fdcd 100644 --- a/src/gromacs/fileio/tpxio.h +++ b/src/gromacs/fileio/tpxio.h @@ -85,10 +85,7 @@ typedef struct * These routines handle reading and writing of preprocessed * topology files in any of the following formats: * TPR : topology in XDR format, portable accross platforms - * TPB : binary topology, not portable accross platforms - * TPA : ascii topology (possibbly huge) * TRR : trajectory in XDR format (non compressed) - * TRJ : trajectory in binary format * * Files are written in the precision with which the source are compiled, * but double and single precision can be read by either. @@ -115,8 +112,6 @@ void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK, void write_tpx_state(const char *fn, t_inputrec *ir, t_state *state, struct gmx_mtop_t *mtop); /* Write a file, and close it again. - * If fn == NULL, an efTPA file will be written to stdout (which - * will not be closed afterwards) */ void read_tpx_state(const char *fn, @@ -126,8 +121,6 @@ int read_tpx(const char *fn, t_inputrec *ir, matrix box, int *natoms, rvec *x, rvec *v, rvec *f, struct gmx_mtop_t *mtop); /* Read a file, and close it again. - * If fn == NULL, an efTPA file will be read from stdin (which - * will not be closed afterwards) * When step, t or lambda are NULL they will not be stored. * Returns ir->ePBC, if it could be read from the file. */ diff --git a/src/gromacs/fileio/trnio.h b/src/gromacs/fileio/trnio.h index 8fd25d14d0..59bf1d4122 100644 --- a/src/gromacs/fileio/trnio.h +++ b/src/gromacs/fileio/trnio.h @@ -40,8 +40,8 @@ /************************************************************** * - * These routines handle trj (trajectory) I/O, they read and - * write trj/trr files. The routines should be able to read single + * These routines handle trr (trajectory) I/O, they read and + * write trr files. The routines should be able to read single * and double precision files without the user noting it. * The files are backward compatible, therefore the header holds * some unused variables. @@ -83,7 +83,7 @@ typedef struct /* This struct describes the order and the */ } t_trnheader; t_fileio *open_trn(const char *fn, const char *mode); -/* Open a trj / trr file */ +/* Open a trr / trr file */ void close_trn(t_fileio *fio); /* Close it */ diff --git a/src/gromacs/fileio/trxio.c b/src/gromacs/fileio/trxio.c index b515578ef3..0f39b6c46b 100644 --- a/src/gromacs/fileio/trxio.c +++ b/src/gromacs/fileio/trxio.c @@ -338,7 +338,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind, switch (ftp) { - case efTRJ: case efTRR: case efTNG: break; @@ -353,7 +352,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind, switch (ftp) { - case efTRJ: case efTRR: case efTNG: if (fr->bV) @@ -395,7 +393,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind, case efXTC: write_xtc(status->fio, nind, fr->step, fr->time, fr->box, xout, prec); break; - case efTRJ: case efTRR: fwrite_trn(status->fio, nframes_read(status), fr->time, fr->step, fr->box, nind, xout, vout, fout); @@ -433,8 +430,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind, switch (ftp) { - case efTRN: - case efTRJ: case efTRR: case efTNG: if (vout) @@ -534,7 +529,6 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc) switch (gmx_fio_getftp(status->fio)) { - case efTRJ: case efTRR: break; default: @@ -551,7 +545,6 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc) case efXTC: write_xtc(status->fio, fr->natoms, fr->step, fr->time, fr->box, fr->x, prec); break; - case efTRJ: case efTRR: fwrite_trn(status->fio, fr->step, fr->time, fr->lambda, fr->box, fr->natoms, fr->bX ? fr->x : NULL, fr->bV ? fr->v : NULL, fr->bF ? fr->f : NULL); @@ -814,7 +807,6 @@ gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, t_trxfram } switch (ftp) { - case efTRJ: case efTRR: bRet = gmx_next_frame(status, fr); break; @@ -948,7 +940,6 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status, } switch (ftp) { - case efTRJ: case efTRR: break; case efCPT: diff --git a/src/gromacs/fileio/trxio.h b/src/gromacs/fileio/trxio.h index dab739a34a..f66b4c37f1 100644 --- a/src/gromacs/fileio/trxio.h +++ b/src/gromacs/fileio/trxio.h @@ -138,7 +138,7 @@ void write_tng_frame(t_trxstatus *status, struct t_trxframe *fr); void close_trx(t_trxstatus *status); -/* Close trj file as opened with read_first_x, read_frist_frame +/* Close trajectory file as opened with read_first_x, read_frist_frame * or open_trx. Identical to close_trj. */ @@ -234,12 +234,12 @@ gmx_bool read_next_x(const output_env_t oenv, t_trxstatus *status, real *t, rvec */ void close_trj(t_trxstatus *status); -/* Close trj file as opened with read_first_x, read_frist_frame +/* Close trajectory file as opened with read_first_x, read_first_frame * or open_trx. Identical to close_trx. */ void rewind_trj(t_trxstatus *status); -/* Rewind trj file as opened with read_first_x */ +/* Rewind trajectory file as opened with read_first_x */ struct t_topology *read_top(const char *fn, int *ePBC); /* Extract a topology data structure from a topology file. diff --git a/src/gromacs/gmxana/gmx_density.c b/src/gromacs/gmxana/gmx_density.c index 4282430de0..43a3180d67 100644 --- a/src/gromacs/gmxana/gmx_density.c +++ b/src/gromacs/gmxana/gmx_density.c @@ -671,7 +671,7 @@ int gmx_density(int argc, char *argv[]) t_filenm fnm[] = { /* files for g_density */ { efTRX, "-f", NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efDAT, "-ei", "electrons", ffOPTRD }, /* file with nr. of electrons */ { efXVG, "-o", "density", ffWRITE }, }; @@ -693,7 +693,7 @@ int gmx_density(int argc, char *argv[]) /* Calculate axis */ axis = toupper(axtitle[0]) - 'X'; - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */ + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */ if (dens_opt[0][0] == 'n') { for (i = 0; (i < top->atoms.nr); i++) diff --git a/src/gromacs/gmxana/gmx_densorder.cpp b/src/gromacs/gmxana/gmx_densorder.cpp index 79c9e68a11..5d8a8d9bb1 100644 --- a/src/gromacs/gmxana/gmx_densorder.cpp +++ b/src/gromacs/gmxana/gmx_densorder.cpp @@ -726,7 +726,7 @@ int gmx_densorder(int argc, char *argv[]) t_filenm fnm[] = { - { efTPX, "-s", NULL, ffREAD }, /* this is for the topology */ + { efTPR, "-s", NULL, ffREAD }, /* this is for the topology */ { efTRX, "-f", NULL, ffREAD }, /* and this for the trajectory */ { efNDX, "-n", NULL, ffREAD}, /* this is to select groups */ { efDAT, "-o", "Density4D", ffOPTWR}, /* This is for outputting the entire 4D densityfield in binary format */ @@ -751,7 +751,7 @@ int gmx_densorder(int argc, char *argv[]) bRawOut = opt2bSet("-or", NFILE, fnm); bGraph = opt2bSet("-og", NFILE, fnm); bOut = opt2bSet("-o", NFILE, fnm); - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); snew(grpname, 1); snew(index, 1); snew(ngx, 1); diff --git a/src/gromacs/gmxana/gmx_dipoles.cpp b/src/gromacs/gmxana/gmx_dipoles.cpp index 569954d341..68e338fe04 100644 --- a/src/gromacs/gmxana/gmx_dipoles.cpp +++ b/src/gromacs/gmxana/gmx_dipoles.cpp @@ -1590,7 +1590,7 @@ int gmx_dipoles(int argc, char *argv[]) t_filenm fnm[] = { { efEDR, "-en", NULL, ffOPTRD }, { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efXVG, "-o", "Mtot", ffWRITE }, { efXVG, "-eps", "epsilon", ffWRITE }, @@ -1664,7 +1664,7 @@ int gmx_dipoles(int argc, char *argv[]) } snew(top, 1); - ePBC = read_tpx_top(ftp2fn(efTPX, NFILE, fnm), NULL, box, + ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms, NULL, NULL, NULL, top); snew(gnx, ncos); diff --git a/src/gromacs/gmxana/gmx_disre.c b/src/gromacs/gmxana/gmx_disre.c index 4852d3616b..d7e1dd8af8 100644 --- a/src/gromacs/gmxana/gmx_disre.c +++ b/src/gromacs/gmxana/gmx_disre.c @@ -717,7 +717,7 @@ int gmx_disre(int argc, char *argv[]) gmx_rmpbc_t gpbc = NULL; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRX, "-f", NULL, ffREAD }, { efXVG, "-ds", "drsum", ffWRITE }, { efXVG, "-da", "draver", ffWRITE }, @@ -745,9 +745,9 @@ int gmx_disre(int argc, char *argv[]) init5(ntop); } - read_tpxheader(ftp2fn(efTPX, NFILE, fnm), &header, FALSE, NULL, NULL); + read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &header, FALSE, NULL, NULL); snew(xtop, header.natoms); - read_tpx(ftp2fn(efTPX, NFILE, fnm), &ir, box, &ntopatoms, xtop, NULL, NULL, &mtop); + read_tpx(ftp2fn(efTPR, NFILE, fnm), &ir, box, &ntopatoms, xtop, NULL, NULL, &mtop); bPDB = opt2bSet("-q", NFILE, fnm); if (bPDB) { diff --git a/src/gromacs/gmxana/gmx_dos.c b/src/gromacs/gmxana/gmx_dos.c index e353d7a3e8..07439151bc 100644 --- a/src/gromacs/gmxana/gmx_dos.c +++ b/src/gromacs/gmxana/gmx_dos.c @@ -305,7 +305,7 @@ int gmx_dos(int argc, char *argv[]) t_filenm fnm[] = { { efTRN, "-f", NULL, ffREAD }, - { efTPX, "-s", NULL, ffREAD }, + { efTPR, "-s", NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efXVG, "-vacf", "vacf", ffWRITE }, { efXVG, "-mvacf", "mvacf", ffWRITE }, @@ -342,7 +342,7 @@ int gmx_dos(int argc, char *argv[]) please_cite(fplog, "Pascal2011a"); please_cite(fplog, "Caleman2011b"); - read_tps_conf(ftp2fn(efTPX, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, + read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, TRUE); V = det(box); tmass = 0; diff --git a/src/gromacs/gmxana/gmx_editconf.c b/src/gromacs/gmxana/gmx_editconf.c index c710ecfd15..abe79cb071 100644 --- a/src/gromacs/gmxana/gmx_editconf.c +++ b/src/gromacs/gmxana/gmx_editconf.c @@ -793,11 +793,9 @@ int gmx_editconf(int argc, char *argv[]) gmx_fatal(FARGS, "Output file should be a .pdb file" " when using the -grasp option\n"); } - if ((bMead || bGrasp) && !((fn2ftp(infile) == efTPR) || - (fn2ftp(infile) == efTPA) || - (fn2ftp(infile) == efTPB))) + if ((bMead || bGrasp) && (fn2ftp(infile) != efTPR)) { - gmx_fatal(FARGS, "Input file should be a .tp[abr] file" + gmx_fatal(FARGS, "Input file should be a .tpr file" " when using the -mead option\n"); } diff --git a/src/gromacs/gmxana/gmx_energy.c b/src/gromacs/gmxana/gmx_energy.c index cc3958fda1..96a153cf0c 100644 --- a/src/gromacs/gmxana/gmx_energy.c +++ b/src/gromacs/gmxana/gmx_energy.c @@ -2027,7 +2027,7 @@ int gmx_energy(int argc, char *argv[]) t_filenm fnm[] = { { efEDR, "-f", NULL, ffREAD }, { efEDR, "-f2", NULL, ffOPTRD }, - { efTPX, "-s", NULL, ffOPTRD }, + { efTPR, "-s", NULL, ffOPTRD }, { efXVG, "-o", "energy", ffWRITE }, { efXVG, "-viol", "violaver", ffOPTWR }, { efXVG, "-pairs", "pairs", ffOPTWR }, @@ -2172,7 +2172,7 @@ int gmx_energy(int argc, char *argv[]) if (bORIRE || bOTEN) { - get_orires_parms(ftp2fn(efTPX, NFILE, fnm), &nor, &nex, &or_label, &oobs); + get_orires_parms(ftp2fn(efTPR, NFILE, fnm), &nor, &nex, &or_label, &oobs); } if (bORIRE) @@ -2297,7 +2297,7 @@ int gmx_energy(int argc, char *argv[]) } else if (bDisRe) { - nbounds = get_bounds(ftp2fn(efTPX, NFILE, fnm), &bounds, &index, &pair, &npairs, + nbounds = get_bounds(ftp2fn(efTPR, NFILE, fnm), &bounds, &index, &pair, &npairs, &mtop, &top, &ir); snew(violaver, npairs); out = xvgropen(opt2fn("-o", NFILE, fnm), "Sum of Violations", @@ -2316,7 +2316,7 @@ int gmx_energy(int argc, char *argv[]) } else if (bDHDL) { - get_dhdl_parms(ftp2fn(efTPX, NFILE, fnm), &ir); + get_dhdl_parms(ftp2fn(efTPR, NFILE, fnm), &ir); } /* Initiate energies and set them to zero */ diff --git a/src/gromacs/gmxana/gmx_genion.c b/src/gromacs/gmxana/gmx_genion.c index fc1ac0e8e8..1301d8e01a 100644 --- a/src/gromacs/gmxana/gmx_genion.c +++ b/src/gromacs/gmxana/gmx_genion.c @@ -395,7 +395,7 @@ int gmx_genion(int argc, char *argv[]) output_env_t oenv; gmx_rng_t rng; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efSTO, "-o", NULL, ffWRITE }, { efTOP, "-p", "topol", ffOPTRW } @@ -420,7 +420,7 @@ int gmx_genion(int argc, char *argv[]) } /* Read atom positions and charges */ - read_tps_conf(ftp2fn(efTPX, NFILE, fnm), title, &top, &ePBC, &x, &v, box, FALSE); + read_tps_conf(ftp2fn(efTPR, NFILE, fnm), title, &top, &ePBC, &x, &v, box, FALSE); atoms = top.atoms; /* Compute total charge */ diff --git a/src/gromacs/gmxana/gmx_h2order.c b/src/gromacs/gmxana/gmx_h2order.c index 314f20c46a..27e918b8d3 100644 --- a/src/gromacs/gmxana/gmx_h2order.c +++ b/src/gromacs/gmxana/gmx_h2order.c @@ -304,7 +304,7 @@ int gmx_h2order(int argc, char *argv[]) { efTRX, "-f", NULL, ffREAD }, /* trajectory file */ { efNDX, NULL, NULL, ffREAD }, /* index file */ { efNDX, "-nm", NULL, ffOPTRD }, /* index with micelle atoms */ - { efTPX, NULL, NULL, ffREAD }, /* topology file */ + { efTPR, NULL, NULL, ffREAD }, /* topology file */ { efXVG, "-o", "order", ffWRITE }, /* xvgr output file */ }; @@ -318,7 +318,7 @@ int gmx_h2order(int argc, char *argv[]) } bMicel = opt2bSet("-nm", NFILE, fnm); - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */ + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */ rd_index(ftp2fn(efNDX, NFILE, fnm), 1, &ngx, &index, &grpname); diff --git a/src/gromacs/gmxana/gmx_hbond.c b/src/gromacs/gmxana/gmx_hbond.c index 53fe4fac9a..c226bed5bf 100644 --- a/src/gromacs/gmxana/gmx_hbond.c +++ b/src/gromacs/gmxana/gmx_hbond.c @@ -3637,7 +3637,7 @@ int gmx_hbond(int argc, char *argv[]) }; t_filenm fnm[] = { { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, /* { efNDX, "-sel", "select", ffOPTRD },*/ { efXVG, "-num", "hbnum", ffWRITE }, @@ -3822,7 +3822,7 @@ int gmx_hbond(int argc, char *argv[]) hb = mk_hbdata(bHBmap, opt2bSet("-dan", NFILE, fnm), bMerge || bContact, bGem, gemmode); /* get topology */ - read_tpx_top(ftp2fn(efTPX, NFILE, fnm), &ir, box, &natoms, NULL, NULL, NULL, &top); + read_tpx_top(ftp2fn(efTPR, NFILE, fnm), &ir, box, &natoms, NULL, NULL, NULL, &top); snew(grpnames, grNR); snew(index, grNR); diff --git a/src/gromacs/gmxana/gmx_helix.c b/src/gromacs/gmxana/gmx_helix.c index 70c24752fb..b1bbcb8d6d 100644 --- a/src/gromacs/gmxana/gmx_helix.c +++ b/src/gromacs/gmxana/gmx_helix.c @@ -157,7 +157,7 @@ int gmx_helix(int argc, char *argv[]) gmx_rmpbc_t gpbc = NULL; gmx_bool bRange; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffREAD }, { efTRX, "-f", NULL, ffREAD }, { efSTO, "-cz", "zconf", ffWRITE }, @@ -173,7 +173,7 @@ int gmx_helix(int argc, char *argv[]) bRange = (opt2parg_bSet("-ahxstart", asize(pa), pa) && opt2parg_bSet("-ahxend", asize(pa), pa)); - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); natoms = read_first_x(oenv, &status, opt2fn("-f", NFILE, fnm), &t, &x, box); @@ -208,7 +208,7 @@ int gmx_helix(int argc, char *argv[]) /* Read reference frame from tpx file to compute helix length */ snew(xref, top->atoms.nr); - read_tpx(ftp2fn(efTPX, NFILE, fnm), + read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, NULL, &natoms, xref, NULL, NULL, NULL); calc_hxprops(nres, bb, xref); do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd); diff --git a/src/gromacs/gmxana/gmx_helixorient.c b/src/gromacs/gmxana/gmx_helixorient.c index b42a518b1d..dfd3a1f7cf 100644 --- a/src/gromacs/gmxana/gmx_helixorient.c +++ b/src/gromacs/gmxana/gmx_helixorient.c @@ -149,7 +149,7 @@ int gmx_helixorient(int argc, char *argv[]) #define NPA asize(pa) t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRX, "-f", NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efDAT, "-oaxis", "helixaxis", ffWRITE }, @@ -169,7 +169,7 @@ int gmx_helixorient(int argc, char *argv[]) return 0; } - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); for (i = 0; i < 3; i++) { diff --git a/src/gromacs/gmxana/gmx_hydorder.c b/src/gromacs/gmxana/gmx_hydorder.c index af7ecb739e..74de61fc81 100644 --- a/src/gromacs/gmxana/gmx_hydorder.c +++ b/src/gromacs/gmxana/gmx_hydorder.c @@ -628,7 +628,7 @@ int gmx_hydorder(int argc, char *argv[]) t_filenm fnm[] = { /* files for g_order */ { efTRX, "-f", NULL, ffREAD }, /* trajectory file */ { efNDX, "-n", NULL, ffREAD }, /* index file */ - { efTPX, "-s", NULL, ffREAD }, /* topology file */ + { efTPR, "-s", NULL, ffREAD }, /* topology file */ { efXPM, "-o", "intf", ffWRMULT}, /* XPM- surface maps */ { efOUT, "-or", "raw", ffOPTWRMULT }, /* xvgr output file */ { efOUT, "-Spect", "intfspect", ffOPTWRMULT}, /* Fourier spectrum interfaces */ @@ -655,7 +655,7 @@ int gmx_hydorder(int argc, char *argv[]) } ndxfnm = ftp2fn(efNDX, NFILE, fnm); - tpsfnm = ftp2fn(efTPX, NFILE, fnm); + tpsfnm = ftp2fn(efTPR, NFILE, fnm); trxfnm = ftp2fn(efTRX, NFILE, fnm); /* Calculate axis */ diff --git a/src/gromacs/gmxana/gmx_mk_angndx.c b/src/gromacs/gmxana/gmx_mk_angndx.c index 1b1ceeead6..d27546891a 100644 --- a/src/gromacs/gmxana/gmx_mk_angndx.c +++ b/src/gromacs/gmxana/gmx_mk_angndx.c @@ -272,7 +272,7 @@ int gmx_mk_angndx(int argc, char *argv[]) int *nr; char **grpnames; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, "angle", ffWRITE } }; #define NFILE asize(fnm) @@ -286,7 +286,7 @@ int gmx_mk_angndx(int argc, char *argv[]) ft = select_ftype(opt[0], &nft, &mult); - top = read_top(ftp2fn(efTPX, NFILE, fnm), NULL); + top = read_top(ftp2fn(efTPR, NFILE, fnm), NULL); ntype = calc_ntype(nft, ft, &(top->idef)); snew(grpnames, ntype); diff --git a/src/gromacs/gmxana/gmx_nmeig.c b/src/gromacs/gmxana/gmx_nmeig.c index 63fb24daa3..519f44a3bf 100644 --- a/src/gromacs/gmxana/gmx_nmeig.c +++ b/src/gromacs/gmxana/gmx_nmeig.c @@ -344,7 +344,7 @@ int gmx_nmeig(int argc, char *argv[]) t_filenm fnm[] = { { efMTX, "-f", "hessian", ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efXVG, "-of", "eigenfreq", ffWRITE }, { efXVG, "-ol", "eigenval", ffWRITE }, { efXVG, "-os", "spectrum", ffOPTWR }, @@ -360,10 +360,10 @@ int gmx_nmeig(int argc, char *argv[]) } /* Read tpr file for volume and number of harmonic terms */ - read_tpxheader(ftp2fn(efTPX, NFILE, fnm), &tpx, TRUE, &version, &generation); + read_tpxheader(ftp2fn(efTPR, NFILE, fnm), &tpx, TRUE, &version, &generation); snew(top_x, tpx.natoms); - read_tpx(ftp2fn(efTPX, NFILE, fnm), NULL, box, &natoms, + read_tpx(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms, top_x, NULL, NULL, &mtop); if (bCons) { diff --git a/src/gromacs/gmxana/gmx_options.c b/src/gromacs/gmxana/gmx_options.c index 4a98b8348a..addcdc5f4b 100644 --- a/src/gromacs/gmxana/gmx_options.c +++ b/src/gromacs/gmxana/gmx_options.c @@ -85,7 +85,7 @@ gmx_options(int argc, char *argv[]) "All GROMACS programs can read compressed or g-zipped files. There " "might be a problem with reading compressed [TT].xtc[tt], " - "[TT].trr[tt] and [TT].trj[tt] files, but these will not compress " + "[TT].trr[tt] files, but these will not compress " "very well anyway.", "Most GROMACS programs can process a trajectory with fewer atoms than " diff --git a/src/gromacs/gmxana/gmx_order.c b/src/gromacs/gmxana/gmx_order.c index 0c6e723316..7c2b600d05 100644 --- a/src/gromacs/gmxana/gmx_order.c +++ b/src/gromacs/gmxana/gmx_order.c @@ -961,7 +961,7 @@ int gmx_order(int argc, char *argv[]) { efTRX, "-f", NULL, ffREAD }, /* trajectory file */ { efNDX, "-n", NULL, ffREAD }, /* index file */ { efNDX, "-nr", NULL, ffREAD }, /* index for radial axis calculation */ - { efTPX, NULL, NULL, ffREAD }, /* topology file */ + { efTPR, NULL, NULL, ffREAD }, /* topology file */ { efXVG, "-o", "order", ffWRITE }, /* xvgr output file */ { efXVG, "-od", "deuter", ffWRITE }, /* xvgr output file */ { efPDB, "-ob", NULL, ffWRITE }, /* write Scd as B factors to PDB if permolecule */ @@ -989,7 +989,7 @@ int gmx_order(int argc, char *argv[]) sgfnm = opt2fn_null("-Sg", NFILE, fnm); skfnm = opt2fn_null("-Sk", NFILE, fnm); ndxfnm = opt2fn_null("-n", NFILE, fnm); - tpsfnm = ftp2fn(efTPX, NFILE, fnm); + tpsfnm = ftp2fn(efTPR, NFILE, fnm); trxfnm = ftp2fn(efTRX, NFILE, fnm); /* Calculate axis */ @@ -1060,7 +1060,7 @@ int gmx_order(int argc, char *argv[]) fprintf(stderr, "Taking carbons as unsaturated!\n"); } - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */ + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */ block = init_index(ftp2fn(efNDX, NFILE, fnm), &grpname); index = block->index; /* get indices from t_block block */ diff --git a/src/gromacs/gmxana/gmx_pme_error.cpp b/src/gromacs/gmxana/gmx_pme_error.cpp index b132b6b2b1..0dc23d9f85 100644 --- a/src/gromacs/gmxana/gmx_pme_error.cpp +++ b/src/gromacs/gmxana/gmx_pme_error.cpp @@ -1106,9 +1106,9 @@ int gmx_pme_error(int argc, char *argv[]) static t_filenm fnm[] = { - { efTPX, "-s", NULL, ffREAD }, + { efTPR, "-s", NULL, ffREAD }, { efOUT, "-o", "error", ffWRITE }, - { efTPX, "-so", "tuned", ffOPTWR } + { efTPR, "-so", "tuned", ffOPTWR } }; output_env_t oenv = NULL; diff --git a/src/gromacs/gmxana/gmx_polystat.c b/src/gromacs/gmxana/gmx_polystat.c index b98fdaf12a..367c1c5ff6 100644 --- a/src/gromacs/gmxana/gmx_polystat.c +++ b/src/gromacs/gmxana/gmx_polystat.c @@ -139,7 +139,7 @@ int gmx_polystat(int argc, char *argv[]) }; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRX, "-f", NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efXVG, "-o", "polystat", ffWRITE }, @@ -184,7 +184,7 @@ int gmx_polystat(int argc, char *argv[]) } snew(top, 1); - ePBC = read_tpx_top(ftp2fn(efTPX, NFILE, fnm), + ePBC = read_tpx_top(ftp2fn(efTPR, NFILE, fnm), NULL, box, &natoms, NULL, NULL, NULL, top); fprintf(stderr, "Select a group of polymer mainchain atoms:\n"); diff --git a/src/gromacs/gmxana/gmx_potential.c b/src/gromacs/gmxana/gmx_potential.c index 54ddc2ac8a..ba223b01cc 100644 --- a/src/gromacs/gmxana/gmx_potential.c +++ b/src/gromacs/gmxana/gmx_potential.c @@ -459,7 +459,7 @@ int gmx_potential(int argc, char *argv[]) t_filenm fnm[] = { /* files for g_order */ { efTRX, "-f", NULL, ffREAD }, /* trajectory file */ { efNDX, NULL, NULL, ffREAD }, /* index file */ - { efTPX, NULL, NULL, ffREAD }, /* topology file */ + { efTPR, NULL, NULL, ffREAD }, /* topology file */ { efXVG, "-o", "potential", ffWRITE }, /* xvgr output file */ { efXVG, "-oc", "charge", ffWRITE }, /* xvgr output file */ { efXVG, "-of", "field", ffWRITE }, /* xvgr output file */ @@ -477,7 +477,7 @@ int gmx_potential(int argc, char *argv[]) /* Calculate axis */ axis = toupper(axtitle[0]) - 'X'; - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); /* read topology file */ + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); /* read topology file */ snew(grpname, ngrps); snew(index, ngrps); diff --git a/src/gromacs/gmxana/gmx_rama.c b/src/gromacs/gmxana/gmx_rama.c index f5db3dfada..711bac7ece 100644 --- a/src/gromacs/gmxana/gmx_rama.c +++ b/src/gromacs/gmxana/gmx_rama.c @@ -80,7 +80,7 @@ int gmx_rama(int argc, char *argv[]) output_env_t oenv; t_filenm fnm[] = { { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efXVG, NULL, "rama", ffWRITE } }; #define NFILE asize(fnm) @@ -93,7 +93,7 @@ int gmx_rama(int argc, char *argv[]) snew(xr, 1); - init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPX, NFILE, fnm), xr, 3); + init_rama(oenv, ftp2fn(efTRX, NFILE, fnm), ftp2fn(efTPR, NFILE, fnm), xr, 3); out = xvgropen(ftp2fn(efXVG, NFILE, fnm), "Ramachandran Plot", "Phi", "Psi", oenv); xvgr_line_props(out, 0, elNone, ecFrank, oenv); diff --git a/src/gromacs/gmxana/gmx_rotacf.c b/src/gromacs/gmxana/gmx_rotacf.c index 18f4f33a9d..0895c01bb2 100644 --- a/src/gromacs/gmxana/gmx_rotacf.c +++ b/src/gromacs/gmxana/gmx_rotacf.c @@ -100,7 +100,7 @@ int gmx_rotacf(int argc, char *argv[]) int ePBC; t_filenm fnm[] = { { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffREAD }, { efXVG, "-o", "rotacf", ffWRITE } }; @@ -141,7 +141,7 @@ int gmx_rotacf(int argc, char *argv[]) "these can not be atom doublets\n"); } - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); snew(c1, nvec); for (i = 0; (i < nvec); i++) diff --git a/src/gromacs/gmxana/gmx_saltbr.c b/src/gromacs/gmxana/gmx_saltbr.c index 23381e2db7..47b3e6cca7 100644 --- a/src/gromacs/gmxana/gmx_saltbr.c +++ b/src/gromacs/gmxana/gmx_saltbr.c @@ -150,7 +150,7 @@ int gmx_saltbr(int argc, char *argv[]) }; t_filenm fnm[] = { { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, }; #define NFILE asize(fnm) @@ -190,7 +190,7 @@ int gmx_saltbr(int argc, char *argv[]) return 0; } - top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC); + top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC); cg = mk_charge(&top->atoms, &(top->cgs), &ncg); snew(cgdist, ncg); snew(nWithin, ncg); diff --git a/src/gromacs/gmxana/gmx_sans.c b/src/gromacs/gmxana/gmx_sans.c index 6838d272a3..a91af5888b 100644 --- a/src/gromacs/gmxana/gmx_sans.c +++ b/src/gromacs/gmxana/gmx_sans.c @@ -146,7 +146,7 @@ int gmx_sans(int argc, char *argv[]) #define NFILE asize(fnm) t_filenm fnm[] = { - { efTPX, "-s", NULL, ffREAD }, + { efTPR, "-s", NULL, ffREAD }, { efTRX, "-f", NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efDAT, "-d", "nsfactor", ffOPTRD }, @@ -217,7 +217,7 @@ int gmx_sans(int argc, char *argv[]) /* Try to read files */ fnDAT = ftp2fn(efDAT, NFILE, fnm); - fnTPX = ftp2fn(efTPX, NFILE, fnm); + fnTPX = ftp2fn(efTPR, NFILE, fnm); fnTRX = ftp2fn(efTRX, NFILE, fnm); gnsf = gmx_neutronstructurefactors_init(fnDAT); diff --git a/src/gromacs/gmxana/gmx_spol.c b/src/gromacs/gmxana/gmx_spol.c index af6ed8cc0d..e715f578c3 100644 --- a/src/gromacs/gmxana/gmx_spol.c +++ b/src/gromacs/gmxana/gmx_spol.c @@ -205,7 +205,7 @@ int gmx_spol(int argc, char *argv[]) t_filenm fnm[] = { { efTRX, NULL, NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD }, { efXVG, NULL, "scdist", ffWRITE } }; @@ -219,7 +219,7 @@ int gmx_spol(int argc, char *argv[]) snew(top, 1); snew(ir, 1); - read_tpx_top(ftp2fn(efTPX, NFILE, fnm), + read_tpx_top(ftp2fn(efTPR, NFILE, fnm), ir, box, &natoms, NULL, NULL, NULL, top); /* get index groups */ diff --git a/src/gromacs/gmxana/gmx_trjconv.c b/src/gromacs/gmxana/gmx_trjconv.c index a0e38488d7..29e064f74b 100644 --- a/src/gromacs/gmxana/gmx_trjconv.c +++ b/src/gromacs/gmxana/gmx_trjconv.c @@ -470,7 +470,7 @@ static void mk_filenm(char *base, const char *ext, int ndigit, int file_nr, void check_trn(const char *fn) { - if ((fn2ftp(fn) != efTRJ) && (fn2ftp(fn) != efTRR)) + if (fn2ftp(fn) != efTRR) { gmx_fatal(FARGS, "%s is not a trajectory file, exiting\n", fn); } @@ -493,7 +493,7 @@ void do_trunc(const char *fn, real t0) gmx_fatal(FARGS, "You forgot to set the truncation time"); } - /* Check whether this is a .trj file */ + /* Check whether this is a .trr file */ check_trn(fn); in = open_trn(fn, "r"); @@ -616,18 +616,18 @@ int gmx_trjconv(int argc, char *argv[]) "[PAR]", "The following formats are supported for input and output:", - "[TT].xtc[tt], [TT].trr[tt], [TT].trj[tt], [TT].gro[tt], [TT].g96[tt]", + "[TT].xtc[tt], [TT].trr[tt], [TT].gro[tt], [TT].g96[tt]", "and [TT].pdb[tt].", "The file formats are detected from the file extension.", "The precision of [TT].xtc[tt] and [TT].gro[tt] output is taken from the", "input file for [TT].xtc[tt], [TT].gro[tt] and [TT].pdb[tt],", "and from the [TT]-ndec[tt] option for other input formats. The precision", "is always taken from [TT]-ndec[tt], when this option is set.", - "All other formats have fixed precision. [TT].trr[tt] and [TT].trj[tt]", + "All other formats have fixed precision. [TT].trr[tt]", "output can be single or double precision, depending on the precision", "of the [THISMODULE] binary.", "Note that velocities are only supported in", - "[TT].trr[tt], [TT].trj[tt], [TT].gro[tt] and [TT].g96[tt] files.[PAR]", + "[TT].trr[tt], [TT].gro[tt] and [TT].g96[tt] files.[PAR]", "Option [TT]-sep[tt] can be used to write every frame to a separate", "[TT].gro, .g96[tt] or [TT].pdb[tt] file. By default, all frames all written to one file.", @@ -715,7 +715,7 @@ int gmx_trjconv(int argc, char *argv[]) "can reduce the number of frames while using low-pass frequency", "filtering, this reduces aliasing of high frequency motions.[PAR]", - "Using [TT]-trunc[tt] [THISMODULE] can truncate [TT].trj[tt] in place, i.e.", + "Using [TT]-trunc[tt] [THISMODULE] can truncate [TT].trr[tt] in place, i.e.", "without copying the file. This is useful when a run has crashed", "during disk I/O (i.e. full disk), or when two contiguous", "trajectories must be concatenated without having double frames.[PAR]", @@ -1033,9 +1033,9 @@ int gmx_trjconv(int argc, char *argv[]) { /* check if velocities are possible in input and output files */ ftpin = fn2ftp(in_file); - bVels = (ftp == efTRR || ftp == efTRJ || ftp == efGRO || + bVels = (ftp == efTRR || ftp == efGRO || ftp == efG96 || ftp == efTNG) - && (ftpin == efTRR || ftpin == efTRJ || ftpin == efGRO || + && (ftpin == efTRR || ftpin == efGRO || ftpin == efG96 || ftpin == efTNG || ftpin == efCPT); } if (bSeparate || bSplit) @@ -1269,7 +1269,7 @@ int gmx_trjconv(int argc, char *argv[]) useatoms.nr = nout; } /* select what to read */ - if (ftp == efTRR || ftp == efTRJ) + if (ftp == efTRR) { flags = TRX_READ_X; } @@ -1353,7 +1353,6 @@ int gmx_trjconv(int argc, char *argv[]) break; case efXTC: case efTRR: - case efTRJ: out = NULL; if (!bSplit && !bSubTraj) { @@ -1748,7 +1747,6 @@ int gmx_trjconv(int argc, char *argv[]) write_tng_frame(trxout, &frout); // TODO when trjconv behaves better: work how to read and write lambda break; - case efTRJ: case efTRR: case efXTC: if (bSplitHere) diff --git a/src/gromacs/gmxana/gmx_tune_pme.c b/src/gromacs/gmxana/gmx_tune_pme.c index d5222db270..80a86c4df4 100644 --- a/src/gromacs/gmxana/gmx_tune_pme.c +++ b/src/gromacs/gmxana/gmx_tune_pme.c @@ -2092,9 +2092,9 @@ int gmx_tune_pme(int argc, char *argv[]) /* g_tune_pme */ { efOUT, "-p", "perf", ffWRITE }, { efLOG, "-err", "bencherr", ffWRITE }, - { efTPX, "-so", "tuned", ffWRITE }, + { efTPR, "-so", "tuned", ffWRITE }, /* mdrun: */ - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRN, "-o", NULL, ffWRITE }, { efCOMPRESSED, "-x", NULL, ffOPTWR }, { efCPT, "-cpi", NULL, ffOPTRD }, diff --git a/src/gromacs/gmxana/gstat.h b/src/gromacs/gmxana/gstat.h index bac6aeb270..0d490d9ab1 100644 --- a/src/gromacs/gmxana/gstat.h +++ b/src/gromacs/gmxana/gstat.h @@ -300,7 +300,6 @@ void read_ang_dih(const char *trj_fn, * Read a trajectory and calculate angles and dihedrals. * * trj_fn file name of trajectory - * tpb_fn file name of tpb file * bAngles do we have to read angles or dihedrals * bSaveAll do we have to store all in the dih array * bRb do we have Ryckaert-Bellemans dihedrals (trans = 0) diff --git a/src/gromacs/gmxlib/main.cpp b/src/gromacs/gmxlib/main.cpp index 799a41fa5a..dffa2ad7d8 100644 --- a/src/gromacs/gmxlib/main.cpp +++ b/src/gromacs/gmxlib/main.cpp @@ -101,7 +101,7 @@ static void par_fn(char *base, int ftp, const t_commrec *cr, strcat(buf, "."); /* Add extension again */ - strcat(buf, (ftp == efTPX) ? "tpr" : (ftp == efEDR) ? "edr" : ftp2ext(ftp)); + strcat(buf, (ftp == efTPR) ? "tpr" : (ftp == efEDR) ? "edr" : ftp2ext(ftp)); if (debug) { fprintf(debug, "rank %d par_fn '%s'\n", cr->nodeid, buf); @@ -396,7 +396,7 @@ void init_multisystem(t_commrec *cr, int nsim, char **multidirs, * at the actual file name */ if (is_output(&fnm[i]) || - fnm[i].ftp == efTPX || fnm[i].ftp == efCPT || + fnm[i].ftp == efTPR || fnm[i].ftp == efCPT || strcmp(fnm[i].opt, "-rerun") == 0) { ftp = fn2ftp(fnm[i].fns[0]); diff --git a/src/gromacs/gmxpreprocess/grompp.c b/src/gromacs/gmxpreprocess/grompp.c index d8cde70d4e..7e32feb2f6 100644 --- a/src/gromacs/gmxpreprocess/grompp.c +++ b/src/gromacs/gmxpreprocess/grompp.c @@ -1534,7 +1534,7 @@ int gmx_grompp(int argc, char *argv[]) { efNDX, NULL, NULL, ffOPTRD }, { efTOP, NULL, NULL, ffREAD }, { efTOP, "-pp", "processed", ffOPTWR }, - { efTPX, "-o", NULL, ffWRITE }, + { efTPR, "-o", NULL, ffWRITE }, { efTRN, "-t", NULL, ffOPTRD }, { efEDR, "-e", NULL, ffOPTRD }, /* This group is needed by the VMD viewer as the start configuration for IMD sessions: */ @@ -2083,7 +2083,7 @@ int gmx_grompp(int argc, char *argv[]) } done_warning(wi, FARGS); - write_tpx_state(ftp2fn(efTPX, NFILE, fnm), ir, &state, sys); + write_tpx_state(ftp2fn(efTPR, NFILE, fnm), ir, &state, sys); /* Output IMD group, if bIMD is TRUE */ write_IMDgroup_to_file(ir->bIMD, ir, &state, sys, NFILE, fnm); diff --git a/src/gromacs/tools/check.c b/src/gromacs/tools/check.c index ceb5ec2173..63fd7cffb1 100644 --- a/src/gromacs/tools/check.c +++ b/src/gromacs/tools/check.c @@ -708,8 +708,8 @@ void chk_enx(const char *fn) int gmx_check(int argc, char *argv[]) { const char *desc[] = { - "[THISMODULE] reads a trajectory ([TT].trj[tt], [TT].trr[tt] or ", - "[TT].xtc[tt]), an energy file ([TT].ene[tt] or [TT].edr[tt])", + "[THISMODULE] reads a trajectory ([TT].tng[tt], [TT].trr[tt] or ", + "[TT].xtc[tt]), an energy file ([TT].edr[tt])", "or an index file ([TT].ndx[tt])", "and prints out useful information about them.[PAR]", "Option [TT]-c[tt] checks for presence of coordinates,", @@ -725,8 +725,8 @@ int gmx_check(int argc, char *argv[]) "file are indeed correct in the trajectory. If not you may have", "non-matching files due to e.g. deshuffling or due to problems with", "virtual sites. With these flags, [TT]gmx check[tt] provides a quick check for such problems.[PAR]", - "The program can compare two run input ([TT].tpr[tt], [TT].tpb[tt] or", - "[TT].tpa[tt]) files", + "The program can compare two run input ([TT].tpr[tt])", + "files", "when both [TT]-s1[tt] and [TT]-s2[tt] are supplied.", "Similarly a pair of trajectory files can be compared (using the [TT]-f2[tt]", "option), or a pair of energy files (using the [TT]-e2[tt] option).[PAR]", @@ -738,8 +738,8 @@ int gmx_check(int argc, char *argv[]) t_filenm fnm[] = { { efTRX, "-f", NULL, ffOPTRD }, { efTRX, "-f2", NULL, ffOPTRD }, - { efTPX, "-s1", "top1", ffOPTRD }, - { efTPX, "-s2", "top2", ffOPTRD }, + { efTPR, "-s1", "top1", ffOPTRD }, + { efTPR, "-s2", "top2", ffOPTRD }, { efTPS, "-c", NULL, ffOPTRD }, { efEDR, "-e", NULL, ffOPTRD }, { efEDR, "-e2", "ener2", ffOPTRD }, @@ -796,7 +796,7 @@ int gmx_check(int argc, char *argv[]) } else if (fn2) { - fprintf(stderr, "Please give me TWO trajectory (.xtc/.trr/.trj) files!\n"); + fprintf(stderr, "Please give me TWO trajectory (.xtc/.trr/.tng) files!\n"); } fn1 = opt2fn_null("-s1", NFILE, fnm); @@ -819,7 +819,7 @@ int gmx_check(int argc, char *argv[]) } else if ((fn1 && !opt2fn_null("-f", NFILE, fnm)) || (!fn1 && fn2)) { - fprintf(stderr, "Please give me TWO run input (.tpr/.tpa/.tpb) files\n" + fprintf(stderr, "Please give me TWO run input (.tpr) files\n" "or specify the -m flag to generate a methods.tex file\n"); } diff --git a/src/gromacs/tools/convert_tpr.c b/src/gromacs/tools/convert_tpr.c index c70e194488..814f7ee1e4 100644 --- a/src/gromacs/tools/convert_tpr.c +++ b/src/gromacs/tools/convert_tpr.c @@ -374,11 +374,11 @@ int gmx_convert_tpr(int argc, char *argv[]) char buf[200], buf2[200]; output_env_t oenv; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRN, "-f", NULL, ffOPTRD }, { efEDR, "-e", NULL, ffOPTRD }, { efNDX, NULL, NULL, ffOPTRD }, - { efTPX, "-o", "tpxout", ffWRITE } + { efTPR, "-o", "tprout", ffWRITE } }; #define NFILE asize(fnm) @@ -423,7 +423,7 @@ int gmx_convert_tpr(int argc, char *argv[]) bTime = opt2parg_bSet("-time", asize(pa), pa); bTraj = (opt2bSet("-f", NFILE, fnm) || bTime); - top_fn = ftp2fn(efTPX, NFILE, fnm); + top_fn = ftp2fn(efTPR, NFILE, fnm); fprintf(stderr, "Reading toplogy and stuff from %s\n", top_fn); snew(ir, 1); diff --git a/src/gromacs/tools/dump.c b/src/gromacs/tools/dump.c index 86ba6ff95a..c87fe831ce 100644 --- a/src/gromacs/tools/dump.c +++ b/src/gromacs/tools/dump.c @@ -409,25 +409,20 @@ static void list_tng(const char gmx_unused *fn) void list_trx(const char *fn) { - int ftp; - - ftp = fn2ftp(fn); - if (ftp == efXTC) - { - list_xtc(fn); - } - else if ((ftp == efTRR) || (ftp == efTRJ)) - { - list_trn(fn); - } - else if (ftp == efTNG) - { - list_tng(fn); - } - else + switch (fn2ftp(fn)) { - fprintf(stderr, "File %s is of an unsupported type. Try using the command\n 'less %s'\n", - fn, fn); + case efXTC: + list_xtc(fn); + break; + case efTRR: + list_trn(fn); + break; + case efTNG: + list_tng(fn); + break; + default: + fprintf(stderr, "File %s is of an unsupported type. Try using the command\n 'less %s'\n", + fn, fn); } } @@ -608,9 +603,9 @@ static void list_mtx(const char *fn) int gmx_dump(int argc, char *argv[]) { const char *desc[] = { - "[THISMODULE] reads a run input file ([TT].tpa[tt]/[TT].tpr[tt]/[TT].tpb[tt]),", - "a trajectory ([TT].trj[tt]/[TT].trr[tt]/[TT].xtc[tt]), an energy", - "file ([TT].ene[tt]/[TT].edr[tt]), or a checkpoint file ([TT].cpt[tt])", + "[THISMODULE] reads a run input file ([TT].tpr[tt]),", + "a trajectory ([TT].trr[tt]/[TT].xtc[tt]/[TT]/tng[tt]), an energy", + "file ([TT].edr[tt]) or a checkpoint file ([TT].cpt[tt])", "and prints that to standard output in a readable format.", "This program is essential for checking your run input file in case of", "problems.[PAR]", @@ -622,7 +617,7 @@ int gmx_dump(int argc, char *argv[]) "Position restraint output from -sys -s is broken" }; t_filenm fnm[] = { - { efTPX, "-s", NULL, ffOPTRD }, + { efTPR, "-s", NULL, ffOPTRD }, { efTRX, "-f", NULL, ffOPTRD }, { efEDR, "-e", NULL, ffOPTRD }, { efCPT, NULL, NULL, ffOPTRD }, @@ -648,9 +643,9 @@ int gmx_dump(int argc, char *argv[]) } - if (ftp2bSet(efTPX, NFILE, fnm)) + if (ftp2bSet(efTPR, NFILE, fnm)) { - list_tpx(ftp2fn(efTPX, NFILE, fnm), bShowNumbers, + list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers, ftp2fn_null(efMDP, NFILE, fnm), bSysTop); } else if (ftp2bSet(efTRX, NFILE, fnm)) diff --git a/src/programs/mdrun/mdrun.cpp b/src/programs/mdrun/mdrun.cpp index e2bc90d50d..901cccfdcd 100644 --- a/src/programs/mdrun/mdrun.cpp +++ b/src/programs/mdrun/mdrun.cpp @@ -410,7 +410,7 @@ int gmx_mdrun(int argc, char *argv[]) }; t_commrec *cr; t_filenm fnm[] = { - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efTRN, "-o", NULL, ffWRITE }, { efCOMPRESSED, "-x", NULL, ffOPTWR }, { efCPT, "-cpi", NULL, ffOPTRD }, diff --git a/src/programs/mdrun/membed.c b/src/programs/mdrun/membed.c index 758a5acc47..af701ac48f 100644 --- a/src/programs/mdrun/membed.c +++ b/src/programs/mdrun/membed.c @@ -1034,7 +1034,7 @@ gmx_membed_t init_membed(FILE *fplog, int nfile, const t_filenm fnm[], gmx_mtop_ get_input(membed_input, &xy_fac, &xy_max, &z_fac, &z_max, &it_xy, &it_z, &probe_rad, &low_up_rm, &maxwarn, &pieces, &bALLOW_ASYMMETRY); - tpr_version = get_tpr_version(ftp2fn(efTPX, nfile, fnm)); + tpr_version = get_tpr_version(ftp2fn(efTPR, nfile, fnm)); if (tpr_version < membed_version) { gmx_fatal(FARGS, "Version of *.tpr file to old (%d). " diff --git a/src/programs/mdrun/runner.cpp b/src/programs/mdrun/runner.cpp index 0afd51b194..864b2b729e 100644 --- a/src/programs/mdrun/runner.cpp +++ b/src/programs/mdrun/runner.cpp @@ -1103,7 +1103,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt, if (SIMMASTER(cr)) { /* Read (nearly) all data required for the simulation */ - read_tpx_state(ftp2fn(efTPX, nfile, fnm), inputrec, state, NULL, mtop); + read_tpx_state(ftp2fn(efTPR, nfile, fnm), inputrec, state, NULL, mtop); if (inputrec->cutoff_scheme != ecutsVERLET && ((Flags & MD_TESTVERLET) || getenv("GMX_VERLET_SCHEME") != NULL)) diff --git a/src/programs/view/view.cpp b/src/programs/view/view.cpp index 23a58df929..891cb1fd81 100644 --- a/src/programs/view/view.cpp +++ b/src/programs/view/view.cpp @@ -309,7 +309,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[], snew(gmx, 1); snew(gmx->wd, 1); - ePBC = read_tpx_top(ftp2fn(efTPX, nfile, fnm), + ePBC = read_tpx_top(ftp2fn(efTPR, nfile, fnm), NULL, box, &natom, NULL, NULL, NULL, &top); read_first_frame(oenv, &status, ftp2fn(efTRX, nfile, fnm), &fr, TRX_DONT_SKIP); @@ -365,7 +365,7 @@ static void init_gmx(t_x11 *x11, char *program, int nfile, t_filenm fnm[], init_dlgs(x11, gmx); /* Now do file operations */ - set_file(x11, gmx->man, ftp2fn(efTRX, nfile, fnm), ftp2fn(efTPX, nfile, fnm)); + set_file(x11, gmx->man, ftp2fn(efTRX, nfile, fnm), ftp2fn(efTPR, nfile, fnm)); ShowDlg(gmx->dlgs[edFilter]); } @@ -397,7 +397,7 @@ int gmx_view(int argc, char *argv[]) output_env_t oenv; t_filenm fnm[] = { { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, + { efTPR, NULL, NULL, ffREAD }, { efNDX, NULL, NULL, ffOPTRD } }; #define NFILE asize(fnm)