#================================================================== libIGCM_date This ksh library handles date calculs and convertions in different calendars. #================================================================== function IGCM_date_DaysInYear * Purpose: Return the number of days in a year * Usage: IGCM_date_DaysInYear yyyy if there is no argument on the command line, then assume that a yyyy is being piped in #================================================================== function IGCM_date_DaysInMonth * Purpose: Calculate the number of days in a month * Usage: IGCM_date_DaysInMonth yyyy mm or IGCM_date_DaysInMonth yyyymmdd if there are no command line arguments then assume that a yyyymmdd is being piped in and read the value. if there is only one argument assume it is a yyyymmdd on the command line other wise it is a yyyy and mm on the command line #================================================================== function IGCM_date_ConvertGregorianDateToJulian * Purpose: Convert yyyymmdd to yyyyddd * Usage: IGCM_date_ConvertGregorianDateToJulian 19980429 if there is no command line argument, then assume that the date" is coming in on a pipe and use read to collect it #================================================================== function IGCM_date_ConvertJulianDateToGregorian() * Purpose: Convert yyyyddd to yyyymmdd * Usage: IGCM_date_ConvertJulianDateToGregorian 1998213 if there is no command line argument, assume one is being piped in and read it #================================================================== function IGCM_date_AddDaysToJulianDate * Purpose: Add days to a yyyyddd formatted date * Usage: IGCM_date_AddDaysToJulianDate 1998312 { ,-}14 Read from the difference from the command lines and the date from the command line, or standard input #================================================================== function IGCM_date_AddDaysToGregorianDate * Purpose: Add days to a yyyymmdd formatted date * Usage: IGCM_date_AddDaysToGregorianDate 19980312 { ,-}14 Read from the difference from the command lines and the date from the command line, or standard input #================================================================== function IGCM_date_DaysBetweenJulianDate * Purpose: Calculate the days difference between two dates and reports the number days as jul1 - jul2 * Usage: IGCM_date_DaysBetweenJulianDate jul1 jul2 where julian date is in the form yyyyddd #================================================================== function IGCM_date_DaysBetweenGregorianDate () * Purpose: Calculate the days difference between two dates and reports the number days as grg1 - grg2 * Usage: IGCM_date_DaysBetweenGregorianDate grg1 grg2 where gregorian date is in the form yyyymmdd #================================================================== function IGCM_date_DaysSinceJC () * Purpose: Calculate the days difference between a date and 00010101 * Usage: IGCM_date_DaysSinceJC grg1 where gregorian date is in the form yyyymmdd #================================================================== function IGCM_date_Check * Purpose: Check the present file by comparison with a reference file