C Library Functions  - date_to_julian (3)

NAME

date_to_julian(3f) - [M_time:JULIAN] converts DAT date-time array to Julian Date (LICENSE:MIT)

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

subroutine date_to_julian(dat,juliandate,ierr)

    integer,intent(in)               :: dat(8)
    real(kind=realtime),intent(out)  :: juliandate
    integer,intent(out)              :: ierr

DESCRIPTION

Converts a DAT date-time array to a Julian Date value.

Julian Dates (abbreviated JD) are simply a continuous count of days and fractions since noon Universal Time on January 1, 4713 BC (on the Julian calendar). Julian dates are widely used as time variables within astronomical software. Typically, a 64-bit floating point (double precision) variable can represent an epoch expressed as a Julian date to about 20 microsecond precision.

OPTIONS

dat Integer array holding a "DAT" array, similar in structure to the array returned by the intrinsic DATE_AND_TIME(3f):
          dat=[ year,month,day,timezone,hour,&
              & minutes,seconds,milliseconds]

RETURNS

juliandate
  A Julian Date (JD) is the number of days since noon (not midnight) on January 1st, 4713 BC.
ierr Error code. If 0 no error occurred.

EXAMPLE

Sample Program:

    program demo_date_to_julian
    use M_time, only : date_to_julian,realtime
    implicit none
    integer             :: dat(8)
    real(kind=realtime) :: juliandate
    integer             :: ierr
       ! generate DAT array
       call date_and_time(values=dat)
       ! show DAT array
       write(*,’(" Today is:",*(i0:,":"))’)dat
       ! convert DAT to Julian Date
       call date_to_julian(dat,juliandate,ierr)
       write(*,*)’Julian Date is ’,juliandate
       write(*,*)’ierr is ’,ierr
    end program demo_date_to_julian

results:

    Today is:2016:7:19:-240:11:3:13:821
    Julian Date is    2457589.1272432986
    ierr is            0

AUTHOR

John S. Urban, 2015

LICENSE

    MIT


Nemo Release 3.1 date_to_julian (3) February 23, 2025
Generated by manServer 1.08 from aad17fd0-79f6-4ce2-bba7-d5a98aeaf907 using man macros.