8.2 ChemApp does not read a data-file properly, how do I find out what is wrong?

If an error occurs (error no. 103 or 102) while reading the thermodynamic data-file using TQRFIL (Read – File), the reason is typically one of the following:

  • The file has not been opened properly. 

    This can especially happen when the subroutine TQOPEN (Open – File) is used (i.e. when programming in languages other than FORTRAN) and the file you are trying to open does not exist, at least not where you expect it to exist.

    Note: If you are using ChemApp V3.3.0 or later, use TQOPNA (Open-ASCII-Data-File), TQOPNB (Open-Binary-Data-File), or TQOPNT (Open-Transparent-Data-File) instead or TQOPEN when opening data-files for reading.

    The reason why this can happen with TQOPEN is that this subroutine can be used both for opening files for reading and writing, so if you are trying to open a file that does not exist, TQOPEN will not complain but create a file under this name, which is then existent and of zero length.

    Thus, always check first if the file you are planning to open actually exists using appropriate functions of the language you are using for your application program. Only after you verified that the file really exists you should open it with TQOPEN. Special care should be taken when using Microsoft Visual Basic®, because it might look for the file you are trying to open in different places, depending on whether you run your Visual Basic program from Visual Studio, or as a standalone executable.

    Thus, if you get errors 102 or 103, check if you find a file under the name you used as parameter to TQOPEN on your disk which has zero length. If you do, delete this file and run your program again. If the error is reported again and you find the zero length file again, you know you are not passing the right parameter to TQOPEN.

  • The chemical system contained in the data-file is too big for the version of ChemApp you are using. Check the size of the chemical system in the data-file against the sizes of the ChemApp-internal arrays (see subroutine TQSIZE).
  • If the data-file is in ASCII form, check whether the line endings are correct. If the data-file has been copied from a different platform (e.g. from a DOS to a Unix machine), it could be that the line endings have not been converted properly.
  • If you are using ChemApp V3.3.0 or later, make sure you are using the correct procedure to open your data-file, depending on what format data-file you have: TQOPNA (Open-ASCII-Data-File) for ASCII data-files, TQOPNB (Open-Binary-Data-File) for binary data-files, or TQOPNT (Open-Transparent-Data-File) for transparent data-files. 

If you have ChemSage available, try load the data-file with ChemSage. If ChemSage encounters a problem while reading a data-file, it interprets as much of it as it can and stores the intact part in a file called ‘newdat.dat’ before it aborts. The contents of this file (especially the very end) provides valuable hints as to where the problem might be located in the data-file.

If you cannot find the error, and other data-files load without problems, contact GTT’s Technical Support, we will help you locate the problem.