da_julian_day.inc
References to this file elsewhere.
1 subroutine da_julian_day(NY,NM,ND,JD,METHOD)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 ! method = 1: input ---- ny, nm, nd. output ---- jd
6 ! method = 2: input ---- ny, jd. output ---- nm, nd
7 !-----------------------------------------------------------------------
8
9 implicit none
10
11 integer, intent(in) :: METHOD, NY
12 integer, intent(inout) :: NM, ND, JD
13
14 integer :: LOOP
15 integer, dimension(12) :: MDAY = (/31,28,31,30,31,30,31,31,30,31,30,31/)
16
17 if (trace_use_dull) call da_trace_entry("da_julian_day")
18
19 if (mod(ny,4) == 0) then
20 mday(2)=29
21 if (mod(ny,100) == 0) then
22 mday(2)=28
23 if (mod(ny,400) == 0) then
24 mday(2)=29
25 end if
26 end if
27 end if
28
29 if (method == 1) then
30 jd=nd
31 juday: do loop=1,nm-1
32 jd=jd+mday(loop)
33 end do juday
34 else if (method == 2) then
35 nm=1
36 nd=jd
37 do loop=1,11
38 if (nd <= mday(loop)) exit
39
40 nd=nd-mday(loop)
41 nm=nm+1
42 end do
43 end if
44
45 if (trace_use_dull) call da_trace_exit("da_julian_day")
46
47 end subroutine da_julian_day
48
49