split.c contains the procedures which are necessary to split the RHF table file into separate atom data files. The user interface has to be provided by the "function dummies" show_dialog(enum dialog_messages i) and eport_print(char *text), therefore split.c does not contain any code for outputs. For this reason split.c is quite flexible to work in various environments.
For standardization an atom file name is build up by the following elements:
"[Z] = NumberElectrons ".The number of electrons is returned as a string preceded by an "_" character.
int split_rhf_file(FILE *original, char *directory)
The algorithm for splitting up the RHF table file is based on the format which is used in Atomic Data and Nuclear Data Tables, Vol. 53, No. 1, January 1993. Other formats will not be processed.
The outer while loop reads in each line of the RHF table file. If a token not equal to TOTAL, RHOat0 and ORB is found whose first characters are not "<", a digit and a space character, then split has found a new atom section, i.e. the first line which contains the atom name. Additionaly, the flag flag_data_scanning is checked which states whether split is currently reading in atom data or not. If this is false then preparations are made to store the now coming atom data into a separate file.
If flag_data_scanning was true then split closes the previous atom data file because a new one was found. Additionally, the file pointer is reset to its previous position which is the first line of the new section. previous_filepointer_position is continually updated during the execution of split.
The last else saves the scanned atom data into the atom data file, but only if flag_data_scanning is set to true and the currently processed line does not hold a page number of the RHF table file (innermost if statement).