SUBROUTINE JULIANt(iyear0,iyear,month,iday,time,itimesig, * xjulian,jsig) C COMPUTES JULIAN DAY, INCLUDING TIME, WITH RESPECTS C TO MIDNIGHT JANUARY 1 OF THE BASE YEAR C ADAPTED FROM ORIGINAL SUBROUTINE CREATED BY LINDA STATHOPOLIS c************************************************************* c c Passed variables c c iyear0 - base year for calculating julian day c iyear - present year c month,iday - present month,day c time - present time c itimesig - number of significant figures in time c xjulian - output julian day c jsig - output number of significant figures for julian day c c************************************************************ parameter (bmiss=-1E10,zdays=365.) dimension yrnorm(13),monthend(12) c double precision xjuliand,xtime data monthend/31,28,31,30,31,30,31,31,30,31,30,31/ data yrnorm/0,31,59,90,120,151,181,212,243,273,304,334,365/ xday=iday iadd=0 xadd=0. xjulian0=0. xjulian=bmiss jsig=0 iprect=itimesig c Calculate days to add between base year and present year do 50 i=iyear0,iyear-1 x1=0. if ( (i/4)*4 .eq. i ) x1=1. if ( (i/100)*100 .eq. i .and. * (i/400)*400 .ne. i ) x1=0. xjulian0=xjulian0+zdays+x1 50 continue c Check fo leap year if ( (iyear/4)*4 .eq. iyear .and. month .gt. 2 ) xadd=1. if ( (iyear/100)*100 .eq. iyear .and. * (iyear/400)*400 .ne. iyear ) xadd=0. if ( (iyear/4)*4 .eq. iyear .and. month .eq. 2 ) iadd=1 if ( (iyear/100)*100 .eq. iyear .and. * (iyear/400)*400 .ne. iyear ) iadd=0. c Do not set julian day if the date is suspect if ( iyear .le. 0 .or. month .le. 0 .or. iday .le. 0 * .or. month .gt. 12 ) then return elseif ( iday .gt. monthend(month)+iadd ) then return endif c Calculate time portion if ( time .lt. 0. .or. time .gt. 24 ) then xtime=0. iprect=0 elseif ( time .eq. 24. ) then xadd=xadd+1. xtime=0. iprect=2 else xtime=time/24. endif c Calculate julian day c xjuliand=xjulian0+yrnorm(month)+ c * (xday-1.)+xadd c xjuliand=xjuliand + xtime c xjulian=xjuliand xjulian=xjulian0+yrnorm(month)+ * (xday-1.)+xadd+ xtime c Calculate number of sig figs in julian day call findsignif(jsig,iprect,xjulian) if ( xjulian .eq. 0.00 .and. xtime .eq. 0. .and. * iprect .eq. 1 ) jsig=2 return end