* 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 "gmxpre.h"
+
#include "config.h"
#include <errno.h>
#include "thread_mpi/threads.h"
#include "gromacs/utility/fatalerror.h"
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/futil.h"
#include "filenm.h"
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:
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, mode);
+ 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
{
- /* 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 */
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));