This subroutine computes julian date, given calendar date and time. input calendar date must be gregorian. input time value can be in any ut-like time scale (utc, ut1, tt, etc.) - output julian date will have same basis. algorithm by fliegel and van flandern.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | i |
year |
||
integer, | intent(in) | :: | m |
month number |
||
integer, | intent(in) | :: | k |
day of month |
||
real(kind=wp), | intent(in) | :: | h |
ut hours |
||
real(kind=wp), | intent(out) | :: | tjd |
julian date |
pure subroutine juldat (i,m,k,h,tjd) implicit none integer,intent(in) :: i !! year integer,intent(in) :: m !! month number integer,intent(in) :: k !! day of month real(wp),intent(in) :: h !! ut hours real(wp),intent(out) :: tjd !! julian date integer :: jd !! julian day no for day beginning at greenwich noon on given date jd = k-32075+1461*(i+4800+(m-14)/12)/4+367*(m-2-(m-14)/12*12)/12 & -3*((i+4900+(m-14)/12)/100)/4 tjd = jd - 0.5_wp + h/24.0_wp end subroutine juldat