Returns Julian day from an array with date and time
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | date_array(6) |
Datetime [y,m,d,h,m,s] |
||
integer, | intent(in) | :: | ref_year |
Reference year |
Julian day
function date_to_julian(date_array, ref_year) result(res) !! Returns Julian day from an array with date and time integer, intent(in) :: date_array(6) !! Datetime [y,m,d,h,m,s] integer, intent(in) :: ref_year !! Reference year integer :: res !! Julian day ! Local variables integer :: b(6) b(1) = date_array(1) b(2) = 1 b(3) = 1 b(4) = 0 b(5) = 0 b(6) = 0 res = int(date_to_number(date_array, ref_year) - date_to_number(b, ref_year) + 1) end function date_to_julian