function 	yrday = date2yd(date)

mdys = [0 31 28 31 30 31 30 31 31 30 31 30];

mon = date(2);	day = date(3); hr = date(4); min = date(5); sec = date(6);

yrday = sum(mdys(1:mon)) + day + ((sec/60 + min)/60 + hr)/24 - 1;
