function y = jul(year,yrday)

% 
% Format julianday = jul(year, yearday)
% I borrowed this from someone at ucsd, I should find out 
% the name of the original author.
%

% $Log$
% 

% $Id$
% 

% to get actual Julian day add 2440000, i.e the last 4
% digits are the same.
nyears = year - 1969;
year4=fix(nyears/4);
y = 221 + year4*1461 + (nyears-year4*4)*365 + yrday + 2440000 + 1;