function ind = findSpeciesInd(m, name)

% Converts a species name into its index in the x vector
%
% ind = findSpeciesInd(m, name) finds the species with "name" and retuns the 
% numerical index in the species vector.  For example, the following code
% prints out the initial concentration of the species 'H20'.
%
% ind = findSpeciesInd(m, 'H2O');
% disp('The initial concentration of H2O is ], num2str(m.ic(ind)));
% 

ind = find(strcmp(m.xNames, name));

len = length(ind);

if(len == 0)
    error('Did not find species "%s"', name);
elseif(len > 1)
    error('Found species "%s" %d times', name, len);
end