! call julmdy(dayof,month,iday,iyear) !converts old day of yr ! returns month=(1-12) and iday (of month). uses iyear supplied, or ! present year if iyear=0. All arguments are integer*4 subroutine julmdy(nday,mon,day,iy) implicit none character*12 s1,s2 integer*4 i,nday,mon,day,iy integer monlen(12)/31,28,31,30,31,30,31,31,30,31,30,31/ if (iy.eq.0) then !get present year call date_and_time(s1,s2) read(s1,99) iy !yr month num 99 format(i4) endif monlen(2)=28 !not leap year if(mod(iy,4).eq.0) monlen(2)=29 !leap year if(mod(iy,100).eq.0) monlen(2)=28 !not leap year if(mod(iy,400).eq.0) monlen(2)=29 ! leap year mon=1 ; day=nday do i=1,11 if (day.gt.monlen(mon)) then day=day-monlen(i) mon=mon+1 endif enddo return end