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

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

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


Revision 1.6 - (show annotations) (download)
Fri Jun 8 02:17:01 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, 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.5: +21 -19 lines
changed so that output date is function of input time only (less ambiguous)

1 C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_getdate.F,v 1.5 2012/04/07 22:02:11 jmc Exp $
2 C $Name: $
3
4 #include "CAL_OPTIONS.h"
5
6 SUBROUTINE CAL_GETDATE(
7 I myIter,
8 I myTime,
9 O mydate,
10 I myThid )
11
12 C ==================================================================
13 C SUBROUTINE cal_GetDate
14 C ==================================================================
15 C
16 C o Determine the current date given the iteration number and/or the
17 C current time of integration.
18 C <- changed to be function of current time only (less ambiguous)
19 C
20 C started: Christian Eckert eckert@mit.edu 30-Jun-1999
21 C changed: Christian Eckert eckert@mit.edu 29-Dec-1999
22 C - restructured the original version in order to have a
23 C better interface to the MITgcmUV.
24 C Christian Eckert eckert@mit.edu 03-Feb-2000
25 C - Introduced new routine and function names, cal_<NAME>,
26 C for verion 0.1.3.
27 C
28 C ==================================================================
29 C SUBROUTINE cal_GetDate
30 C ==================================================================
31
32 IMPLICIT NONE
33
34 C == global variables ==
35 #include "EEPARAMS.h"
36 #include "cal.h"
37
38 C == routine arguments ==
39 INTEGER myIter
40 _RL myTime
41 INTEGER mydate(4)
42 INTEGER myThid
43
44 C == local variables ==
45 _RL secs
46 INTEGER workdate(4)
47 CHARACTER*(MAX_LEN_MBUF) msgBuf
48 C == end of interface ==
49
50 IF ( myIter .EQ. -1 ) THEN
51
52 C- Special case to return starDate_1 & _2 :
53 mydate(1) = startdate_1
54 mydate(2) = startdate_2
55 mydate(3) = 1
56 mydate(4) = 1
57
58 ELSEIF ( cal_setStatus .LT. 3 ) THEN
59
60 WRITE( msgBuf,'(2A,I10,A,F19.2)') 'CAL_GETDATE: ',
61 & 'myIter=', myIter, ' , myTime=', myTime
62 CALL PRINT_ERROR( msgBuf, myThid )
63 WRITE( msgBuf,'(2A,I2,A)') 'CAL_GETDATE: ',
64 & 'called too early (cal_setStatus=',cal_setStatus,' )'
65 CALL PRINT_ERROR( msgBuf, myThid )
66 STOP 'ABNORMAL END: S/R CAL_GETDATE'
67
68 c ELSEIF ( myIter.EQ.modelIter0 .OR. myTime.EQ.modelStart ) THEN
69 ELSEIF ( myTime.EQ.modelStart ) THEN
70
71 C- faster to just copy modelStartDate:
72 mydate(1) = modelStartDate(1)
73 mydate(2) = modelStartDate(2)
74 mydate(3) = modelStartDate(3)
75 mydate(4) = modelStartDate(4)
76
77 ELSE
78
79 c if ( myTime.lt.0. ) then
80 c if (myIter .ge. 0) then
81 c secs = float(myIter - modelIter0)*modelStep
82 c else
83 c print*,' cal_GetDate: Not a valid input!'
84 c STOP 'ABNORMAL END: S/R CAL_GETDATE'
85 c endif
86 c else
87 secs = myTime - modelStart
88 c endif
89
90 CALL CAL_TIMEINTERVAL( secs, 'secs', workdate, myThid )
91 CALL CAL_ADDTIME( modelStartDate, workdate, mydate, myThid )
92
93 ENDIF
94
95 RETURN
96 END

  ViewVC Help
Powered by ViewVC 1.1.22