DAYMON() and daymonc()

Fortran version:

    SUBROUTINE DAYMON( JDATE, MNTH, MDAY )
        INTEGER, INTENT(IN   ) :: JDATE   !  Julian date, format YYYYDDD = 1000*Year + Day
        INTEGER, INTENT(  OUT) :: MNTH    !  month (1...12)
        INTEGER, INTENT(  OUT) :: MDAY    !  day-of-month (1...28,29,30,31)

C version:

daymonc() is a C wrapper calling the Fortran DAYMON()
    void daymonc( int    jdate ,
                  int  * month ,
                  int  * mday )

Summary:

This routine determines the month MNTH (1...12) and day-of-month MDAY (1...31) for the indicated Julian date JDATE (represented as an integer YYYYDDD).

For Fortran-90 declarations and interface checking:

    USE M3UTILIO
    

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

Preconditions:

For Fortran-90 declarations and interface checking: USE M3UTILIO, or #include "iodecl3.h" if called from C.

JDATE must be expressed in terms of Models-3 date and time conventions .

    JDATE = YEAR*1000  +  DAY
    1     ≤ DAY ≤ 365,366

JDATE should be after the Gregorian-calendar transition, which happened 1582 and after—in 1752 in the US and Great Britain.

Fortran Usage:

    ...
    USE M3UTILIO
    ...
    INTEGER  MDAY, MONTH
    ...
    CALL DAYMON( 1988033, MONTH, MDAY )
    !!   ==> MONTH and MDAY are now 2 (February) and 2.
    ...
    

C Usage:

    ...
    #include "iodecl3.h"
    ...
    int  month, mday
    ...
    daymonc( 1988034, &month, &mday )
    /*  month and mday are now 2 (Feb), and 3 (=34 - 31)  */
    ...


Previous: CURRSTEP

Next: DT2STR

Up: Date-Time Manipulation Routines

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