NCEPLIBS-w3emc 2.12.0
|
Year, month, day from julian day number. More...
Go to the source code of this file.
Functions/Subroutines | |
subroutine | w3fs26 (jldayn, iyear, month, iday, idaywk, idayyr) |
Computes year (4 digits), month, day, day of week, day of year from julian day number. | |
subroutine w3fs26 | ( | jldayn, | |
iyear, | |||
month, | |||
iday, | |||
idaywk, | |||
idayyr | |||
) |
Computes year (4 digits), month, day, day of week, day of year from julian day number.
this subroutine will work from 1583 a.d. to 3300 a.d.
Date | Programmer | Comments --—|---------—|------— 1987-03-29 | Ralph Jones | 1989-10-25 | Ralph Jones | Convert to cray cft77 fortran
[in] | JLDAYN | (INT) Julian day number |
[out] | IYEAR | (INT) Year (4 digits) |
[out] | MONTH | (INT) Month |
[out] | IDAY | (INT) Day |
[out] | IDAYWK | (INT) Day of week (1 is sunday, 7 is sat) |
[out] | IDAYYR | (INT) Day of year (1 to 366) |
JDN(IYEAR,MONTH,IDAY) = IDAY - 32075
IYR (4 DIGITS) , IDYR(1-366) Day of year
JULIAN(IYR,IDYR) = -31739 + 1461 * (IYR + 4799) / 4 -3 * ((IYR + 4899) / 100) / 4 + IDYR
Day of week from julian day number, 1 is sunday, 7 is saturday.
JDAYWK(JLDAYN) = MOD((JLDAYN + 1),7) + 1
Day of year from julian day number and 4 digit year.
JDAYYR(JLDAYN,IYEAR) = JLDAYN - (-31739+1461*(IYEAR+4799)/4-3*((IYEAR+4899)/100)/4)
The first function was in a letter to the editor communications of the acm volume 11 / number 10 / october, 1968. the 2nd function was derived from the first. This subroutine was also included in the same letter. Julian day number 1 is jan 1,4713 b.c. a julian day number can be used to replace a day of century, this will take care of the date problem in the year 2000, or reduce program changes to one line change of 1900 to 2000. Julian day numbers can be used for finding record numbers in an archive or day of week, or day of year.