1 |
dimitri |
1.2 |
C $Header: /u/gcmpack/MITgcm/pkg/cal/cal_getdate.F,v 1.1 2001/05/14 22:07:26 heimbach Exp $ |
2 |
heimbach |
1.1 |
|
3 |
|
|
#include "CAL_CPPOPTIONS.h" |
4 |
|
|
|
5 |
|
|
subroutine cal_GetDate( |
6 |
|
|
I myiter, |
7 |
|
|
I mytime, |
8 |
|
|
O mydate, |
9 |
|
|
I mythid |
10 |
|
|
& ) |
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 |
19 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
20 |
|
|
c |
21 |
|
|
c changed: Christian Eckert eckert@mit.edu 29-Dec-1999 |
22 |
|
|
c |
23 |
|
|
c - restructured the original version in order to have a |
24 |
|
|
c better interface to the MITgcmUV. |
25 |
|
|
c |
26 |
|
|
c Christian Eckert eckert@mit.edu 03-Feb-2000 |
27 |
|
|
c |
28 |
|
|
c - Introduced new routine and function names, cal_<NAME>, |
29 |
|
|
c for verion 0.1.3. |
30 |
|
|
c |
31 |
|
|
c ================================================================== |
32 |
|
|
c SUBROUTINE cal_GetDate |
33 |
|
|
c ================================================================== |
34 |
|
|
|
35 |
|
|
implicit none |
36 |
|
|
|
37 |
|
|
c == global variables == |
38 |
|
|
|
39 |
|
|
#include "cal.h" |
40 |
|
|
|
41 |
|
|
c == routine arguments == |
42 |
|
|
|
43 |
|
|
integer myiter |
44 |
|
|
_RL mytime |
45 |
|
|
integer mydate(4) |
46 |
|
|
integer mythid |
47 |
|
|
|
48 |
|
|
c == local variables == |
49 |
|
|
|
50 |
|
|
_RL secs |
51 |
|
|
integer workdate(4) |
52 |
|
|
|
53 |
|
|
c == end of interface == |
54 |
|
|
|
55 |
|
|
if (mytime .lt. 0) then |
56 |
|
|
if (myiter .ge. 0) then |
57 |
|
|
secs = float(myiter - modeliter0)*modelstep |
58 |
|
|
else |
59 |
|
|
print*,' cal_GetDate: Not a valid input!' |
60 |
|
|
endif |
61 |
|
|
else |
62 |
|
|
secs = mytime - modelstart |
63 |
|
|
endif |
64 |
|
|
|
65 |
|
|
call cal_TimeInterval( secs, 'secs', workdate, mythid ) |
66 |
|
|
call cal_AddTime( modelstartdate, workdate, mydate, mythid ) |
67 |
|
|
|
68 |
|
|
return |
69 |
|
|
end |
70 |
|
|
|