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

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

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

revision 1.2 by edhill, Thu Oct 9 04:19:19 2003 UTC revision 1.3 by jmc, Sat Apr 7 16:21:05 2012 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  #include "CAL_OPTIONS.h"  #include "CAL_OPTIONS.h"
5    
6        integer function cal_IsLeap(        INTEGER FUNCTION CAL_ISLEAP(
7       I                             year,       I                             year,
8       I                             mythid       I                             myThid )
      &                           )  
9    
10  c     ==================================================================  C     ==================================================================
11  c     FUNCTION cal_IsLeap  C     FUNCTION cal_IsLeap
12  c     ==================================================================  C     ==================================================================
13  c  C
14  c     o In case the Gregorian calendar is used determine whether the  C     o In case the Gregorian calendar is used determine whether the
15  c       given year is a leap year or not.  C       given year is a leap year or not.
16  c  C
17  c                C     started: Christian Eckert eckert@mit.edu  30-Jun-1999
18  c     started: Christian Eckert eckert@mit.edu  30-Jun-1999  C     changed: Christian Eckert eckert@mit.edu  29-Dec-1999
19  c  C              - restructured the original version in order to have a
20  c     changed: Christian Eckert eckert@mit.edu  29-Dec-1999  C                better interface to the MITgcmUV.
21  c  C              Christian Eckert eckert@mit.edu  03-Feb-2000
22  c              - restructured the original version in order to have a  C              - Introduced new routine and function names, cal_<NAME>,
23  c                better interface to the MITgcmUV.  C                for verion 0.1.3.
24  c  C
25  c              Christian Eckert eckert@mit.edu  03-Feb-2000  C     ==================================================================
26  c  C     FUNCTION cal_IsLeap
27  c              - Introduced new routine and function names, cal_<NAME>,  C     ==================================================================
 c                for verion 0.1.3.  
 c  
 c     ==================================================================  
 c     FUNCTION cal_IsLeap  
 c     ==================================================================  
28    
29        implicit none        IMPLICIT NONE
   
 c     == global variables ==  
30    
31    C     == global variables ==
32    #include "EEPARAMS.h"
33  #include "cal.h"  #include "cal.h"
34    
35  c     == routine arguments ==  C     == routine arguments ==
36          INTEGER year
37        integer year        INTEGER myThid
38        integer mythid  
39    C     == local variables ==
40  c     == end of interface ==        CHARACTER*(MAX_LEN_MBUF) msgBuf
41    C     == end of interface ==
42    
43          IF ( cal_setStatus .LT. 1 ) THEN
44            WRITE( msgBuf,'(A,2(A,I9))')  'CAL_ISLEAP: ',
45         &          'year=', year
46            CALL PRINT_ERROR( msgBuf, myThid )
47            WRITE( msgBuf,'(2A,I2,A)') 'CAL_ISLEAP: ',
48         &    'called too early (cal_setStatus=',cal_setStatus,' )'
49            CALL PRINT_ERROR( msgBuf, myThid )
50            STOP 'ABNORMAL END: FUNCTION CAL_ISLEAP'
51          ENDIF
52    
53        if ( usingGregorianCalendar ) then        if ( usingGregorianCalendar ) then
54          if ( mod(year,4) .ne. 0 ) then          if ( mod(year,4) .ne. 0 ) then
# Line 65  c     == end of interface == Line 70  c     == end of interface ==
70         cal_IsLeap = 1         cal_IsLeap = 1
71        endif        endif
72    
73        return        RETURN
74        end        END
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22