function cruiseid=getcruiseid(cruiseid)
%GETCRUISEID - 	read the cruise_id from a file 
% 
%USAGE -	cruiseid=getcruiseid(cruiseid)
%
%EXPLANATION -	if cruiseid is provided, return it, if the argument is empty
%		read the cruiseid from the file cruise_id in the current 
%		directory if the file exists
%
%SEE ALSO -	
%

%PROGRAM - 	MATLAB code by c.m.duncombe rae
%
%CREATED -	2007/11/27
%
% 
% VERSION: 
%	$Revision: 1.3 $
%	$Date: 2008/01/19 02:11:35 $
%	$Id: getcruiseid.m,v 1.3 2008/01/19 02:11:35 duncombe Exp duncombe $
%
%CHANGELOG: 
%
%DISCLAIMER -	No responsibility can be accepted for failure or 
%		incorrect operation of this code. No guarantee, express 
%		or implied, is given. 
%

if ~exist('cruiseid'), cruiseid=''; end;
if isempty(cruiseid), 
if exist('cruise_id','file'), 
	fid=fopen('cruise_id','r');
	cruiseid=fscanf(fid,'%s',inf);
	fclose(fid);
	disp(['Working with ' cruiseid ]);
else
	disp('No cruise_id file and no cruise id provided in function call');
	error(nargchk(1,1,nargin))
end;
end;
return;


