This document explains the basic algorithms and functions which are used to read in data from RHF Tables atom files and to store the values in the atom data structure.
The code is straight forward.
inserts the R values, e.g. <R>, <1/R> etc., into the atom data structure.
The while loop, #1, looks for the orbital symbol in the atom structure. If the symbol is not found, #2, memory for a new orbital structure is allocated and the values are stored there. Otherwise, #3, the values are written into the existing orbital structure. The following while loop, #4, examines the shell pointers to look for a shell which has the same number as shell_value. If this one is not found, #5, a pointer to a new shell is created. Finally the R values can be stored.
stores the values of the data section of an atom data file into the atom structure.
This procedure works like XAInsertR which is mentioned above: if orbitals, shells or data blocks do not exist, new ones are created whereas existing ones are updated.
atom_ptr XAScan(char *filename)
XAScan opens the RHF Table file filenname and tries to read in the different atom data values. By extracting the values XAScan looks for certain keywords and stores the following data by calling the procedures XAInsertR and XAInsertData.
In the inner while loop XAScan looks for the key words TOTAL, KINETIC, POTENTIAL, VIRIAL, RHOAT0 and KATO to create a second string which contains the order of these keywords. This string is build up by the first letter of each word. After that the float values, which are just mentioned in the next line, can be stored into the right atom structure position. The start of the "values line" is found if the first character of parse_token_pointer is a digit or a minus sign.
Note
The data block table and R Value table, both stored in the third data
section, have to be separated by one or more empty lines.
The analysis of the R table has to cope with some irregularities. At #13 the starting point of P- or D-orbitals in system_string has to be searched, because these got one R Value more than S-orbitals. Therefore, in mixed data tables which store S- and P-orbital values this additional line has to be treated separately. The second i-- just "moves" the "string position pointer" i to the first "|" of the "||" element.
In line #14 the problem of some R tables is solved that two or more negative values may not be separated by a space. Unfortunately this has to be done by a tricky command structure, which should be examined more carefully when changes are necessary (in general, the different R values are going to be separated by a "#" character and inserted into the atom data structure shortly afterwards).