NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fs26.f File Reference

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.
 

Detailed Description

Year, month, day from julian day number.

Author
Ralph Jones
Date
1987-03-29

Definition in file w3fs26.f.

Function/Subroutine Documentation

◆ w3fs26()

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.

Program History Log:

Date | Programmer | Comments --—|---------—|------— 1987-03-29 | Ralph Jones | 1989-10-25 | Ralph Jones | Convert to cray cft77 fortran

Parameters
[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)
Note
A julian day number can be computed by using one of the following statement functions. A day of week can be computed from the julian day number. A day of year can be computed from a julian day number and year.

JDN(IYEAR,MONTH,IDAY) = IDAY - 32075

  • 1461 * (IYEAR + 4800 + (MONTH - 14) / 12) / 4
  • 367 * (MONTH - 2 - (MONTH -14) / 12 * 12) / 12
  • 3 * ((IYEAR + 4900 + (MONTH - 14) / 12) / 100) / 4

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.

Author
Ralph Jones
Date
1987-03-29

Definition at line 55 of file w3fs26.f.