JULIAN() and julianc()

Fortran version:

    INTEGER FUNCTION  JULIAN( YEAR, MONTH, MDAY )
        INTEGER, INTENT(IN   ) :: YEAR	!  year, integer, YYYY
        INTEGER, INTENT(IN   ) :: MONTH	!  month-number 1...12
        INTEGER, INTENT(IN   ) :: MDAY	!  day-of-month 1...31

C version:

    int julianc( int   year  ,
                 int   month ,
                 int   mday ) ;

Summary:

JULIAN() returns the Julian day (1...365,366) corresponding to the date MONTH-MDAY-YEAR, using Zeller's-congruence algorithm, where MONTH is in the range 1-12; where MDAY is in the range 1-28,29,30,31, as appropriate for the given month; and YEAR is the 4-digit year (like 1995) instead of only the trailing 2 digits.

NOTE: This is not the Julian date -- only the day-number. To get the Julian date:

    JDATE = 1000 * YEAR  +  JULIAN ( YEAR, MONTH, MDAY )
    

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    

See also: subroutines

DAYMON(),
ISDSTIME(),
WKDAY(),
MMDDYY(), and
DT2STR()
as well as EDSS/ Models-3 date-time manipulation programs
gregdate and
juldate.

Preconditions:

#include "iodecl3.h" if called from C.

Valid YEAR, MONTH, MDAY (and after the Gregorian-calendar transition, which happened 1582 and after—in 1752 in the US).

Fortran Usage:

    ...
    INTEGER   JULIAN
    INTEGER   JDATE, YEAR
    ...
    YEAR  = 1988
    JDATE = 1000 * YEAR + JULIAN( YEAR, 3, 21 )
    !!....  Now JDATE is the Models-3 Julian date for March 21, 1988
    ...

C Usage:

    ...
#include "iodecl3.h"                          
    ...
    int  jdate, year, month, mday ;
    ...
    year  = 1999 ;
    month =    4 ;
    mday  =    1 ,
    jdate = 1000 * year  +  julianc( year, month, mday ) ;
            /*  Now jdate is the Models-3 Julian date for 
                April Fool's Day, 1999                     */
    ...


Previous: JDATE3

Next: MMDDYY

Up: Date-Time Manipulation Routines

To: Models-3/EDSS I/O API: The Help Pages