Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/PRBEM/IRBEM/llms.txt

Use this file to discover all available pages before exploring further.

IRBEM provides a set of Fortran utility functions for date and time conversions that are used throughout the library internals and are fully callable from user code. These routines handle conversions between calendar dates, Julian Day Numbers, day-of-year values, and decimal years.
IRBEM’s primary time inputs are year (integer), day-of-year (integer), and UT (double, seconds since midnight). The utilities on this page help you construct those values from other common representations such as calendar month/day or decimal year.

JULDAY

Calculate the Julian Day Number for a given calendar month, day, and year. The Julian Day Number begins at noon of the specified calendar date.
INTEGER month, day, year, julday
month = 2
day   = 2
year  = 2015
julday = JULDAY(year, month, day)

Parameters

month
integer
required
Month number (1 = January, …, 12 = December).
day
integer
required
Day of the month.
year
integer
required
Four-digit year.

Output

julday
integer
Julian Day Number, which begins at noon of the specified calendar date.

CALDAT

Return the calendar date (month, day, year) for a given Julian Day Number. This is the inverse of JULDAY.
INTEGER julian, year, month, day
julian = 2457055    ! Julian Day for 2015-02-02
call CALDAT(julian, year, month, day)
! year = 2015, month = 2, day = 2

Parameters

julday
integer
required
Julian Day Number to convert.

Output

month
integer
Month number (1 = January, …, 12 = December).
day
integer
Day of the month.
year
integer
Four-digit year.

GET_DOY

Calculate the day of year for a given month, day, and year. January 1st is day 1.
INTEGER month, day, year, doy
month = 2
day   = 2
year  = 2015
doy = GET_DOY(year, month, day)
! doy = 33

Parameters

month
integer
required
Month number (1 = January, …, 12 = December).
day
integer
required
Day of the month.
year
integer
required
Four-digit year.

Output

doy
integer
Day of year (1 for January 1st).

DECY2DATE_AND_TIME

Convert a decimal year value to its full date and time components: year, month, day of month, day of year, hour, minute, second, and UT seconds. A decimal year of yyyy.0d0 corresponds to January 1st of that year at 00:00:00 UT.
DOUBLE PRECISION Dec_y, UT
INTEGER Year, Month, Day, doy, hour, minute, second

Dec_y = 2015.0869d0   ! approx. 2015-02-02 ~00:00
CALL DECY2DATE_AND_TIME(Dec_y, Year, Month, Day, doy, hour, minute, second, UT)

Parameters

dec_y
double
required
Decimal year. yyyy.0d0 is January 1st of year yyyy at 00:00:00 UT.

Output

year
integer
Four-digit year.
month
integer
Month number (1 = January, …, 12 = December).
day
integer
Day of the month.
doy
integer
Day of year (1 for January 1st).
hour
integer
UT hour of day (h).
minute
integer
UT minute (min).
second
integer
UT second (sec).
UT
double
UT time of day expressed in seconds since midnight.

DATE_AND_TIME2DECY

Convert a calendar date and time (year, month, day, hour, minute, second) to a decimal year. This is the inverse of DECY2DATE_AND_TIME.
DOUBLE PRECISION Dec_y
INTEGER Year, Month, Day, hour, minute, second

Year   = 2015
Month  = 2
Day    = 2
hour   = 6
minute = 12
second = 43
CALL DATE_AND_TIME2DECY(Year, Month, Day, hour, minute, second, Dec_y)

Parameters

year
integer
required
Four-digit year.
month
integer
required
Month number (1 = January, …, 12 = December).
day
integer
required
Day of the month.
hour
integer
required
UT hour of day (h).
minute
integer
required
UT minute (min).
second
integer
required
UT second (sec).

Output

dec_y
double
Decimal year. yyyy.0d0 is January 1st of year yyyy at 00:00:00 UT.

DOY_AND_UT2DATE_AND_TIME

Calculate month, day, hour, minute, and second from year, day of year, and UT seconds. This converts the native IRBEM time triple directly into a full calendar/clock representation.
INTEGER Year, Doy, Month, Day, hour, minute, second
DOUBLE PRECISION UT

Year = 2015
Doy  = 33
UT   = 22363.0d0      ! seconds since midnight
CALL DOY_AND_UT2DATE_AND_TIME(Year, Doy, UT, Month, Day, hour, minute, second)
! Month = 2, Day = 2, hour = 6, minute = 12, second = 43

Parameters

year
integer
required
Four-digit year.
doy
integer
required
Day of year (1 for January 1st).
UT
double
required
UT time of day in seconds since midnight.

Output

month
integer
Month number (1 = January, …, 12 = December).
day
integer
Day of the month.
hour
integer
UT hour of day (h).
minute
integer
UT minute (min).
second
integer
UT second (sec).

Practical example: building IRBEM time inputs

Most IRBEM routines accept time as a triple of (iyear, idoy, UT). The snippet below shows how to construct that triple from a conventional calendar date using the utilities above.
! Convert a calendar date to IRBEM format (iyear, idoy, UT)
INTEGER iyear, idoy, month, day
DOUBLE PRECISION UT

iyear = 2015
month = 2
day   = 2
idoy  = GET_DOY(iyear, month, day)   ! = 33
UT    = 6*3600.0d0 + 12*60.0d0 + 43.0d0  ! 06:12:43 → 22363 s
Python users: the Python wrapper accepts ISO 8601 datetime strings (e.g. "2015-02-02T06:12:43") or datetime objects directly inside the position dictionary X. No manual date/time conversion is needed; the wrapper handles the (iyear, idoy, UT) packing internally.

Build docs developers (and LLMs) love