Print

Print


I have a need to parse a character string of chemical species to 1) determine the number of species and then 2) read the individual species as character variables. An example might be the space delimited record for the following 17 species:

 

N2 C O O2 CO2 CO N NO NO2 CN C3 C2 C2N2 C5 C4 C4N2 C20

 

I have an old f77 program (parse.f) written by a colleague in 1988 and modified by myself in 1991 that allows a variety of delimiters, including space, comma, <, =, and >. I could run parse.f through a F77 to F90 converter and move forward. However, I am looking for a more modern F90 approach. Is there a better approach than parsing each character individually, checking to see if the single character matches the allowable delimiter characters and mucking around in general.

 

Thanks,

 

Ben Blackwell

Blackwell Consulting

PO Box 2879

Corrales, NM 87048

505-897-5090

(fax) 505-890-4992

[log in to unmask]