/[MITgcm]/MITgcm/pkg/cal/cal_isleap.F
ViewVC logotype

Contents of /MITgcm/pkg/cal/cal_isleap.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1.20.1 - (show annotations) (download)
Thu Oct 2 18:30:07 2003 UTC (20 years, 8 months ago) by adcroft
Branch: branch-genmake2
Changes since 1.1: +2 -2 lines
Mis-type CONFIG as CONF !!!

1 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_isleap.F,v 1.1 2001/05/14 22:07:26 heimbach Exp $
2
3 #include "CAL_OPTIONS.h"
4
5 integer function cal_IsLeap(
6 I year,
7 I mythid
8 & )
9
10 c ==================================================================
11 c FUNCTION cal_IsLeap
12 c ==================================================================
13 c
14 c o In case the Gregorian calendar is used determine whether the
15 c given year is a leap year or not.
16 c
17 c
18 c started: Christian Eckert eckert@mit.edu 30-Jun-1999
19 c
20 c changed: Christian Eckert eckert@mit.edu 29-Dec-1999
21 c
22 c - restructured the original version in order to have a
23 c better interface to the MITgcmUV.
24 c
25 c Christian Eckert eckert@mit.edu 03-Feb-2000
26 c
27 c - Introduced new routine and function names, cal_<NAME>,
28 c for verion 0.1.3.
29 c
30 c ==================================================================
31 c FUNCTION cal_IsLeap
32 c ==================================================================
33
34 implicit none
35
36 c == global variables ==
37
38 #include "cal.h"
39
40 c == routine arguments ==
41
42 integer year
43 integer mythid
44
45 c == end of interface ==
46
47 if ( usingGregorianCalendar ) then
48 if ( mod(year,4) .ne. 0 ) then
49 cal_IsLeap = 1
50 else
51 cal_IsLeap = 2
52 if ( (mod(year,100) .eq. 0) .and.
53 & (mod(year,400) .ne. 0) ) then
54 cal_IsLeap = 1
55 endif
56 endif
57 else if ( usingJulianCalendar ) then
58 if ( mod(year,4) .ne. 0 ) then
59 cal_IsLeap = 1
60 else
61 cal_IsLeap = 2
62 endif
63 else
64 cal_IsLeap = 1
65 endif
66
67 return
68 end
69

  ViewVC Help
Powered by ViewVC 1.1.22