function [xrows,slicelabel]=findrows(Nodes,iopt)
%
%  Name: findrows
% 
%  Usage: findrows
% 
%   Description:
%     Finds the row labels for an x or y slice
%     opt=1:  slices using constant x's
%     opt=2:  slices using constant y's
%
%  Version PJC960528
%
%  Author(s): P. Cornwell, cornwell@lanl.gov
%
%  Institution: Los Alamos National Laboratory,
%		ESA-EA
%
%  Copyright (c) 1996, The Regents of the University
%     	of California. (See top level of code for
%	full copyright statement.)
if iopt==1
   name='x = ';
else,
   name='y = ';
end

xtemp1=Nodes(:,1+iopt);
xtemp=xtemp1;
nrows=size(Nodes,1);

for i=1:nrows,
   xref=min(xtemp);
   nametemp=[name,num2str(xref)];
   slicelabel=str2mat(slicelabel,nametemp);
   xrowstemp=find(xtemp1==xref);
   n=length(xrowstemp);
   xrows(1:n,i)=xrowstemp;
   xrowstemp=find(xtemp~=xref);
   if isempty(xrowstemp), 
	slicelabel(1,:)=[];
	return;
   end;
   xtemp=xtemp(xrowstemp);
end
