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

Annotation of /MITgcm/pkg/cal/cal_subdates.F

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


Revision 1.3 - (hide annotations) (download)
Sat Apr 7 16:21:05 2012 UTC (12 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint65o, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, HEAD
Changes since 1.2: +57 -53 lines
stop if called before pkg/cal parameters were set.

1 jmc 1.3 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_subdates.F,v 1.2 2003/10/09 04:19:19 edhill Exp $
2 edhill 1.2 C $Name: $
3 heimbach 1.1
4 edhill 1.2 #include "CAL_OPTIONS.h"
5 heimbach 1.1
6 jmc 1.3 SUBROUTINE CAL_SUBDATES(
7 heimbach 1.1 I finaldate,
8     I initialdate,
9     O diffdate,
10 jmc 1.3 I myThid )
11 heimbach 1.1
12 jmc 1.3 C ==================================================================
13     C SUBROUTINE cal_SubDates
14     C ==================================================================
15     C
16     C o Subtract two dates. In case calendar dates are given finaldate
17     C must be after initialdate.
18     C
19     C started: Christian Eckert eckert@mit.edu 30-Jun-1999
20     C changed: Christian Eckert eckert@mit.edu 29-Dec-1999
21     C - restructured the original version in order to have a
22     C better interface to the MITgcmUV.
23     C Christian Eckert eckert@mit.edu 03-Feb-2000
24     C - Introduced new routine and function names, cal_<NAME>,
25     C for verion 0.1.3.
26     C
27     C ==================================================================
28     C SUBROUTINE cal_SubDates
29     C ==================================================================
30 heimbach 1.1
31 jmc 1.3 IMPLICIT NONE
32 heimbach 1.1
33 jmc 1.3 C == global variables ==
34     #include "EEPARAMS.h"
35 heimbach 1.1 #include "cal.h"
36    
37 jmc 1.3 C == routine arguments ==
38     INTEGER finaldate(4)
39     INTEGER initialdate(4)
40     INTEGER diffdate(4)
41     INTEGER myThid
42    
43     C == local variables ==
44     INTEGER workdate(4)
45     INTEGER ierr
46     CHARACTER*(MAX_LEN_MBUF) msgBuf
47    
48     C == end of interface ==
49    
50     IF ( cal_setStatus .LT. 1 ) THEN
51     WRITE( msgBuf,'(2A,4I9)') 'CAL_SUBDATES: ', 'finaldate=',
52     & finaldate(1),finaldate(2),finaldate(3),finaldate(4)
53     CALL PRINT_ERROR( msgBuf, myThid )
54     WRITE( msgBuf,'(2A,4I9)') 'CAL_SUBDATES: ', 'initialdate=',
55     & initialdate(1),initialdate(2),initialdate(3),initialdate(4)
56     CALL PRINT_ERROR( msgBuf, myThid )
57     WRITE( msgBuf,'(2A,I2,A)') 'CAL_SUBDATES: ',
58     & 'called too early (cal_setStatus=',cal_setStatus,' )'
59     CALL PRINT_ERROR( msgBuf, myThid )
60     STOP 'ABNORMAL END: S/R CAL_SUBDATES'
61     ENDIF
62 heimbach 1.1
63     if ((initialdate(4) .gt. 0) .eqv.
64     & ( finaldate(4) .gt. 0)) then
65    
66     if (initialdate(4) .eq. -1) then
67 jmc 1.3 C The time interval is subtracted.
68 heimbach 1.1 workdate(1) = -initialdate(1)
69     workdate(2) = -initialdate(2)
70     workdate(3) = 0
71     workdate(4) = -1
72 jmc 1.3 call cal_AddTime( finaldate, workdate, diffdate, myThid )
73 heimbach 1.1 else
74 jmc 1.3 C The time interval between initial and final date is calculated.
75     call cal_TimePassed(
76     & initialdate, finaldate, diffdate, myThid )
77 heimbach 1.1 endif
78     else
79    
80     ierr = 801
81 jmc 1.3 call cal_PrintError( ierr, myThid )
82 heimbach 1.1 stop ' stopped in cal_SubDates.'
83    
84     endif
85    
86 jmc 1.3 RETURN
87     END

  ViewVC Help
Powered by ViewVC 1.1.22