2.14: TQRFIL

TOCGroup 1TQCIOTQRBINGroup 2A-ZGroup 1

READ-DATA-FILE

Reads a thermodynamic data-file in ASCII format.

Synopsis

FORTRAN: CALL TQRFIL(NOERR)

C: tqrfil(&noerr);

Pascal: tqrfil(noerr);

Basic: Call tqrfil(noerr)


Name Type Value set on call or returned
NOERR INTEGER Returns an error number

The thermodynamic data-file in ASCII format to be read must be opened in the application program using default unit 10 (see Table 6), unless this has been changed using TQCIO.

For non-FORTRAN programs, TQOPNA and TQCLOS have to be used for opening and closing the data-file.

If the data-file to load is in binary format, use TQRBIN instead; if it is in transparent format, use TQRCST.

See also

TQOPNA, TQCLOS, Chapter 1.11

Examples

FORTRAN:View plain source code



C Read a thermochemical data-file in ASCII format
PROGRAM CAF7 IMPLICIT NONE
INTEGER NOERR
C Initialise ChemApp CALL TQINI(NOERR)
C Open data-file for reading CALL TQOPNA('cosi.dat', 10, NOERR)
C Read data-file CALL TQRFIL(NOERR)
C Close data-file CALL TQCLOS(10, NOERR)
END

C:View plain source code




/* Program cac7 */ /* Read a thermochemical data-file in ASCII format*/
#include "cacint.h"
int main() { LI noerr;
/* Initialise ChemApp */ tqini(&noerr);
/* Note that tqopna is used to open the thermochemical data-file, instead of a standard C library routine like fopen. The reason is that it is necessary to associate the data-file with a particular FORTRAN unit number (10 by default, see tqgio) so that the FORTRAN subroutine tqrfil can read from the correct file */ tqopna("cosi.dat",10,&noerr); if (noerr) { printf("ERROR: Cannot open data-file."); exit(noerr); }
/* Read data-file */ tqrfil(&noerr);
/* Close data-file */ /* Again, the routine for closing the data-file is not a standard C library routine like fclose, but a special one to make sure the file that was previously opened under the unit number specified is closed. */ tqclos(10,&noerr);
return 0;
}


ChemApp Programmer's Manual, Edition 3.6© GTT-Technologies, 2003