X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Ffileio%2Fgmxfio.c;h=24dbc9f54a26b3b2ef46c767432d48d5e749c27a;hb=b2b75d45c43c98cf1362e0125381bfc6f0a85782;hp=3a38bf87f37c2319df0a5f4288a7c4615ea92454;hpb=cb466e44535ac45f2ee8341dcae39207b5813abe;p=alexxy%2Fgromacs.git 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));