function [idyjl]=dy2jul(lyr,im,id)

totday=[31,59,90,120,151,181,212,243,273,304,334,365]; 
totdayly=[31,60,91,121,152,182,213,244,274,305,335,366]; 

if(round(lyr/4.)*4==lyr) 
   if im>1 
      idyjl=totdayly(im-1)+id;
   else;
      idyjl=id;
   end;
else
   if im>1 
      idyjl=totday(im-1)+id;
   else;
      idyjl=id;
   end;
end;
   
