function orca_save_run
%
% Copies ORCA box information so that same information from a given run
% can be loaded back in later.
%
orca_global
%
if isempty(ORC.out_root),
	disp('ENTER OUTPUT FILE ROOT TO SAVE THIS RUN');
	return
end
%
nboxtot=Obox.nboxtot; 
HBOX.nboxtot=nboxtot;
HBOX.string=cell(nboxtot,1);
HBOX.value=zeros(nboxtot,1);
HBOX.tag=cell(nboxtot,1);
% Can't do it this way because 'Value's turn out to be cell arrays:
%ii=1:nboxtot; HBOX.tag=get(Obox.handle(1,ii),'Tag');
%HBOX.string=get(Obox.handle(1,ii),'String');
%HBOX.value=get(Obox.handle(1,ii),'Value');
%
for jbox=1:nboxtot,
	h1=Obox.handle(1,jbox);
	HBOX.string{jbox}=get(h1,'String');
	hval=get(h1,'Value');
	HBOX.value(jbox)=hval(1);
	HBOX.tag{jbox}=get(h1,'Tag');
end
%
% Save structures to _gui.mat file:
gui_file=[ORC.out_root,'_orca'];
str=['save ',gui_file,' ORC HBOX']; eval(str);
% Also save file containing name of last _gui.mat file produced:
orca_root=ORC.out_root;
save orca_def orca_root
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
