function [eventno,year,yearday,dayminute,gmtime,lat,lon,xgrid,ygrid, ...
          totdepth,sampledepth,station,cast,type]= readevent(filename)
%  read an event ascii file and return 
%  number of data lines, number of events,
%  descriptive strings for variables, 
%  
%Event number  C  none
%Year          I  none
%Yearday       I  day
%Dayminute     I  minute
%GMT           I  hhmm
%Latitude      R  degrees
%Longitude     R  degrees
%Xgrid         I  kilometers
%Ygrid         I  kilometers
%Total depth   I  meters
%Sample depth  I  meters
%Station       I  none
%Cast          I  none
%Data Type     C  none
%
%  all variables are column vectors.
%
%           get header information
fid=fopen(filename,'r');
a=fgetl(fid);
nlines=sscanf(a,'%d',1);

for i=1:nlines
   a=fgetl(fid);
   desc(i)={a};
end
status=fclose(fid);

[eventno,year,yearday,dayminute,gmtime,lat,lon,xgrid,ygrid, ...
 totdepth,sampledepth,station,cast,type]= ...
 textread(filename,'%s %d %d %d %d %f %f %d %d %d %d %d %d %s','headerlines',nlines+1);

[nevents,n]=size(year);


