Remove support for .g87 and .xyz I/O formats
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 12 Jan 2014 22:23:11 +0000 (23:23 +0100)
committerRossen Apostolov <rossen@kth.se>
Sun, 16 Feb 2014 22:35:34 +0000 (23:35 +0100)
Aspects of support for these have been broken since before GROMACS
4.5. That support is sometimes interactive, and thus a poor fit for
the way GROMACS supports other trajectory and coordinate formats.
Other file-format conversion options exist; GROMACS does not have to
be a Swiss-army knife.

Removed undocumented features of gmx helix that required .g87 support
for no particularly good reason.

Uncrustified files in this commit

Change-Id: Iad4845fd66ad4c55f9a31965d33ded745656db53

17 files changed:
manual/files.tex
share/html/links.dat
share/html/online/files.html
share/html/online/g87.html [deleted file]
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesLongFileOptions.xml
src/gromacs/commandline/tests/refdata/CommandLineHelpWriterTest_HandlesOptionTypes.xml
src/gromacs/fileio/confio.c
src/gromacs/fileio/filenm.c
src/gromacs/fileio/filenm.h
src/gromacs/fileio/g87io.c [deleted file]
src/gromacs/fileio/g87io.h [deleted file]
src/gromacs/fileio/trxio.c
src/gromacs/gmxana/gmx_helix.c
src/gromacs/gmxana/gmx_trjcat.c
src/gromacs/gmxana/gmx_trjconv.c
src/gromacs/gmxana/legacytests/gmx_traj_tests.cpp
src/gromacs/gmxana/legacytests/spc2-traj.g87 [deleted file]

index 59665159c8447a0e0c811e1f867b6662486bd99f..1fae94e9892d6ee1bd91f5fe4db497fdc0c4a3e0 100644 (file)
@@ -1,7 +1,7 @@
 %
 % This file is part of the GROMACS molecular simulation package.
 %
-% Copyright (c) 2013, by the GROMACS development team, led by
+% Copyright (c) 2013,2014, by the GROMACS development team, led by
 % Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 % and including many others, as listed in the AUTHORS file in the
 % top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,6 @@
 \tt    eiwit & \tt ent & Asc & \tt -f & Entry in the protein date bank \\[-0.1ex]
 \tt     plot & \tt eps & Asc & \tt    & Encapsulated PostScript (tm) file \\[-0.1ex]
 \tt     conf & \tt esp & Asc & \tt -c & Coordinate file in ESPResSo format \\[-0.1ex]
-\tt    gtraj & \tt g87 & Asc & \tt    & Gromos-87 ASCII trajectory 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]
index 3b35abe5889efcbf55a66dca3c27e3e7fda6cb05..8ee9ba7b0ccbdabeaea6cb2eefc1c1aa14bd2eb8 100644 (file)
@@ -6,7 +6,6 @@ edo
 edr
 ene
 eps
-g87
 g96
 gro
 hdb
index dc84d82fe8bc36a578a085a67596929e205b54d2..b27ca53880a20c3df7b7c2ec9c40426ca33207b1 100644 (file)
@@ -62,7 +62,6 @@ and velocities (binary)
 <dt><a href="trj.html">trj</a> <dd>x, v and f (binary, full precision)
 <dt><a href="trr.html">trr</a> <dd>x, v and f (binary, full precision, portable)
 <dt><a href="xtc.html">xtc</a> <dd>x only (compressed, portable, any precision)
-<dt><a href="g87.html">g87</a> <dd>x and v (ascii)
 <dt><a href="gro.html">gro</a> <dd>x and v (ascii, any precision)
 <dt><a href="g96.html">g96</a> <dd>x only (ascii, fixed high precision)
 <dt><a href="pdb.html">pdb</a> <dd>x only (ascii, reduced precision)
@@ -78,7 +77,6 @@ and velocities (binary)
 <a href="gro.html">gro</a>,
 <a href="g96.html">g96</a>,
 <a href="pdb.html">pdb</a> or
-<a href="g87.html">g87</a>
 </dl>
 
 <br><dt><h3>Energy files</h3>
diff --git a/share/html/online/g87.html b/share/html/online/g87.html
deleted file mode 100644 (file)
index 14f1a81..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<title>Gromos87 trajectory file format</title>
-<h3>Description</h3>
-This is a simple ASCII format:<br>
-<pre>
-TITLE
-x(i) (10f8.3)
-box(m) (10f8.8)
-</pre>
-
-The number of atoms is <b>not</b> stored, neither is there any indication
-of whether a box is present. The box is stored only for constant pressure
-simulations. So, you simply have to remember this stuff.
index e2097e565af4627e9fb978cdc3ea81668a52c5f9..a6e93965143d0fd44d5132d810a3693f28b3a679 100644 (file)
@@ -11,13 +11,13 @@ 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 g87 tng
- -f2    [<.xtc/.trr/...>] (path/to/long/trajectory.xtc) (Input)
-     File name option with a long value: xtc trr cpt trj gro g96 pdb g87 tng
+ -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
+ -f2    <.xtc/.trr/...> (path/to/long/trajectory.xtc) (Input)
+     File name option with a long value: xtc trr cpt trj 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
-     g87 tng
+     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.)
index 27658f1077289302579a7c9c16380ff3d5c32621..d5c0c35b0f74c30fdcfa885efb04fd05744e89f5 100644 (file)
@@ -13,10 +13,10 @@ OPTIONS
 
 Options to specify input and output files:
 
- -f     [<.xtc/.trr/...>] (traj.xtc) (Input)
-     Input file description: xtc trr cpt trj gro g96 pdb g87 tng
+ -f     <.xtc/.trr/...> (traj.xtc) (Input)
+     Input file description: xtc trr cpt trj gro g96 pdb tng
  -mult  [<.xtc/.trr/...> [...]] (traj.xtc) (Input, Opt.)
-     Multiple file description: xtc trr cpt trj gro g96 pdb g87 tng
+     Multiple file description: xtc trr cpt trj 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
index 31708a357d55fcfe43591312903238390d4b519c..f1cf0a76037878fd4adb00528ad8f07d75a678a1 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1478,40 +1478,6 @@ void write_sto_conf_indexed(const char *outfile, const char *title,
     }
 }
 
-static void write_xyz_conf(const char *outfile, const char *title,
-                           t_atoms *atoms, rvec *x)
-{
-    FILE          *fp;
-    int            i, anr;
-    real           value;
-    char          *ptr, *name;
-    gmx_atomprop_t aps = gmx_atomprop_init();
-
-    fp = gmx_fio_fopen(outfile, "w");
-    fprintf(fp, "%3d\n", atoms->nr);
-    fprintf(fp, "%s\n", title);
-    for (i = 0; (i < atoms->nr); i++)
-    {
-        anr  = atoms->atom[i].atomnumber;
-        name = *atoms->atomname[i];
-        if (anr == NOTSET)
-        {
-            if (gmx_atomprop_query(aps, epropElement, "???", name, &value))
-            {
-                anr = gmx_nint(value);
-            }
-        }
-        if ((ptr = gmx_atomprop_element(aps, anr)) == NULL)
-        {
-            ptr = name;
-        }
-        fprintf(fp, "%3s%10.5f%10.5f%10.5f\n", ptr,
-                10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ]);
-    }
-    gmx_fio_fclose(fp);
-    gmx_atomprop_destroy(aps);
-}
-
 void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
                     rvec x[], rvec *v, int ePBC, matrix box)
 {
@@ -1545,9 +1511,6 @@ void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
             write_g96_conf(out, &fr, -1, NULL);
             gmx_fio_fclose(out);
             break;
-        case efXYZ:
-            write_xyz_conf(outfile, (strlen(title) > 0) ? title : outfile, atoms, x);
-            break;
         case efPDB:
         case efBRK:
         case efENT:
@@ -1599,54 +1562,6 @@ void write_sto_conf_mtop(const char *outfile, const char *title,
     }
 }
 
-static int get_xyz_coordnum(const char *infile)
-{
-    FILE *fp;
-    int   n;
-
-    fp = gmx_fio_fopen(infile, "r");
-    if (fscanf(fp, "%d", &n) != 1)
-    {
-        gmx_fatal(FARGS, "Can not read number of atoms from %s", infile);
-    }
-    gmx_fio_fclose(fp);
-
-    return n;
-}
-
-static void read_xyz_conf(const char *infile, char *title,
-                          t_atoms *atoms, rvec *x)
-{
-    FILE     *fp;
-    int       i, n;
-    double    xx, yy, zz;
-    t_symtab *tab;
-    char      atomnm[32], buf[STRLEN];
-
-    snew(tab, 1);
-    fp = gmx_fio_fopen(infile, "r");
-    fgets2(buf, STRLEN-1, fp);
-    if (sscanf(buf, "%d", &n) != 1)
-    {
-        gmx_fatal(FARGS, "Can not read number of atoms from %s", infile);
-    }
-    fgets2(buf, STRLEN-1, fp);
-    strcpy(title, buf);
-    for (i = 0; (i < n); i++)
-    {
-        fgets2(buf, STRLEN-1, fp);
-        if (sscanf(buf, "%s%lf%lf%lf", atomnm, &xx, &yy, &zz) != 4)
-        {
-            gmx_fatal(FARGS, "Can not read coordinates from %s", infile);
-        }
-        atoms->atomname[i] = put_symtab(tab, atomnm);
-        x[i][XX]           = xx*0.1;
-        x[i][YY]           = yy*0.1;
-        x[i][ZZ]           = zz*0.1;
-    }
-    gmx_fio_fclose(fp);
-}
-
 void get_stx_coordnum(const char *infile, int *natoms)
 {
     FILE      *in;
@@ -1672,9 +1587,6 @@ void get_stx_coordnum(const char *infile, int *natoms)
             *natoms   = read_g96_conf(in, infile, &fr, g96_line);
             gmx_fio_fclose(in);
             break;
-        case efXYZ:
-            *natoms = get_xyz_coordnum(infile);
-            break;
         case efPDB:
         case efBRK:
         case efENT:
@@ -1733,9 +1645,6 @@ void read_stx_conf(const char *infile, char *title, t_atoms *atoms,
         case efGRO:
             read_whole_conf(infile, title, atoms, x, v, box);
             break;
-        case efXYZ:
-            read_xyz_conf(infile, title, atoms, x);
-            break;
         case efG96:
             fr.title  = NULL;
             fr.natoms = atoms->nr;
index b5c095bf9a9b8a55bbf5c7e116d5d5f820d2d5df..eec919a98c89756026e797d454e219a760c4d2c5 100644 (file)
@@ -77,7 +77,7 @@ static const int trxs[] =
 #ifdef USE_XDR
     efXTC, efTRR, efCPT,
 #endif
-    efTRJ, efGRO, efG96, efPDB, efG87, efTNG
+    efTRJ, efGRO, efG96, efPDB, efTNG
 };
 #define NTRXS asize(trxs)
 
@@ -95,7 +95,7 @@ static const int tros[] =
 #ifdef USE_XDR
     efXTC, efTRR,
 #endif
-    efTRJ, efGRO, efG96, efPDB, efG87, efTNG
+    efTRJ, efGRO, efG96, efPDB, efTNG
 };
 #define NTROS asize(tros)
 
@@ -109,12 +109,12 @@ static const int trns[] =
 #define NTRNS asize(trns)
 
 static const int stos[] =
-{ efGRO, efG96, efPDB, efBRK, efENT, efESP, efXYZ };
+{ efGRO, efG96, efPDB, efBRK, efENT, efESP };
 #define NSTOS asize(stos)
 
 static const int stxs[] =
 {
-    efGRO, efG96, efPDB, efBRK, efENT, efESP, efXYZ,
+    efGRO, efG96, efPDB, efBRK, efENT, efESP,
 #ifdef USE_XDR
     efTPR,
 #endif
@@ -168,7 +168,6 @@ static const t_deffile
       "Compressed trajectory (portable xdr format): xtc" },
     { eftTNG, ".tng", "traj", NULL,
       "Trajectory file (tng format)" },
-    { eftASC, ".g87", "gtraj", NULL, "Gromos-87 ASCII trajectory format" },
     { eftXDR, ".edr", "ener",   NULL, "Energy file"},
     { eftGEN, ".???", "conf", "-c", "Structure file", NSTXS, stxs },
     { eftGEN, ".???", "out", "-o", "Structure file", NSTOS, stos },
@@ -179,7 +178,6 @@ static const t_deffile
     { eftASC, ".ent", "eiwit", "-f", "Entry in the protein date bank" },
     { eftASC, ".esp", "conf", "-f", "Coordinate file in Espresso format" },
     { eftASC, ".pqr", "state",  "-o", "Coordinate file for MEAD"},
-    { eftASC, ".xyz", "conf", "-o", "Coordinate file for some other programs" },
     { eftXDR, ".cpt", "state",  "-cp", "Checkpoint file"},
     { eftASC, ".log", "run",    "-l", "Log file"},
     { eftASC, ".xvg", "graph",  "-o", "xvgr/xmgr file"},
index c291b225e4ccab6e59e527768410a908e3858018..438966537b5c3b372dfec86f8bab317e6c8f2e4d 100644 (file)
@@ -2,8 +2,8 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,9 +48,9 @@ extern "C" {
 /* this enum should correspond to the array deffile in gmxlib/filenm.c */
 enum {
     efMDP,
-    efTRX, efTRO, efTRN, efTRR, efTRJ, efCOMPRESSED, efXTC, efTNG, efG87,
+    efTRX, efTRO, efTRN, efTRR, efTRJ, efCOMPRESSED, efXTC, efTNG,
     efEDR,
-    efSTX, efSTO, efGRO, efG96, efPDB, efBRK, efENT, efESP, efPQR, efXYZ,
+    efSTX, efSTO, efGRO, efG96, efPDB, efBRK, efENT, efESP, efPQR,
     efCPT,
     efLOG, efXVG, efOUT,
     efNDX,
diff --git a/src/gromacs/fileio/g87io.c b/src/gromacs/fileio/g87io.c
deleted file mode 100644 (file)
index 8e9b2d5..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#include "g87io.h"
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-
-#define FPL 10
-
-void write_g87(FILE *fp, int natoms, rvec x[], matrix box)
-{
-    int i, j, n;
-
-    n = 0;
-    for (i = 0; (i < natoms); i++)
-    {
-        for (j = 0; (j < 3); j++)
-        {
-            fprintf(fp, "%8.3f", x[i][j]);
-            n++;
-            if (n == FPL)
-            {
-                fprintf(fp, "\n");
-                n = 0;
-            }
-        }
-    }
-    if (n != 0)
-    {
-        fprintf(fp, "\n");
-    }
-    if (box != NULL)
-    {
-        fprintf(fp, "%8.3f%8.3f%8.3f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
-    }
-}
-
-void write_g87_ndx(FILE *fp, int isize, atom_id index[], rvec x[], matrix box)
-{
-    int i, j, n;
-
-    n = 0;
-    for (i = 0; (i < isize); i++)
-    {
-        for (j = 0; (j < 3); j++)
-        {
-            fprintf(fp, "%8.3f", x[index[i]][j]);
-            n++;
-            if (n == FPL)
-            {
-                fprintf(fp, "\n");
-                n = 0;
-            }
-        }
-    }
-    if (n != 0)
-    {
-        fprintf(fp, "\n");
-    }
-    if (box != NULL)
-    {
-        fprintf(fp, "%8.3f%8.3f%8.3f\n", box[XX][XX], box[YY][YY], box[ZZ][ZZ]);
-    }
-}
diff --git a/src/gromacs/fileio/g87io.h b/src/gromacs/fileio/g87io.h
deleted file mode 100644 (file)
index 72ef4d7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * Copyright (c) 2013, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_FILEIO_G87IO_H
-#define GMX_FILEIO_G87IO_H
-
-#include <stdio.h>
-#include "typedefs.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void write_g87(FILE *fp, int natoms, rvec x[], matrix box);
-/* Write a gromos-87 trajectory frame (10f8.3) + box size
- * If box == NULL it is not written
- */
-
-void write_g87_ndx(FILE *fp, int isize, atom_id index[],
-                   rvec x[], matrix box);
-/* Write a gromos-87 trajectory frame (10f8.3) + box size for
- * a subset of the atoms.
- * If box == NULL it is not written
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 8bc55546d61c5d52a8fb846bc39817d8ff775201..f87eea267c312ffdc74b9931952edec7ee036e1c 100644 (file)
@@ -65,7 +65,6 @@
 #include "pdbio.h"
 #include "confio.h"
 #include "checkpoint.h"
-#include "g87io.h"
 
 #include "gromacs/fileio/timecontrol.h"
 
 #define SKIP2  100
 #define SKIP3 1000
 
-/* Globals for gromos-87 input */
-typedef enum {
-    effXYZ, effXYZBox, effG87, effG87Box, effNR
-} eFileFormat;
-
 struct t_trxstatus
 {
     int                     __frame;
@@ -86,7 +80,6 @@ struct t_trxstatus
     int                     nxframe;
     t_fileio               *fio;
     tng_trajectory_t        tng;
-    eFileFormat             eFF;
     int                     NATOMS;
     double                  DT, BOX[3];
     gmx_bool                bReadBox;
@@ -352,7 +345,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
             }
         /* no break */
         case efXTC:
-        case efG87:
             if (fr->bX)
             {
                 snew(xout, nind);
@@ -401,9 +393,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
                                       fr->x, -1, fr->box, ' ', fr->step, nind, ind, gc, TRUE);
             }
             break;
-        case efG87:
-            write_g87(gmx_fio_getfp(status->fio), nind, xout, fr->box);
-            break;
         case efG96:
             write_g96_conf(gmx_fio_getfp(status->fio), fr, nind, ind);
             break;
@@ -429,7 +418,6 @@ int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
             }
         /* no break */
         case efXTC:
-        case efG87:
             sfree(xout);
             break;
         default:
@@ -561,9 +549,6 @@ int write_trxframe(t_trxstatus *status, t_trxframe *fr, gmx_conect gc)
                               ' ', fr->step, gc, TRUE);
             }
             break;
-        case efG87:
-            write_g87(gmx_fio_getfp(status->fio), fr->natoms, fr->x, fr->box);
-            break;
         case efG96:
             write_g96_conf(gmx_fio_getfp(status->fio), fr, -1, NULL);
             break;
@@ -685,196 +670,6 @@ static gmx_bool gmx_next_frame(t_trxstatus *status, t_trxframe *fr)
     return bRet;
 }
 
-static void choose_file_format(FILE *fp)
-{
-    int          i, m, c;
-    int          rc;
-    eFileFormat  eFF;
-    t_trxstatus *stat;
-
-    printf("\n\n");
-    printf("   Select File Format\n");
-    printf("---------------------------\n");
-    printf("1. XYZ File\n");
-    printf("2. XYZ File with Box\n");
-    printf("3. Gromos-87 Ascii Trajectory\n");
-    printf("4. Gromos-87 Ascii Trajectory with Box\n");
-
-    snew(stat, 1);
-    status_init(stat);
-
-    do
-    {
-        printf("\nChoice: ");
-        fflush(stdout);
-        do
-        {
-            rc = scanf("%d", &i);
-        }
-        while (rc != 1);
-        i--;
-    }
-    while ((i < 0) || (i >= effNR));
-    printf("\n");
-
-    stat->eFF = (eFileFormat) i;
-
-    for (m = 0; (m < DIM); m++)
-    {
-        stat->BOX[m] = 0;
-    }
-
-    stat->bReadBox = (stat->eFF == effG87Box) || (stat->eFF == effXYZBox);
-
-    switch (stat->eFF)
-    {
-        case effXYZ:
-        case effXYZBox:
-            if (5 != fscanf(fp, "%d%lf%lf%lf%lf", &stat->NATOMS, &stat->BOX[XX], &stat->BOX[YY], &stat->BOX[ZZ], &stat->DT))
-            {
-                gmx_fatal(FARGS, "Error reading natoms/box in file");
-            }
-            break;
-        case effG87:
-        case effG87Box:
-            printf("GROMOS! OH DEAR...\n\n");
-            printf("Number of atoms ? ");
-            fflush(stdout);
-            if (1 != scanf("%d", &stat->NATOMS))
-            {
-                gmx_fatal(FARGS, "Error reading natoms in file");
-            }
-
-            printf("Time between timeframes ? ");
-            fflush(stdout);
-            if (1 != scanf("%lf", &stat->DT))
-            {
-                gmx_fatal(FARGS, "Error reading dt from file");
-            }
-
-            if (stat->eFF == effG87)
-            {
-                printf("Box X Y Z ? ");
-                fflush(stdout);
-                if (3 != scanf("%lf%lf%lf", &stat->BOX[XX], &stat->BOX[YY], &stat->BOX[ZZ]))
-                {
-                    gmx_fatal(FARGS, "Error reading box in file");
-                }
-            }
-            do
-            {
-                c = fgetc(fp);
-                printf("%c", c);
-            }
-            while (c != '\n');
-            printf("\n");
-            fflush(stdout);
-            break;
-        default:
-            printf("Hellow World\n");
-    }
-}
-
-static gmx_bool do_read_xyz(t_trxstatus *status, FILE *fp, int natoms,
-                            rvec x[], matrix box)
-{
-    int    i, m;
-    double x0;
-
-    for (i = 0; (i < natoms); i++)
-    {
-        for (m = 0; (m < DIM); m++)
-        {
-            if (fscanf(fp, "%lf", &x0) != 1)
-            {
-                if (i || m)
-                {
-                    fprintf(stderr, "error reading statusfile: x[%d][%d]\n", i, m);
-                }
-                /* else eof! */
-                return FALSE;
-            }
-            x[i][m] = x0;
-        }
-    }
-    if (status->bReadBox)
-    {
-        for (m = 0; (m < DIM); m++)
-        {
-            if (fscanf(fp, "%lf", &x0) != 1)
-            {
-                return FALSE;
-            }
-            box[m][m] = x0;
-        }
-    }
-    return TRUE;
-}
-
-static gmx_bool xyz_next_x(t_trxstatus *status, FILE *fp, const output_env_t oenv,
-                           real *t, int natoms, rvec x[], matrix box)
-/* Reads until a new x can be found (return TRUE)
- * or eof (return FALSE)
- */
-{
-    real pt;
-
-    pt = *t;
-    while (!bTimeSet(TBEGIN) || (*t < rTimeValue(TBEGIN)))
-    {
-        if (!do_read_xyz(status, fp, natoms, x, box))
-        {
-            return FALSE;
-        }
-        printcount(status, oenv, *t, FALSE);
-        *t += status->DT;
-        pt  = *t;
-    }
-    if (!bTimeSet(TEND) || (*t <= rTimeValue(TEND)))
-    {
-        if (!do_read_xyz(status, fp, natoms, x, box))
-        {
-            printlast(status, oenv, *t);
-            return FALSE;
-        }
-        printcount(status, oenv, *t, FALSE);
-        pt  = *t;
-        *t += status->DT;
-        return TRUE;
-    }
-    printlast(status, oenv, pt);
-    return FALSE;
-}
-
-static int xyz_first_x(t_trxstatus *status, FILE *fp, const output_env_t oenv,
-                       real *t, rvec **x, matrix box)
-/* Reads fp, mallocs x, and returns x and box
- * Returns natoms when successful, FALSE otherwise
- */
-{
-    int    m;
-
-    initcount(status);
-
-    clear_mat(box);
-    choose_file_format(fp);
-
-    for (m = 0; (m < DIM); m++)
-    {
-        box[m][m] = status->BOX[m];
-    }
-
-    snew(*x, status->NATOMS);
-    *t = status->DT;
-    if (!xyz_next_x(status, fp, oenv, t, status->NATOMS, *x, box))
-    {
-        return 0;
-    }
-    *t = 0.0;
-
-    return status->NATOMS;
-}
-
 static gmx_bool pdb_next_x(t_trxstatus *status, FILE *fp, t_trxframe *fr)
 {
     t_atoms   atoms;
@@ -1002,13 +797,6 @@ gmx_bool read_next_frame(const output_env_t oenv, t_trxstatus *status, t_trxfram
                               status->persistent_line);
                 bRet = (fr->natoms > 0);
                 break;
-            case efG87:
-                bRet = xyz_next_x(status, gmx_fio_getfp(status->fio), oenv, &fr->time,
-                                  fr->natoms, fr->x, fr->box);
-                fr->bTime = bRet;
-                fr->bX    = bRet;
-                fr->bBox  = bRet;
-                break;
             case efXTC:
                 /* B. Hess 2005-4-20
                  * Sometimes is off by one frame
@@ -1157,18 +945,6 @@ int read_first_frame(const output_env_t oenv, t_trxstatus **status,
             }
             fio = (*status)->fio = gmx_fio_open(fn, "r");
             break;
-        case efG87:
-            fr->natoms = xyz_first_x(*status, gmx_fio_getfp(fio), oenv, &fr->time,
-                                     &fr->x, fr->box);
-            if (fr->natoms)
-            {
-                fr->bTime = TRUE;
-                fr->bX    = TRUE;
-                fr->bBox  = TRUE;
-                printcount(*status, oenv, fr->time, FALSE);
-            }
-            bFirst = FALSE;
-            break;
         case efXTC:
             if (read_first_xtc(fio, &fr->natoms, &fr->step, &fr->time, fr->box, &fr->x,
                                &fr->prec, &bOK) == 0)
index 641feb4de312f70579bf575b66d67b53b9159819..e3d8bfcec69dcac0496a5eaf7d4f012e070d038d 100644 (file)
@@ -45,7 +45,6 @@
 #include "fitahx.h"
 #include "gromacs/fileio/futil.h"
 #include "gstat.h"
-#include "gromacs/fileio/g87io.h"
 #include "hxprops.h"
 #include "macros.h"
 #include "gromacs/math/utilities.h"
 #include "xvgr.h"
 #include "gmx_ana.h"
 
-void dump_otrj(FILE *otrj, int natoms, atom_id all_index[], rvec x[],
-               real fac, rvec xav[])
-{
-    static FILE *fp   = NULL;
-    static real  fac0 = 1.0;
-
-    int          i, ai, m;
-    real         xa, xm;
-
-    if (fp == NULL)
-    {
-        fp   = ffopen("WEDGAMMA10.DAT", "w");
-        fac0 = fac;
-    }
-    fac /= fac0;
-
-    fprintf(fp, "%10g\n", fac);
-
-    for (i = 0; (i < natoms); i++)
-    {
-        ai = all_index[i];
-        for (m = 0; (m < DIM); m++)
-        {
-            xa         = xav[ai][m];
-            xm         = x[ai][m]*fac;
-            xav[ai][m] = xa+xm;
-            x[ai][m]   = xm;
-        }
-    }
-    write_g87_ndx(otrj, natoms, all_index, x, NULL);
-}
-
 int gmx_helix(int argc, char *argv[])
 {
     const char        *desc[] = {
@@ -128,10 +95,6 @@ int gmx_helix(int argc, char *argv[])
         "[BB]9.[bb] Ellipticity at 222 nm according to Hirst and Brooks.",
         "[PAR]"
     };
-    static const char *ppp[efhNR+2] = {
-        NULL, "RAD", "TWIST", "RISE", "LEN", "NHX", "DIP", "RMS", "CPHI",
-        "RMSA", "PHI", "PSI", "HB3", "HB4", "HB5", "CD222", NULL
-    };
     static gmx_bool    bCheck = FALSE, bFit = TRUE, bDBG = FALSE, bEV = FALSE;
     static int         rStart = 0, rEnd = 0, r0 = 1;
     t_pargs            pa []  = {
@@ -143,8 +106,6 @@ int gmx_helix(int argc, char *argv[])
           "Toggle fit to a perfect helix" },
         { "-db", FALSE, etBOOL, {&bDBG},
           "Print debug info" },
-        { "-prop", FALSE, etENUM, {ppp},
-          "Select property to weight eigenvectors with. WARNING experimental stuff" },
         { "-ev", FALSE, etBOOL, {&bEV},
           "Write a new 'trajectory' file for ED" },
         { "-ahxstart", FALSE, etINT, {&rStart},
@@ -184,18 +145,17 @@ int gmx_helix(int argc, char *argv[])
     };
 
     output_env_t   oenv;
-    FILE          *otrj;
-    char           buf[54], prop[256];
+    char           buf[54];
     t_trxstatus   *status;
     int            natoms, nre, nres;
     t_bb          *bb;
-    int            i, j, ai, m, nall, nbb, nca, teller, nSel = 0;
+    int            i, j, m, nall, nbb, nca, teller, nSel = 0;
     atom_id       *bbindex, *caindex, *allindex;
     t_topology    *top;
     int            ePBC;
-    rvec          *x, *xref, *xav;
+    rvec          *x, *xref;
     real           t;
-    real           rms, fac;
+    real           rms;
     matrix         box;
     gmx_rmpbc_t    gpbc = NULL;
     gmx_bool       bRange;
@@ -203,9 +163,7 @@ int gmx_helix(int argc, char *argv[])
         { efTPX, NULL,  NULL,   ffREAD  },
         { efNDX, NULL,  NULL,   ffREAD  },
         { efTRX, "-f",  NULL,   ffREAD  },
-        { efG87, "-to", NULL,   ffOPTWR },
         { efSTO, "-cz", "zconf", ffWRITE },
-        { efSTO, "-co", "waver", ffWRITE }
     };
 #define NFILE asize(fnm)
 
@@ -222,17 +180,6 @@ int gmx_helix(int argc, char *argv[])
 
     natoms = read_first_x(oenv, &status, opt2fn("-f", NFILE, fnm), &t, &x, box);
 
-    if (opt2bSet("-to", NFILE, fnm))
-    {
-        otrj = opt2FILE("-to", NFILE, fnm, "w");
-        strcpy(prop, ppp[0]);
-        fprintf(otrj, "%s Weighted Trajectory: %d atoms, NO box\n", prop, natoms);
-    }
-    else
-    {
-        otrj = NULL;
-    }
-
     if (natoms != top->atoms.nr)
     {
         gmx_fatal(FARGS, "Sorry can only run when the number of atoms in the run input file (%d) is equal to the number in the trajectory (%d)",
@@ -277,7 +224,6 @@ int gmx_helix(int argc, char *argv[])
 
     gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
 
-    snew(xav, natoms);
     teller = 0;
     do
     {
@@ -325,11 +271,6 @@ int gmx_helix(int argc, char *argv[])
                      xf[efhHB4].fp, xf[efhHB4].fp2,
                      xf[efhHB5].fp, xf[efhHB5].fp2,
                      t, nres, bb);
-
-            if (otrj)
-            {
-                dump_otrj(otrj, nall, allindex, x, xf[nSel].val, xav);
-            }
         }
     }
     while (read_next_x(oenv, status, &t, x, box));
@@ -339,23 +280,6 @@ int gmx_helix(int argc, char *argv[])
 
     close_trj(status);
 
-    if (otrj)
-    {
-        ffclose(otrj);
-        fac = 1.0/teller;
-        for (i = 0; (i < nall); i++)
-        {
-            ai = allindex[i];
-            for (m = 0; (m < DIM); m++)
-            {
-                xav[ai][m] *= fac;
-            }
-        }
-        write_sto_conf_indexed(opt2fn("-co", NFILE, fnm),
-                               "Weighted and Averaged conformation",
-                               &(top->atoms), xav, NULL, ePBC, box, nall, allindex);
-    }
-
     for (i = 0; (i < nres); i++)
     {
         if (bb[i].nrms > 0)
index be102c28b394bf2bcecb818b6fa2c7647b1016ac..2f74331ffe32fa35eb58139d35ac0e7a37b939f9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,7 +60,6 @@
 #include "gromacs/fileio/xtcio.h"
 #include "do_fit.h"
 #include "rmpbc.h"
-#include "gromacs/fileio/g87io.h"
 #include "pbc.h"
 #include "xvgr.h"
 #include "gromacs/fileio/xdrf.h"
index 4572b0000332f340bf915bc1c4b4561f73fc17a1..cda3df845597359a99e7938281f0870974e0cbfc 100644 (file)
@@ -61,7 +61,6 @@
 #include "gromacs/fileio/xtcio.h"
 #include "do_fit.h"
 #include "rmpbc.h"
-#include "gromacs/fileio/g87io.h"
 #include "pbc.h"
 #include "viewit.h"
 #include "xvgr.h"
@@ -613,9 +612,9 @@ int gmx_trjconv(int argc, char *argv[])
         "[gmx-trjcat] is better suited for concatenating multiple trajectory files.",
         "[PAR]",
 
-        "Currently seven formats are supported for input and output:",
-        "[TT].xtc[tt], [TT].trr[tt], [TT].trj[tt], [TT].gro[tt], [TT].g96[tt],",
-        "[TT].pdb[tt] and [TT].g87[tt].",
+        "The following formats are supported for input and output:",
+        "[TT].xtc[tt], [TT].trr[tt], [TT].trj[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],",
@@ -1339,7 +1338,6 @@ int gmx_trjconv(int argc, char *argv[])
                                                      grpnm);
                     break;
                 case efXTC:
-                case efG87:
                 case efTRR:
                 case efTRJ:
                     out = NULL;
@@ -1373,13 +1371,6 @@ int gmx_trjconv(int argc, char *argv[])
                 }
             }
 
-            if (ftp == efG87)
-            {
-                fprintf(gmx_fio_getfp(trx_get_fileio(trxout)),
-                        "Generated by %s. #atoms=%d, a BOX is"
-                        " stored in this file.\n", ShortProgram(), nout);
-            }
-
             /* Start the big loop over frames */
             file_nr  =  0;
             frame    =  0;
@@ -1742,7 +1733,6 @@ int gmx_trjconv(int argc, char *argv[])
                                 break;
                             case efTRJ:
                             case efTRR:
-                            case efG87:
                             case efXTC:
                                 if (bSplitHere)
                                 {
index ef945bef37671763a1fd2bad6399921513206053..87996bc8afb0e762dbac8caf8583c9223f5533e8 100644 (file)
@@ -144,9 +144,6 @@ const char *trajectoryFileNames[] = {
     "spc2-traj.pdb",
     "spc2-traj.g96"
 };
-// .g87 and .xyz file reading has been broken (and awkwardly
-// interactive) since at least v4.5 proposed on gmx-developers for
-// removing that support, so not testing it
 
 #ifdef __INTEL_COMPILER
 #pragma warning( disable : 177 )
diff --git a/src/gromacs/gmxana/legacytests/spc2-traj.g87 b/src/gromacs/gmxana/legacytests/spc2-traj.g87
deleted file mode 100644 (file)
index 544f46e..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Generated by bin/trjconv. #atoms=6, a BOX is stored in this file.
-   0.569   1.275   1.165   0.476   1.268   1.128   0.580   1.364   1.209   1.555
-   1.511   0.703   1.498   1.495   0.784   1.496   1.521   0.623
-   3.010   3.010   3.010
-   0.569   9.275   1.165   0.476   1.268   1.128   0.580   1.364   4.209   1.555
-   1.511   0.703   1.498   1.495   0.784   1.496   1.521   2.623
-   4.010   3.030   9.010