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

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

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


Revision 1.3 - (show annotations) (download)
Sat Apr 7 16:21:05 2012 UTC (12 years 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 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_subdates.F,v 1.2 2003/10/09 04:19:19 edhill Exp $
2 C $Name: $
3
4 #include "CAL_OPTIONS.h"
5
6 SUBROUTINE CAL_SUBDATES(
7 I finaldate,
8 I initialdate,
9 O diffdate,
10 I myThid )
11
12 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
31 IMPLICIT NONE
32
33 C == global variables ==
34 #include "EEPARAMS.h"
35 #include "cal.h"
36
37 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
63 if ((initialdate(4) .gt. 0) .eqv.
64 & ( finaldate(4) .gt. 0)) then
65
66 if (initialdate(4) .eq. -1) then
67 C The time interval is subtracted.
68 workdate(1) = -initialdate(1)
69 workdate(2) = -initialdate(2)
70 workdate(3) = 0
71 workdate(4) = -1
72 call cal_AddTime( finaldate, workdate, diffdate, myThid )
73 else
74 C The time interval between initial and final date is calculated.
75 call cal_TimePassed(
76 & initialdate, finaldate, diffdate, myThid )
77 endif
78 else
79
80 ierr = 801
81 call cal_PrintError( ierr, myThid )
82 stop ' stopped in cal_SubDates.'
83
84 endif
85
86 RETURN
87 END

  ViewVC Help
Powered by ViewVC 1.1.22