OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
julian.f
Go to the documentation of this file.
1  integer function julian(DAY, MONTH, YEAR)
2 C****************************************************************
3 C
4 C Converts Gregorian DAY/MONTH/YEAR into Julian day.
5 C
6 C Input parameters:
7 C ----------------
8 C DAY: I Day of MONTH in YEAR; 1 to 31
9 C MONTH: I Month in YEAR; 1 to 12
10 C YEAR: I Year in which to convert DAY/MONTH
11 C
12 C Function:
13 C --------
14 C LEAP: L SP GEN_UTILS
15 C
16 C Created by Michael Darzi, GSC, 9/89.
17 C To UNIX: BD Schieber, SAIC/GSC, 1993
18 C****************************************************************
19  implicit none
20  logical leap
21  integer day, month, year, jdays(12,2), ii
22  data jdays/0,31,59,90,120,151,181,212,243,273,304,334,
23  . 0,31,60,91,121,152,182,213,244,274,305,335/
24 
25  ii = 1
26  if (leap(year)) ii = 2
27  julian = min(max(1,day),31) + jdays(min(max(1,month),12),ii)
28 
29  return
30  end
#define max(A, B)
Definition: main_biosmap.c:61
#define min(A, B)
Definition: main_biosmap.c:62
logical function leap(YEAR)
Definition: leap.f:10
integer function julian(DAY, MONTH, YEAR)
Definition: julian.f:2