OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
gregor.f
Go to the documentation of this file.
1  subroutine gregor(JULDAY, YEAR, MONTH, DAY)
2 C********************************************************************
3 C
4 C Converts Julian day into Gregorian MONTH/DAY.
5 C
6 C Input parameters:
7 C ----------------
8 C JULDAY: I Julian day of YEAR
9 C YEAR: I Year in which JULDAY occurs
10 C
11 C Output parameters:
12 C -----------------
13 C DAY: I Day of MONTH in YEAR
14 C MONTH: I Month in YEAR
15 C
16 C Functions:
17 C ---------
18 C LEAP: L SP$GEN_LIB
19 C
20 C Created by Michael Darzi, GSC, 10/89.
21 C To UNIX: B. D. Schieber, SAIC/GAC, 93
22 C********************************************************************
23 
24  implicit none
25  logical LEAP
26  integer DAY, MONTH, YEAR, JULDAY, JDAYS(12,2), II
27  data jdays/0,31,59,90,120,151,181,212,243,273,304,334,
28  . 0,31,60,91,121,152,182,213,244,274,305,335/
29 
30  ii = 1
31  if (leap(year)) ii = 2
32 
33  month = 12
34  10 continue
35  if (julday .gt. jdays(month,ii)) go to 20
36  month = month - 1
37  go to 10
38 
39  20 continue
40  day = julday - jdays(month,ii)
41  return
42  end
subroutine gregor(JULDAY, YEAR, MONTH, DAY)
Definition: gregor.f:2