function yd70=dt2yd( yr, month, day)
% function yd70=dt2yd( yr, month, day)
%
% convert date to yearday since 1970
%

yrzero=1970;
mntab=[31 28 31 30 31 30 31 31 30 31 30 31];
mday=cumsum(mntab); dayinyr=mday(12);

yd70=0;
for iyr=yrzero:yr-1
  yd70=yd70+dayinyr;
  if ~rem(iyr,4)
    yd70=yd70+1;
  end
end
 
yd70=yd70+day;
if month>1
  yd70=yd70+mday(month-1);
end

if ~rem(yr,4) & month>2
  yd70=yd70+1;
end

return









