function id = find_comp_id(subsname,comps)

id = 0;

num_comps = length(comps);

for i = 1:num_comps
    if strcmp(subsname,comps{i})
        id = i;
        break;
    end
end

if id == 0
    error('compound id = 0 in find_comp_id')
end