SKSNUM SKSNUM SKSNUM SKSNUM SKSNUM SKSNUM SKSNUM ********************************************** ************************** ****** SUBROUTINE SKSNUM (LINE, NEXP, LOUT, KNAM, KKTOT, PNAM, NNPHAS, KKPHAS, KNUM, NT, NVAL, RVAL, KERR) This subroutine is used to read a format-free input line of combined alphanumerical data. It can be used to parse an input character string, LINE, which may be composed of several blank- delimited substrings. This subroutine assumes that the first substring in LINE is the name of a species in the Surface Chemkin mechanism. If the species name is not unique within the Surface Chemkin mechanism, the phase of the species should be input immediately after the species name, delimited by slashes. Upon return from the subroutine, KNUM returns the index position of the species within the Surface Chemkin linkfile. If the species name is not unique, KNUM returns the first position and NT returns the number of the times the species occurs within the linkfile. If the species name is not found, or there is a syntax error, on return, KNUM=0, NT=0, and KERR=.TRUE. The substrings in LINE following the first are expected to represent numbers. They are converted into floating point values and stored in the output vector, RVAL(*). Upon input, NEXP is equal to the number of values expected to be found. If NEXP numbers are not found, KERR will be set to .TRUE. on return from the subroutine. Example input: LINE = GA(S)/BULK1/ 1.2 NEXP = 1, the number of values expected LOUT = 6, a logical unit number on which to write diagnostic messages KNAM(*) = Array of character species names KKTOT = Total number of species PNAM(*) = Array of character phase names NNPHAS = Total number of phases KKPHAS(*)= Index array of the number of species in the phases Output: KNUM = The index number of the species which has the name "GA(S)" and resides in phase "BULK1" NT = 1, if there is only one species GA(S) in phase BULK1 NVAL = 1, the number of values found in LINE following the species name RVAL(1) = 1.200E+00, the substring converted to a real number KERR = .FALSE. INPUT LINE - Character string; length depends on calling routine. NEXP - Integer scalar, number of values to be found in LINE. If NEXP < 0, then IABS(NEXP) values are expected, but it is not an error condition if less values are found. LOUT - Integer scalar, formatted output file unit number. KNAM(*) - Character string array, species names; dimension at least KKTOT, the total species count. KKTOT - Integer scalar, the total species count. PNAM(*) - Character string array, phase names; dimension at least NNPHAS, the total phase count. NNPHAS - Integer scalar, the total phase count. KKPHAS(*) - Integer array, total species counts for the phases; dimension at least NNPHAS, the total phase count. OUTPUT KNUM - Integer scalar, species index if the species name appears in LINE. NT - Integer scalar, number of times the species name occurs in the linkfile. NVAL - Integer scalar, number of value character strings found in LINE. RVAL(*) - Real array, real values for their character strings in LINE; dimension at least NEXP, the number of values expected. KERR - Logical, syntax or dimensioning error flag;