User's Guide

TOJULIAN

Convert a calander date to a julian date

Function:

Convert a calander date to a julian date. An input date is converted to either a JJJ or a YYYYJJJ date where YYYY is the year and JJJ is the julian day.

Parameters:

MONTH
Value of the input month

DAY
Value of the input day

YEAR
Value of the input year. This may be a 2- or 4-digit year.

JDATE
Returned Julian date. Declare as an integer.

YRDAYFLG("NO")
Flag: include year in JDATE. If flag is NO the julian date is returned as JJJ, the 3-digit julian day. If flag is YES the julian date is returned as YYYYJJJ, a 7-digit year and julian day combination.

Examples:

  1. LAS> tojulian month=10 day=4 year=2000 jdate=jdate

    The calander date 10/04/2000 is converted to a julian date of 278 which is the default return type.

  2. LAS> tojulian month=3 day=20 year=2001 jdate=jdate yrdayflg=yes

    The calendar date 03/20/2001 is converted to a julian date of 2001079 since the YRDAYFLG was specified as YES.

Description/Algorithm:

The input year is first converted to a 4-digit year and checked to see if it's a leap year. The number of days in February is adjusted if the year is a leap year. The month and day values are checked for correctness. The julian day is calculated and if YRDAYFLG=YES the year is added to the return value.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [tojulian-fatal] Error in date specification

    The input date specification was invalid. The day was out of range for the month specified.

User Notes:

    None.